mac802154: remove driver ops in wpan-phy
This patch removes the driver ops callbacks inside of wpan_phy struct. It was used to check if a phy supports this driver ops call. We do this now via hardware flags. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:

committed by
Marcel Holtmann

parent
e1d299f61a
commit
a543c5989d
@@ -121,49 +121,6 @@ err:
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
static int mac802154_set_txpower(struct wpan_phy *phy, int db)
|
||||
{
|
||||
struct ieee802154_local *local = wpan_phy_priv(phy);
|
||||
|
||||
return drv_set_tx_power(local, db);
|
||||
}
|
||||
|
||||
static int mac802154_set_lbt(struct wpan_phy *phy, bool on)
|
||||
{
|
||||
struct ieee802154_local *local = wpan_phy_priv(phy);
|
||||
|
||||
return drv_set_lbt_mode(local, on);
|
||||
}
|
||||
|
||||
static int mac802154_set_cca_mode(struct wpan_phy *phy, u8 mode)
|
||||
{
|
||||
struct ieee802154_local *local = wpan_phy_priv(phy);
|
||||
|
||||
return drv_set_cca_mode(local, mode);
|
||||
}
|
||||
|
||||
static int mac802154_set_cca_ed_level(struct wpan_phy *phy, s32 level)
|
||||
{
|
||||
struct ieee802154_local *local = wpan_phy_priv(phy);
|
||||
|
||||
return drv_set_cca_ed_level(local, level);
|
||||
}
|
||||
|
||||
static int mac802154_set_csma_params(struct wpan_phy *phy, u8 min_be,
|
||||
u8 max_be, u8 retries)
|
||||
{
|
||||
struct ieee802154_local *local = wpan_phy_priv(phy);
|
||||
|
||||
return drv_set_csma_params(local, min_be, max_be, retries);
|
||||
}
|
||||
|
||||
static int mac802154_set_frame_retries(struct wpan_phy *phy, s8 retries)
|
||||
{
|
||||
struct ieee802154_local *local = wpan_phy_priv(phy);
|
||||
|
||||
return drv_set_max_frame_retries(local, retries);
|
||||
}
|
||||
|
||||
static void ieee802154_tasklet_handler(unsigned long data)
|
||||
{
|
||||
struct ieee802154_local *local = (struct ieee802154_local *)data;
|
||||
@@ -262,48 +219,6 @@ int ieee802154_register_hw(struct ieee802154_hw *hw)
|
||||
struct ieee802154_local *local = hw_to_local(hw);
|
||||
int rc = -ENOSYS;
|
||||
|
||||
if (hw->flags & IEEE802154_HW_TXPOWER) {
|
||||
if (!local->ops->set_txpower)
|
||||
goto out;
|
||||
|
||||
local->phy->set_txpower = mac802154_set_txpower;
|
||||
}
|
||||
|
||||
if (hw->flags & IEEE802154_HW_LBT) {
|
||||
if (!local->ops->set_lbt)
|
||||
goto out;
|
||||
|
||||
local->phy->set_lbt = mac802154_set_lbt;
|
||||
}
|
||||
|
||||
if (hw->flags & IEEE802154_HW_CCA_MODE) {
|
||||
if (!local->ops->set_cca_mode)
|
||||
goto out;
|
||||
|
||||
local->phy->set_cca_mode = mac802154_set_cca_mode;
|
||||
}
|
||||
|
||||
if (hw->flags & IEEE802154_HW_CCA_ED_LEVEL) {
|
||||
if (!local->ops->set_cca_ed_level)
|
||||
goto out;
|
||||
|
||||
local->phy->set_cca_ed_level = mac802154_set_cca_ed_level;
|
||||
}
|
||||
|
||||
if (hw->flags & IEEE802154_HW_CSMA_PARAMS) {
|
||||
if (!local->ops->set_csma_params)
|
||||
goto out;
|
||||
|
||||
local->phy->set_csma_params = mac802154_set_csma_params;
|
||||
}
|
||||
|
||||
if (hw->flags & IEEE802154_HW_FRAME_RETRIES) {
|
||||
if (!local->ops->set_frame_retries)
|
||||
goto out;
|
||||
|
||||
local->phy->set_frame_retries = mac802154_set_frame_retries;
|
||||
}
|
||||
|
||||
local->workqueue =
|
||||
create_singlethread_workqueue(wpan_phy_name(local->phy));
|
||||
if (!local->workqueue) {
|
||||
|
Reference in New Issue
Block a user