mac802154: rename hw subif_data variable to local

This patch renames the hw attribute in struct ieee802154_sub_if_data to
local. This avoid confusing with the struct ieee802154_hw hw; inside of
local struct.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Alexander Aring
2014-10-25 17:16:37 +02:00
committed by Marcel Holtmann
parent 036562f9c4
commit 04e850fe06
6 changed files with 47 additions and 47 deletions

View File

@@ -33,26 +33,26 @@ int mac802154_slave_open(struct net_device *dev)
{
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
struct ieee802154_sub_if_data *subif;
struct ieee802154_local *local = sdata->hw;
struct ieee802154_local *local = sdata->local;
int res = 0;
ASSERT_RTNL();
if (sdata->type == IEEE802154_DEV_WPAN) {
mutex_lock(&sdata->hw->slaves_mtx);
list_for_each_entry(subif, &sdata->hw->slaves, list) {
mutex_lock(&sdata->local->slaves_mtx);
list_for_each_entry(subif, &sdata->local->slaves, list) {
if (subif != sdata && subif->type == sdata->type &&
subif->running) {
mutex_unlock(&sdata->hw->slaves_mtx);
mutex_unlock(&sdata->local->slaves_mtx);
return -EBUSY;
}
}
mutex_unlock(&sdata->hw->slaves_mtx);
mutex_unlock(&sdata->local->slaves_mtx);
}
mutex_lock(&sdata->hw->slaves_mtx);
mutex_lock(&sdata->local->slaves_mtx);
sdata->running = true;
mutex_unlock(&sdata->hw->slaves_mtx);
mutex_unlock(&sdata->local->slaves_mtx);
if (local->open_count++ == 0) {
res = local->ops->start(&local->hw);
@@ -74,7 +74,7 @@ int mac802154_slave_open(struct net_device *dev)
netif_start_queue(dev);
return 0;
err:
sdata->hw->open_count--;
sdata->local->open_count--;
return res;
}
@@ -82,15 +82,15 @@ err:
int mac802154_slave_close(struct net_device *dev)
{
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
struct ieee802154_local *local = sdata->hw;
struct ieee802154_local *local = sdata->local;
ASSERT_RTNL();
netif_stop_queue(dev);
mutex_lock(&sdata->hw->slaves_mtx);
mutex_lock(&sdata->local->slaves_mtx);
sdata->running = false;
mutex_unlock(&sdata->hw->slaves_mtx);
mutex_unlock(&sdata->local->slaves_mtx);
if (!--local->open_count)
local->ops->stop(&local->hw);
@@ -109,7 +109,7 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev)
sdata = netdev_priv(dev);
sdata->dev = dev;
sdata->hw = local;
sdata->local = local;
dev->needed_headroom = local->hw.extra_tx_headroom;
@@ -144,11 +144,11 @@ mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev)
sdata = netdev_priv(dev);
BUG_ON(sdata->hw->phy != phy);
BUG_ON(sdata->local->phy != phy);
mutex_lock(&sdata->hw->slaves_mtx);
mutex_lock(&sdata->local->slaves_mtx);
list_del_rcu(&sdata->list);
mutex_unlock(&sdata->hw->slaves_mtx);
mutex_unlock(&sdata->local->slaves_mtx);
synchronize_rcu();
unregister_netdevice(sdata->dev);
@@ -394,9 +394,9 @@ void ieee802154_unregister_hw(struct ieee802154_hw *hw)
mutex_unlock(&local->slaves_mtx);
list_for_each_entry_safe(sdata, next, &local->slaves, list) {
mutex_lock(&sdata->hw->slaves_mtx);
mutex_lock(&sdata->local->slaves_mtx);
list_del(&sdata->list);
mutex_unlock(&sdata->hw->slaves_mtx);
mutex_unlock(&sdata->local->slaves_mtx);
unregister_netdevice(sdata->dev);
}