Commit b9217266 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'master-2014-11-04' of...

Merge tag 'master-2014-11-04' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next



John W. Linville says:

====================
pull request: wireless-next 2014-11-07

Please pull this batch of updates intended for the 3.19 stream!

For the mac80211 bits, Johannes says:

"This relatively large batch of changes is comprised of the following:
 * large mac80211-hwsim changes from Ben, Jukka and a bit myself
 * OCB/WAVE/11p support from Rostislav on behalf of the Czech Technical
   University in Prague and Volkswagen Group Research
 * minstrel VHT work from Karl
 * more CSA work from Luca
 * WMM admission control support in mac80211 (myself)
 * various smaller fixes, spelling corrections, and minor API additions"

For the Bluetooth bits, Johan says:

"Here's the first bluetooth-next pull request for 3.19. The vast majority
of patches are for ieee802154 from Alexander Aring with various fixes
and cleanups. There are also several LE/SMP fixes as well as improved
support for handling LE devices that have lost their pairing information
(the patches from Alfonso). Jukka provides a couple of stability fixes
for 6lowpan and Szymon conformance fixes for RFCOMM. For the HCI drivers
we have one new USB ID for an Acer controller as well as a reset
handling fix for H5."

For the Atheros bits, Kalle says:

"Major changes are:

o ethtool support (Ben)

o print dev string prefix with debug hex buffers dump (Michal)

o debugfs file to read calibration data from the firmware verification
  purposes (me)

o fix fw_stats debugfs file, now results are more reliable (Michal)

o firmware crash counters via debugfs (Ben&me)

o various tracing points to debug firmware (Rajkumar)

o make it possible to provide firmware calibration data via a file (me)

And we have quite a lot of smaller fixes and clean up."

For the iwlwifi bits, Emmanuel says:

"The big new thing here is netdetect which allows the
firmware to wake up the platform when a specific network
is detected. Along with that I have fixes for d3 operation.
The usual amount of rate scaling stuff - we now support STBC.
The other commit that stands out is Johannes's work on
devcoredump. He basically starts to use the standard
infrastructure he built."

Along with that are the usual sort of updates and such for ath9k,
brcmfmac, wil6210, and a handful of other bits here and there...

Please let me know if there are problems!
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e344458f bf515fb1
......@@ -2306,6 +2306,14 @@ F: security/capability.c
F: security/commoncap.c
F: kernel/capability.c
CC2520 IEEE-802.15.4 RADIO DRIVER
M: Varka Bhadram <varkabhadram@gmail.com>
L: linux-wpan@vger.kernel.org
S: Maintained
F: drivers/net/ieee802154/cc2520.c
F: include/linux/spi/cc2520.h
F: Documentation/devicetree/bindings/net/ieee802154/cc2520.txt
CELL BROADBAND ENGINE ARCHITECTURE
M: Arnd Bergmann <arnd@arndb.de>
L: linuxppc-dev@lists.ozlabs.org
......@@ -4693,6 +4701,13 @@ S: Maintained
F: net/ieee802154/
F: net/mac802154/
F: drivers/net/ieee802154/
F: include/linux/nl802154.h
F: include/linux/ieee802154.h
F: include/net/nl802154.h
F: include/net/mac802154.h
F: include/net/af_ieee802154.h
F: include/net/cfg802154.h
F: include/net/ieee802154_netdev.h
F: Documentation/networking/ieee802154.txt
IGUANAWORKS USB IR TRANSCEIVER
......
......@@ -24,6 +24,7 @@ struct bcma_bus;
/* main.c */
bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
int timeout);
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
int bcma_bus_register(struct bcma_bus *bus);
void bcma_bus_unregister(struct bcma_bus *bus);
int __init bcma_bus_early_register(struct bcma_bus *bus,
......
......@@ -169,10 +169,8 @@ static void bcma_of_fill_device(struct platform_device *parent,
}
#endif /* CONFIG_OF */
static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
{
int err;
core->dev.release = bcma_release_core_dev;
core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
......@@ -196,6 +194,11 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
case BCMA_HOSTTYPE_SDIO:
break;
}
}
static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
{
int err;
err = device_register(&core->dev);
if (err) {
......
......@@ -505,6 +505,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
bus->nr_cores++;
other_core = bcma_find_core_reverse(bus, core->id.id);
core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1;
bcma_prepare_core(bus, core);
bcma_info(bus, "Core %d found: %s (manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
core->core_index, bcma_device_name(&core->id),
......
......@@ -79,6 +79,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x0489, 0xe057) },
{ USB_DEVICE(0x0489, 0xe056) },
{ USB_DEVICE(0x0489, 0xe05f) },
{ USB_DEVICE(0x0489, 0xe078) },
{ USB_DEVICE(0x04c5, 0x1330) },
{ USB_DEVICE(0x04CA, 0x3004) },
{ USB_DEVICE(0x04CA, 0x3005) },
......@@ -130,6 +131,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
......
......@@ -156,6 +156,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
......
......@@ -168,6 +168,36 @@ wakeup:
hci_uart_tx_wakeup(hu);
}
static void h5_peer_reset(struct hci_uart *hu)
{
struct h5 *h5 = hu->priv;
struct sk_buff *skb;
const unsigned char hard_err[] = { 0x10, 0x01, 0x00 };
BT_ERR("Peer device has reset");
h5->state = H5_UNINITIALIZED;
del_timer(&h5->timer);
skb_queue_purge(&h5->rel);
skb_queue_purge(&h5->unrel);
skb_queue_purge(&h5->unack);
h5->tx_seq = 0;
h5->tx_ack = 0;
skb = bt_skb_alloc(3, GFP_ATOMIC);
if (!skb)
return;
bt_cb(skb)->pkt_type = HCI_EVENT_PKT;
memcpy(skb_put(skb, 3), hard_err, 3);
/* Send Hardware Error to upper stack */
hci_recv_frame(hu->hdev, skb);
}
static int h5_open(struct hci_uart *hu)
{
struct h5 *h5;
......@@ -283,8 +313,12 @@ static void h5_handle_internal_rx(struct hci_uart *hu)
conf_req[2] = h5_cfg_field(h5);
if (memcmp(data, sync_req, 2) == 0) {
if (h5->state == H5_ACTIVE)
h5_peer_reset(hu);
h5_link_control(hu, sync_rsp, 2);
} else if (memcmp(data, sync_rsp, 2) == 0) {
if (h5->state == H5_ACTIVE)
h5_peer_reset(hu);
h5->state = H5_INITIALIZED;
h5_link_control(hu, conf_req, 3);
} else if (memcmp(data, conf_req, 2) == 0) {
......
......@@ -10,16 +10,6 @@ menuconfig IEEE802154_DRIVERS
If you say N, all options in this submenu will be skipped and
disabled.
config IEEE802154_FAKEHARD
tristate "Fake LR-WPAN driver with several interconnected devices"
depends on IEEE802154_DRIVERS
---help---
Say Y here to enable the fake driver that serves as an example
of HardMAC device driver.
This driver can also be built as a module. To do so say M here.
The module will be called 'fakehard'.
config IEEE802154_FAKELB
depends on IEEE802154_DRIVERS && MAC802154
tristate "IEEE 802.15.4 loopback driver"
......
obj-$(CONFIG_IEEE802154_FAKEHARD) += fakehard.o
obj-$(CONFIG_IEEE802154_FAKELB) += fakelb.o
obj-$(CONFIG_IEEE802154_AT86RF230) += at86rf230.o
obj-$(CONFIG_IEEE802154_MRF24J40) += mrf24j40.o
......
This diff is collapsed.
......@@ -21,10 +21,10 @@
#include <linux/skbuff.h>
#include <linux/pinctrl/consumer.h>
#include <linux/of_gpio.h>
#include <linux/ieee802154.h>
#include <net/mac802154.h>
#include <net/wpan-phy.h>
#include <net/ieee802154.h>
#include <net/cfg802154.h>
#define SPI_COMMAND_BUFFER 3
#define HIGH 1
......@@ -193,7 +193,7 @@
/* Driver private information */
struct cc2520_private {
struct spi_device *spi; /* SPI device structure */
struct ieee802154_dev *dev; /* IEEE-802.15.4 device */
struct ieee802154_hw *hw; /* IEEE-802.15.4 device */
u8 *buf; /* SPI TX/Rx data buffer */
struct mutex buffer_mutex; /* SPI buffer mutex */
bool is_tx; /* Flag for sync b/w Tx and Rx */
......@@ -453,20 +453,20 @@ cc2520_read_rxfifo(struct cc2520_private *priv, u8 *data, u8 len, u8 *lqi)
return status;
}
static int cc2520_start(struct ieee802154_dev *dev)
static int cc2520_start(struct ieee802154_hw *hw)
{
return cc2520_cmd_strobe(dev->priv, CC2520_CMD_SRXON);
return cc2520_cmd_strobe(hw->priv, CC2520_CMD_SRXON);
}
static void cc2520_stop(struct ieee802154_dev *dev)
static void cc2520_stop(struct ieee802154_hw *hw)
{
cc2520_cmd_strobe(dev->priv, CC2520_CMD_SRFOFF);
cc2520_cmd_strobe(hw->priv, CC2520_CMD_SRFOFF);
}
static int
cc2520_tx(struct ieee802154_dev *dev, struct sk_buff *skb)
cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
{
struct cc2520_private *priv = dev->priv;
struct cc2520_private *priv = hw->priv;
unsigned long flags;
int rc;
u8 status = 0;
......@@ -524,7 +524,7 @@ static int cc2520_rx(struct cc2520_private *priv)
if (len < 2 || len > IEEE802154_MTU)
return -EINVAL;
skb = alloc_skb(len, GFP_KERNEL);
skb = dev_alloc_skb(len);
if (!skb)
return -ENOMEM;
......@@ -536,7 +536,7 @@ static int cc2520_rx(struct cc2520_private *priv)
skb_trim(skb, skb->len - 2);
ieee802154_rx_irqsafe(priv->dev, skb, lqi);
ieee802154_rx_irqsafe(priv->hw, skb, lqi);
dev_vdbg(&priv->spi->dev, "RXFIFO: %x %x\n", len, lqi);
......@@ -544,9 +544,9 @@ static int cc2520_rx(struct cc2520_private *priv)
}
static int
cc2520_ed(struct ieee802154_dev *dev, u8 *level)
cc2520_ed(struct ieee802154_hw *hw, u8 *level)
{
struct cc2520_private *priv = dev->priv;
struct cc2520_private *priv = hw->priv;
u8 status = 0xff;
u8 rssi;
int ret;
......@@ -569,12 +569,11 @@ cc2520_ed(struct ieee802154_dev *dev, u8 *level)
}
static int
cc2520_set_channel(struct ieee802154_dev *dev, int page, int channel)
cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
{
struct cc2520_private *priv = dev->priv;
struct cc2520_private *priv = hw->priv;
int ret;
might_sleep();
dev_dbg(&priv->spi->dev, "trying to set channel\n");
BUG_ON(page != 0);
......@@ -588,12 +587,12 @@ cc2520_set_channel(struct ieee802154_dev *dev, int page, int channel)
}
static int
cc2520_filter(struct ieee802154_dev *dev,
cc2520_filter(struct ieee802154_hw *hw,
struct ieee802154_hw_addr_filt *filt, unsigned long changed)
{
struct cc2520_private *priv = dev->priv;
struct cc2520_private *priv = hw->priv;
if (changed & IEEE802515_AFILT_PANID_CHANGED) {
if (changed & IEEE802154_AFILT_PANID_CHANGED) {
u16 panid = le16_to_cpu(filt->pan_id);
dev_vdbg(&priv->spi->dev,
......@@ -602,7 +601,7 @@ cc2520_filter(struct ieee802154_dev *dev,
sizeof(panid), (u8 *)&panid);
}
if (changed & IEEE802515_AFILT_IEEEADDR_CHANGED) {
if (changed & IEEE802154_AFILT_IEEEADDR_CHANGED) {
dev_vdbg(&priv->spi->dev,
"cc2520_filter called for IEEE addr\n");
cc2520_write_ram(priv, CC2520RAM_IEEEADDR,
......@@ -610,7 +609,7 @@ cc2520_filter(struct ieee802154_dev *dev,
(u8 *)&filt->ieee_addr);
}
if (changed & IEEE802515_AFILT_SADDR_CHANGED) {
if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
u16 addr = le16_to_cpu(filt->short_addr);
dev_vdbg(&priv->spi->dev,
......@@ -619,7 +618,7 @@ cc2520_filter(struct ieee802154_dev *dev,
sizeof(addr), (u8 *)&addr);
}
if (changed & IEEE802515_AFILT_PANC_CHANGED) {
if (changed & IEEE802154_AFILT_PANC_CHANGED) {
dev_vdbg(&priv->spi->dev,
"cc2520_filter called for panc change\n");
if (filt->pan_coord)
......@@ -631,11 +630,11 @@ cc2520_filter(struct ieee802154_dev *dev,
return 0;
}
static struct ieee802154_ops cc2520_ops = {
static const struct ieee802154_ops cc2520_ops = {
.owner = THIS_MODULE,
.start = cc2520_start,
.stop = cc2520_stop,
.xmit = cc2520_tx,
.xmit_sync = cc2520_tx,
.ed = cc2520_ed,
.set_channel = cc2520_set_channel,
.set_hw_addr_filt = cc2520_filter,
......@@ -645,27 +644,28 @@ static int cc2520_register(struct cc2520_private *priv)
{
int ret = -ENOMEM;
priv->dev = ieee802154_alloc_device(sizeof(*priv), &cc2520_ops);
if (!priv->dev)
priv->hw = ieee802154_alloc_hw(sizeof(*priv), &cc2520_ops);
if (!priv->hw)
goto err_ret;
priv->dev->priv = priv;
priv->dev->parent = &priv->spi->dev;
priv->dev->extra_tx_headroom = 0;
priv->hw->priv = priv;
priv->hw->parent = &priv->spi->dev;
priv->hw->extra_tx_headroom = 0;
/* We do support only 2.4 Ghz */
priv->dev->phy->channels_supported[0] = 0x7FFF800;
priv->dev->flags = IEEE802154_HW_OMIT_CKSUM | IEEE802154_HW_AACK;
priv->hw->phy->channels_supported[0] = 0x7FFF800;
priv->hw->flags = IEEE802154_HW_OMIT_CKSUM | IEEE802154_HW_AACK |
IEEE802154_HW_AFILT;
dev_vdbg(&priv->spi->dev, "registered cc2520\n");
ret = ieee802154_register_device(priv->dev);
ret = ieee802154_register_hw(priv->hw);
if (ret)
goto err_free_device;
return 0;
err_free_device:
ieee802154_free_device(priv->dev);
ieee802154_free_hw(priv->hw);
err_ret:
return ret;
}
......@@ -1002,8 +1002,8 @@ static int cc2520_remove(struct spi_device *spi)
mutex_destroy(&priv->buffer_mutex);
flush_work(&priv->fifop_irqwork);
ieee802154_unregister_device(priv->dev);
ieee802154_free_device(priv->dev);
ieee802154_unregister_hw(priv->hw);
ieee802154_free_hw(priv->hw);
return 0;
}
......
/*
* Sample driver for HardMAC IEEE 802.15.4 devices
*
* Copyright (C) 2009 Siemens AG
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Written by:
* Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com>
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <net/af_ieee802154.h>
#include <net/ieee802154_netdev.h>
#include <net/ieee802154.h>
#include <net/nl802154.h>
#include <net/wpan-phy.h>
struct fakehard_priv {
struct wpan_phy *phy;
};
static struct wpan_phy *fake_to_phy(const struct net_device *dev)
{
struct fakehard_priv *priv = netdev_priv(dev);
return priv->phy;
}
/**
* fake_get_phy - Return a phy corresponding to this device.
* @dev: The network device for which to return the wan-phy object
*
* This function returns a wpan-phy object corresponding to the passed
* network device. Reference counter for wpan-phy object is incremented,
* so when the wpan-phy isn't necessary, you should drop the reference
* via @wpan_phy_put() call.
*/
static struct wpan_phy *fake_get_phy(const struct net_device *dev)
{
struct wpan_phy *phy = fake_to_phy(dev);
return to_phy(get_device(&phy->dev));
}
/**
* fake_get_pan_id - Retrieve the PAN ID of the device.
* @dev: The network device to retrieve the PAN of.
*
* Return the ID of the PAN from the PIB.
*/
static __le16 fake_get_pan_id(const struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);
return cpu_to_le16(0xeba1);
}
/**
* fake_get_short_addr - Retrieve the short address of the device.
* @dev: The network device to retrieve the short address of.
*
* Returns the IEEE 802.15.4 short-form address cached for this
* device. If the device has not yet had a short address assigned
* then this should return 0xFFFF to indicate a lack of association.
*/
static __le16 fake_get_short_addr(const struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);
return cpu_to_le16(0x1);
}
/**
* fake_get_dsn - Retrieve the DSN of the device.
* @dev: The network device to retrieve the DSN for.
*
* Returns the IEEE 802.15.4 DSN for the network device.
* The DSN is the sequence number which will be added to each
* packet or MAC command frame by the MAC during transmission.
*
* DSN means 'Data Sequence Number'.
*
* Note: This is in section 7.2.1.2 of the IEEE 802.15.4-2006
* document.
*/
static u8 fake_get_dsn(const struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);
return 0x00; /* DSN are implemented in HW, so return just 0 */
}
/**
* fake_assoc_req - Make an association request to the HW.
* @dev: The network device which we are associating to a network.
* @addr: The coordinator with which we wish to associate.
* @channel: The channel on which to associate.
* @cap: The capability information field to use in the association.
*
* Start an association with a coordinator. The coordinator's address
* and PAN ID can be found in @addr.
*
* Note: This is in section 7.3.1 and 7.5.3.1 of the IEEE
* 802.15.4-2006 document.
*/
static int fake_assoc_req(struct net_device *dev,
struct ieee802154_addr *addr, u8 channel, u8 page, u8 cap)
{
struct wpan_phy *phy = fake_to_phy(dev);
mutex_lock(&phy->pib_lock);
phy->current_channel = channel;
phy->current_page = page;
mutex_unlock(&phy->pib_lock);
/* We simply emulate it here */
return ieee802154_nl_assoc_confirm(dev, fake_get_short_addr(dev),
IEEE802154_SUCCESS);
}
/**
* fake_assoc_resp - Send an association response to a device.
* @dev: The network device on which to send the response.
* @addr: The address of the device to respond to.
* @short_addr: The assigned short address for the device (if any).
* @status: The result of the association request.
*
* Queue the association response of the coordinator to another
* device's attempt to associate with the network which we
* coordinate. This is then added to the indirect-send queue to be
* transmitted to the end device when it polls for data.
*
* Note: This is in section 7.3.2 and 7.5.3.1 of the IEEE
* 802.15.4-2006 document.
*/
static int fake_assoc_resp(struct net_device *dev,
struct ieee802154_addr *addr, __le16 short_addr, u8 status)
{
return 0;
}
/**
* fake_disassoc_req - Disassociate a device from a network.
* @dev: The network device on which we're disassociating a device.
* @addr: The device to disassociate from the network.
* @reason: The reason to give to the device for being disassociated.
*
* This sends a disassociation notification to the device being
* disassociated from the network.
*
* Note: This is in section 7.5.3.2 of the IEEE 802.15.4-2006
* document, with the reason described in 7.3.3.2.
*/
static int fake_disassoc_req(struct net_device *dev,
struct ieee802154_addr *addr, u8 reason)
{
return ieee802154_nl_disassoc_confirm(dev, IEEE802154_SUCCESS);
}
/**
* fake_start_req - Start an IEEE 802.15.4 PAN.
* @dev: The network device on which to start the PAN.
* @addr: The coordinator address to use when starting the PAN.
* @channel: The channel on which to start the PAN.
* @bcn_ord: Beacon order.
* @sf_ord: Superframe order.
* @pan_coord: Whether or not we are the PAN coordinator or just
* requesting a realignment perhaps?
* @blx: Battery Life Extension feature bitfield.
* @coord_realign: Something to realign something else.
*
* If pan_coord is non-zero then this starts a network with the
* provided parameters, otherwise it attempts a coordinator
* realignment of the stated network instead.
*
* Note: This is in section 7.5.2.3 of the IEEE 802.15.4-2006
* document, with 7.3.8 describing coordinator realignment.
*/
static int fake_start_req(struct net_device *dev,
struct ieee802154_addr *addr, u8 channel, u8 page,
u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx,
u8 coord_realign)
{
struct wpan_phy *phy = fake_to_phy(dev);
mutex_lock(&phy->pib_lock);
phy->current_channel = channel;
phy->current_page = page;
mutex_unlock(&phy->pib_lock);
/* We don't emulate beacons here at all, so START should fail */
ieee802154_nl_start_confirm(dev, IEEE802154_INVALID_PARAMETER);
return 0;
}
/**
* fake_scan_req - Start a channel scan.
* @dev: The network device on which to perform a channel scan.
* @type: The type of scan to perform.
* @channels: The channel bitmask to scan.
* @duration: How long to spend on each channel.
*
* This starts either a passive (energy) scan or an active (PAN) scan
* on the channels indicated in the @channels bitmask. The duration of
* the scan is measured in terms of superframe duration. Specifically,
* the scan will spend aBaseSuperFrameDuration * ((2^n) + 1) on each
* channel.
*
* Note: This is in section 7.5.2.1 of the IEEE 802.15.4-2006 document.
*/
static int fake_scan_req(struct net_device *dev, u8 type, u32 channels,
u8 page, u8 duration)
{
u8 edl[27] = {};
return ieee802154_nl_scan_confirm(dev, IEEE802154_SUCCESS, type,
channels, page,
type == IEEE802154_MAC_SCAN_ED ? edl : NULL);
}
static struct ieee802154_mlme_ops fake_mlme = {
.assoc_req = fake_assoc_req,
.assoc_resp = fake_assoc_resp,
.disassoc_req = fake_disassoc_req,
.start_req = fake_start_req,
.scan_req = fake_scan_req,
.get_phy = fake_get_phy,
.get_pan_id = fake_get_pan_id,
.get_short_addr = fake_get_short_addr,
.get_dsn = fake_get_dsn,
};