iface.c (036562f9c4d942f2fbc77ae3215309bde340546f) iface.c (04e850fe06312a9f570fcc7dbd0f141c012df404)
1/*
2 * Copyright 2007-2012 Siemens AG
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 111 unchanged lines hidden (view full) ---

120 return mac802154_wpan_update_llsec(dev);
121}
122
123int mac802154_set_mac_params(struct net_device *dev,
124 const struct ieee802154_mac_params *params)
125{
126 struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
127
1/*
2 * Copyright 2007-2012 Siemens AG
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 111 unchanged lines hidden (view full) ---

120 return mac802154_wpan_update_llsec(dev);
121}
122
123int mac802154_set_mac_params(struct net_device *dev,
124 const struct ieee802154_mac_params *params)
125{
126 struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
127
128 mutex_lock(&sdata->hw->slaves_mtx);
128 mutex_lock(&sdata->local->slaves_mtx);
129 sdata->mac_params = *params;
129 sdata->mac_params = *params;
130 mutex_unlock(&sdata->hw->slaves_mtx);
130 mutex_unlock(&sdata->local->slaves_mtx);
131
132 return 0;
133}
134
135void mac802154_get_mac_params(struct net_device *dev,
136 struct ieee802154_mac_params *params)
137{
138 struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
139
131
132 return 0;
133}
134
135void mac802154_get_mac_params(struct net_device *dev,
136 struct ieee802154_mac_params *params)
137{
138 struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
139
140 mutex_lock(&sdata->hw->slaves_mtx);
140 mutex_lock(&sdata->local->slaves_mtx);
141 *params = sdata->mac_params;
141 *params = sdata->mac_params;
142 mutex_unlock(&sdata->hw->slaves_mtx);
142 mutex_unlock(&sdata->local->slaves_mtx);
143}
144
145static int mac802154_wpan_open(struct net_device *dev)
146{
147 int rc;
148 struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
143}
144
145static int mac802154_wpan_open(struct net_device *dev)
146{
147 int rc;
148 struct ieee802154_sub_if_data *sdata = netdev_priv(dev);
149 struct wpan_phy *phy = sdata->hw->phy;
149 struct wpan_phy *phy = sdata->local->phy;
150
151 rc = mac802154_slave_open(dev);
152 if (rc < 0)
153 return rc;
154
155 mutex_lock(&phy->pib_lock);
156
157 if (phy->set_txpower) {

--- 176 unchanged lines hidden (view full) ---

334 kfree_skb(skb);
335 return NETDEV_TX_OK;
336 }
337
338 skb->skb_iif = dev->ifindex;
339 dev->stats.tx_packets++;
340 dev->stats.tx_bytes += skb->len;
341
150
151 rc = mac802154_slave_open(dev);
152 if (rc < 0)
153 return rc;
154
155 mutex_lock(&phy->pib_lock);
156
157 if (phy->set_txpower) {

--- 176 unchanged lines hidden (view full) ---

334 kfree_skb(skb);
335 return NETDEV_TX_OK;
336 }
337
338 skb->skb_iif = dev->ifindex;
339 dev->stats.tx_packets++;
340 dev->stats.tx_bytes += skb->len;
341
342 return mac802154_tx(sdata->hw, skb, page, chan);
342 return mac802154_tx(sdata->local, skb, page, chan);
343}
344
345static struct header_ops mac802154_header_ops = {
346 .create = mac802154_header_create,
347 .parse = mac802154_header_parse,
348};
349
350static const struct net_device_ops mac802154_wpan_ops = {

--- 246 unchanged lines hidden ---
343}
344
345static struct header_ops mac802154_header_ops = {
346 .create = mac802154_header_create,
347 .parse = mac802154_header_parse,
348};
349
350static const struct net_device_ops mac802154_wpan_ops = {

--- 246 unchanged lines hidden ---