Commit 036562f9 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

mac802154: rename mac802154_sub_if_data

Like wireless this structure should named ieee802154_sub_if_data and not
mac802154_sub_if_data. This patch renames the struct and variables to
sdata instead priv sometimes.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a5e1ec53
......@@ -66,7 +66,7 @@ struct ieee802154_local {
* Each ieee802154 device/transceiver may have several slaves and able
* to be associated with several networks at the same time.
*/
struct mac802154_sub_if_data {
struct ieee802154_sub_if_data {
struct list_head list; /* the ieee802154_priv->slaves list */
struct ieee802154_local *hw;
......
This diff is collapsed.
......@@ -75,11 +75,11 @@ static int mac802154_mlme_start_req(struct net_device *dev,
static struct wpan_phy *mac802154_get_phy(const struct net_device *dev)
{
struct mac802154_sub_if_data *priv = netdev_priv(dev);
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
return to_phy(get_device(&priv->hw->phy->dev));
return to_phy(get_device(&sdata->hw->phy->dev));
}
static struct ieee802154_llsec_ops mac802154_llsec_ops = {
......
......@@ -31,28 +31,28 @@
int mac802154_slave_open(struct net_device *dev)
{
struct mac802154_sub_if_data *priv = netdev_priv(dev);
struct mac802154_sub_if_data *subif;
struct ieee802154_local *local = priv->hw;
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
struct ieee802154_sub_if_data *subif;
struct ieee802154_local *local = sdata->hw;
int res = 0;
ASSERT_RTNL();
if (priv->type == IEEE802154_DEV_WPAN) {
mutex_lock(&priv->hw->slaves_mtx);
list_for_each_entry(subif, &priv->hw->slaves, list) {
if (subif != priv && subif->type == priv->type &&
if (sdata->type == IEEE802154_DEV_WPAN) {
mutex_lock(&sdata->hw->slaves_mtx);
list_for_each_entry(subif, &sdata->hw->slaves, list) {
if (subif != sdata && subif->type == sdata->type &&
subif->running) {
mutex_unlock(&priv->hw->slaves_mtx);
mutex_unlock(&sdata->hw->slaves_mtx);
return -EBUSY;
}
}
mutex_unlock(&priv->hw->slaves_mtx);
mutex_unlock(&sdata->hw->slaves_mtx);
}
mutex_lock(&priv->hw->slaves_mtx);
priv->running = true;
mutex_unlock(&priv->hw->slaves_mtx);
mutex_lock(&sdata->hw->slaves_mtx);
sdata->running = true;
mutex_unlock(&sdata->hw->slaves_mtx);
if (local->open_count++ == 0) {
res = local->ops->start(&local->hw);
......@@ -74,23 +74,23 @@ int mac802154_slave_open(struct net_device *dev)
netif_start_queue(dev);
return 0;
err:
priv->hw->open_count--;
sdata->hw->open_count--;
return res;
}
int mac802154_slave_close(struct net_device *dev)
{
struct mac802154_sub_if_data *priv = netdev_priv(dev);
struct ieee802154_local *local = priv->hw;
struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
struct ieee802154_local *local = sdata->hw;
ASSERT_RTNL();
netif_stop_queue(dev);
mutex_lock(&priv->hw->slaves_mtx);
priv->running = false;
mutex_unlock(&priv->hw->slaves_mtx);
mutex_lock(&sdata->hw->slaves_mtx);
sdata->running = false;
mutex_unlock(&sdata->hw->slaves_mtx);
if (!--local->open_count)
local->ops->stop(&local->hw);
......@@ -101,15 +101,15 @@ int mac802154_slave_close(struct net_device *dev)
static int
mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev)
{
struct mac802154_sub_if_data *priv;
struct ieee802154_sub_if_data *sdata;
struct ieee802154_local *local;
int err;
local = wpan_phy_priv(phy);
priv = netdev_priv(dev);
priv->dev = dev;
priv->hw = local;
sdata = netdev_priv(dev);
sdata->dev = dev;
sdata->hw = local;
dev->needed_headroom = local->hw.extra_tx_headroom;
......@@ -128,7 +128,7 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev)
rtnl_lock();
mutex_lock(&local->slaves_mtx);
list_add_tail_rcu(&priv->list, &local->slaves);
list_add_tail_rcu(&sdata->list, &local->slaves);
mutex_unlock(&local->slaves_mtx);
rtnl_unlock();
......@@ -138,7 +138,7 @@ mac802154_netdev_register(struct wpan_phy *phy, struct net_device *dev)
static void
mac802154_del_iface(struct wpan_phy *phy, struct net_device *dev)
{
struct mac802154_sub_if_data *sdata;
struct ieee802154_sub_if_data *sdata;
ASSERT_RTNL();
......@@ -162,12 +162,12 @@ mac802154_add_iface(struct wpan_phy *phy, const char *name, int type)
switch (type) {
case IEEE802154_DEV_MONITOR:
dev = alloc_netdev(sizeof(struct mac802154_sub_if_data),
dev = alloc_netdev(sizeof(struct ieee802154_sub_if_data),
name, NET_NAME_UNKNOWN,
mac802154_monitor_setup);
break;
case IEEE802154_DEV_WPAN:
dev = alloc_netdev(sizeof(struct mac802154_sub_if_data),
dev = alloc_netdev(sizeof(struct ieee802154_sub_if_data),
name, NET_NAME_UNKNOWN,
mac802154_wpan_setup);
break;
......@@ -382,7 +382,7 @@ EXPORT_SYMBOL(ieee802154_register_hw);
void ieee802154_unregister_hw(struct ieee802154_hw *hw)
{
struct ieee802154_local *local = mac802154_to_priv(hw);
struct mac802154_sub_if_data *sdata, *next;
struct ieee802154_sub_if_data *sdata, *next;
flush_workqueue(local->dev_workqueue);
destroy_workqueue(local->dev_workqueue);
......
This diff is collapsed.
......@@ -33,14 +33,14 @@
static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct mac802154_sub_if_data *priv;
struct ieee802154_sub_if_data *sdata;
u8 chan, page;
priv = netdev_priv(dev);
sdata = netdev_priv(dev);
/* FIXME: locking */
chan = priv->hw->phy->current_channel;
page = priv->hw->phy->current_page;
chan = sdata->hw->phy->current_channel;
page = sdata->hw->phy->current_page;
if (chan == MAC802154_CHAN_NONE) /* not initialized */
return NETDEV_TX_OK;
......@@ -53,14 +53,14 @@ static netdev_tx_t mac802154_monitor_xmit(struct sk_buff *skb,
dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;
return mac802154_tx(priv->hw, skb, page, chan);
return mac802154_tx(sdata->hw, skb, page, chan);
}
void mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb)
{
struct sk_buff *skb2;
struct mac802154_sub_if_data *sdata;
struct ieee802154_sub_if_data *sdata;
u16 crc = crc_ccitt(0, skb->data, skb->len);
u8 *data;
......@@ -90,7 +90,7 @@ static const struct net_device_ops mac802154_monitor_ops = {
void mac802154_monitor_setup(struct net_device *dev)
{
struct mac802154_sub_if_data *priv;
struct ieee802154_sub_if_data *sdata;
dev->addr_len = 0;
dev->hard_header_len = 0;
......@@ -105,9 +105,9 @@ void mac802154_monitor_setup(struct net_device *dev)
dev->netdev_ops = &mac802154_monitor_ops;
dev->ml_priv = &mac802154_mlme_reduced;
priv = netdev_priv(dev);
priv->type = IEEE802154_DEV_MONITOR;
sdata = netdev_priv(dev);
sdata->type = IEEE802154_DEV_MONITOR;
priv->chan = MAC802154_CHAN_NONE; /* not initialized */
priv->page = 0;
sdata->chan = MAC802154_CHAN_NONE; /* not initialized */
sdata->page = 0;
}
......@@ -41,7 +41,7 @@ struct xmit_work {
static void mac802154_xmit_worker(struct work_struct *work)
{
struct xmit_work *xw = container_of(work, struct xmit_work, work);
struct mac802154_sub_if_data *sdata;
struct ieee802154_sub_if_data *sdata;
int res;
mutex_lock(&xw->local->phy->pib_lock);
......@@ -81,7 +81,7 @@ netdev_tx_t mac802154_tx(struct ieee802154_local *local, struct sk_buff *skb,
u8 page, u8 chan)
{
struct xmit_work *work;
struct mac802154_sub_if_data *sdata;
struct ieee802154_sub_if_data *sdata;
if (!(local->phy->channels_supported[page] & (1 << chan))) {
WARN_ON(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment