提交 2ea21492 编写于 作者: D David S. Miller

Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next

John W. Linville says:

====================
This is a batch of updates intended for 3.7.  The ath9k, mwifiex,
and b43 drivers get the bulk of the commits this time, with a handful
of other driver bits thrown-in.  It is mostly just minor fixes and
cleanups, etc.

Also included is a Bluetooth pull, with a lot of refactoring.
Gustavo says:

	"These are the changes I queued for 3.7. There are a many
	small fixes/improvements by Andre Guedes. A l2cap channel
	refcounting refactor by Jaganath. Bluetooth sockets now
	appears in /proc/net, by Masatake Yamato and Sachin Kamat
	changes ours drivers to use devm_kzalloc()."
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
...@@ -101,7 +101,7 @@ void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable) ...@@ -101,7 +101,7 @@ void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable)
bcma_cc_write32(cc, BCMA_CC_CHIPCTL, val); bcma_cc_write32(cc, BCMA_CC_CHIPCTL, val);
} }
void bcma_pmu_workarounds(struct bcma_drv_cc *cc) static void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
{ {
struct bcma_bus *bus = cc->core->bus; struct bcma_bus *bus = cc->core->bus;
...@@ -257,7 +257,7 @@ static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m) ...@@ -257,7 +257,7 @@ static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)
} }
/* query bus clock frequency for PMU-enabled chipcommon */ /* query bus clock frequency for PMU-enabled chipcommon */
u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc) static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
{ {
struct bcma_bus *bus = cc->core->bus; struct bcma_bus *bus = cc->core->bus;
......
...@@ -77,8 +77,8 @@ static void bcma_host_pci_write32(struct bcma_device *core, u16 offset, ...@@ -77,8 +77,8 @@ static void bcma_host_pci_write32(struct bcma_device *core, u16 offset,
} }
#ifdef CONFIG_BCMA_BLOCKIO #ifdef CONFIG_BCMA_BLOCKIO
void bcma_host_pci_block_read(struct bcma_device *core, void *buffer, static void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
size_t count, u16 offset, u8 reg_width) size_t count, u16 offset, u8 reg_width)
{ {
void __iomem *addr = core->bus->mmio + offset; void __iomem *addr = core->bus->mmio + offset;
if (core->bus->mapped_core != core) if (core->bus->mapped_core != core)
...@@ -100,8 +100,9 @@ void bcma_host_pci_block_read(struct bcma_device *core, void *buffer, ...@@ -100,8 +100,9 @@ void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
} }
} }
void bcma_host_pci_block_write(struct bcma_device *core, const void *buffer, static void bcma_host_pci_block_write(struct bcma_device *core,
size_t count, u16 offset, u8 reg_width) const void *buffer, size_t count,
u16 offset, u8 reg_width)
{ {
void __iomem *addr = core->bus->mmio + offset; void __iomem *addr = core->bus->mmio + offset;
if (core->bus->mapped_core != core) if (core->bus->mapped_core != core)
...@@ -139,7 +140,7 @@ static void bcma_host_pci_awrite32(struct bcma_device *core, u16 offset, ...@@ -139,7 +140,7 @@ static void bcma_host_pci_awrite32(struct bcma_device *core, u16 offset,
iowrite32(value, core->bus->mmio + (1 * BCMA_CORE_SIZE) + offset); iowrite32(value, core->bus->mmio + (1 * BCMA_CORE_SIZE) + offset);
} }
const struct bcma_host_ops bcma_host_pci_ops = { static const struct bcma_host_ops bcma_host_pci_ops = {
.read8 = bcma_host_pci_read8, .read8 = bcma_host_pci_read8,
.read16 = bcma_host_pci_read16, .read16 = bcma_host_pci_read16,
.read32 = bcma_host_pci_read32, .read32 = bcma_host_pci_read32,
......
...@@ -143,7 +143,7 @@ static void bcma_host_soc_awrite32(struct bcma_device *core, u16 offset, ...@@ -143,7 +143,7 @@ static void bcma_host_soc_awrite32(struct bcma_device *core, u16 offset,
writel(value, core->io_wrap + offset); writel(value, core->io_wrap + offset);
} }
const struct bcma_host_ops bcma_host_soc_ops = { static const struct bcma_host_ops bcma_host_soc_ops = {
.read8 = bcma_host_soc_read8, .read8 = bcma_host_soc_read8,
.read16 = bcma_host_soc_read16, .read16 = bcma_host_soc_read16,
.read32 = bcma_host_soc_read32, .read32 = bcma_host_soc_read32,
......
...@@ -177,7 +177,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -177,7 +177,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
if (intf->cur_altsetting->desc.bInterfaceNumber != 0) if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
return -ENODEV; return -ENODEV;
data = kzalloc(sizeof(*data), GFP_KERNEL); data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL);
if (!data) { if (!data) {
BT_ERR("Can't allocate memory for data structure"); BT_ERR("Can't allocate memory for data structure");
return -ENOMEM; return -ENOMEM;
...@@ -189,14 +189,12 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -189,14 +189,12 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
data->urb = usb_alloc_urb(0, GFP_KERNEL); data->urb = usb_alloc_urb(0, GFP_KERNEL);
if (!data->urb) { if (!data->urb) {
BT_ERR("Can't allocate URB"); BT_ERR("Can't allocate URB");
kfree(data);
return -ENOMEM; return -ENOMEM;
} }
if (request_firmware(&firmware, "BCM2033-MD.hex", &udev->dev) < 0) { if (request_firmware(&firmware, "BCM2033-MD.hex", &udev->dev) < 0) {
BT_ERR("Mini driver request failed"); BT_ERR("Mini driver request failed");
usb_free_urb(data->urb); usb_free_urb(data->urb);
kfree(data);
return -EIO; return -EIO;
} }
...@@ -209,7 +207,6 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -209,7 +207,6 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
BT_ERR("Can't allocate memory for mini driver"); BT_ERR("Can't allocate memory for mini driver");
release_firmware(firmware); release_firmware(firmware);
usb_free_urb(data->urb); usb_free_urb(data->urb);
kfree(data);
return -ENOMEM; return -ENOMEM;
} }
...@@ -224,7 +221,6 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -224,7 +221,6 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
BT_ERR("Firmware request failed"); BT_ERR("Firmware request failed");
usb_free_urb(data->urb); usb_free_urb(data->urb);
kfree(data->buffer); kfree(data->buffer);
kfree(data);
return -EIO; return -EIO;
} }
...@@ -236,7 +232,6 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -236,7 +232,6 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
release_firmware(firmware); release_firmware(firmware);
usb_free_urb(data->urb); usb_free_urb(data->urb);
kfree(data->buffer); kfree(data->buffer);
kfree(data);
return -ENOMEM; return -ENOMEM;
} }
...@@ -271,7 +266,6 @@ static void bcm203x_disconnect(struct usb_interface *intf) ...@@ -271,7 +266,6 @@ static void bcm203x_disconnect(struct usb_interface *intf)
usb_free_urb(data->urb); usb_free_urb(data->urb);
kfree(data->fw_data); kfree(data->fw_data);
kfree(data->buffer); kfree(data->buffer);
kfree(data);
} }
static struct usb_driver bcm203x_driver = { static struct usb_driver bcm203x_driver = {
......
...@@ -653,7 +653,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -653,7 +653,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
} }
/* Initialize control structure and load firmware */ /* Initialize control structure and load firmware */
data = kzalloc(sizeof(struct bfusb_data), GFP_KERNEL); data = devm_kzalloc(&intf->dev, sizeof(struct bfusb_data), GFP_KERNEL);
if (!data) { if (!data) {
BT_ERR("Can't allocate memory for control structure"); BT_ERR("Can't allocate memory for control structure");
goto done; goto done;
...@@ -674,7 +674,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -674,7 +674,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
if (request_firmware(&firmware, "bfubase.frm", &udev->dev) < 0) { if (request_firmware(&firmware, "bfubase.frm", &udev->dev) < 0) {
BT_ERR("Firmware request failed"); BT_ERR("Firmware request failed");
goto error; goto done;
} }
BT_DBG("firmware data %p size %zu", firmware->data, firmware->size); BT_DBG("firmware data %p size %zu", firmware->data, firmware->size);
...@@ -690,7 +690,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -690,7 +690,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
hdev = hci_alloc_dev(); hdev = hci_alloc_dev();
if (!hdev) { if (!hdev) {
BT_ERR("Can't allocate HCI device"); BT_ERR("Can't allocate HCI device");
goto error; goto done;
} }
data->hdev = hdev; data->hdev = hdev;
...@@ -708,7 +708,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -708,7 +708,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
if (hci_register_dev(hdev) < 0) { if (hci_register_dev(hdev) < 0) {
BT_ERR("Can't register HCI device"); BT_ERR("Can't register HCI device");
hci_free_dev(hdev); hci_free_dev(hdev);
goto error; goto done;
} }
usb_set_intfdata(intf, data); usb_set_intfdata(intf, data);
...@@ -718,9 +718,6 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -718,9 +718,6 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
release: release:
release_firmware(firmware); release_firmware(firmware);
error:
kfree(data);
done: done:
return -EIO; return -EIO;
} }
...@@ -741,7 +738,6 @@ static void bfusb_disconnect(struct usb_interface *intf) ...@@ -741,7 +738,6 @@ static void bfusb_disconnect(struct usb_interface *intf)
hci_unregister_dev(hdev); hci_unregister_dev(hdev);
hci_free_dev(hdev); hci_free_dev(hdev);
kfree(data);
} }
static struct usb_driver bfusb_driver = { static struct usb_driver bfusb_driver = {
......
...@@ -849,7 +849,7 @@ static int bluecard_probe(struct pcmcia_device *link) ...@@ -849,7 +849,7 @@ static int bluecard_probe(struct pcmcia_device *link)
bluecard_info_t *info; bluecard_info_t *info;
/* Create new info device */ /* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -864,10 +864,7 @@ static int bluecard_probe(struct pcmcia_device *link) ...@@ -864,10 +864,7 @@ static int bluecard_probe(struct pcmcia_device *link)
static void bluecard_detach(struct pcmcia_device *link) static void bluecard_detach(struct pcmcia_device *link)
{ {
bluecard_info_t *info = link->priv;
bluecard_release(link); bluecard_release(link);
kfree(info);
} }
......
...@@ -443,7 +443,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id * ...@@ -443,7 +443,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
if (intf->cur_altsetting->desc.bInterfaceNumber != 0) if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
return -ENODEV; return -ENODEV;
data = kzalloc(sizeof(*data), GFP_KERNEL); data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
...@@ -453,10 +453,8 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id * ...@@ -453,10 +453,8 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
init_usb_anchor(&data->rx_anchor); init_usb_anchor(&data->rx_anchor);
hdev = hci_alloc_dev(); hdev = hci_alloc_dev();
if (!hdev) { if (!hdev)
kfree(data);
return -ENOMEM; return -ENOMEM;
}
hdev->bus = HCI_USB; hdev->bus = HCI_USB;
hci_set_drvdata(hdev, data); hci_set_drvdata(hdev, data);
...@@ -475,7 +473,6 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id * ...@@ -475,7 +473,6 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
err = hci_register_dev(hdev); err = hci_register_dev(hdev);
if (err < 0) { if (err < 0) {
hci_free_dev(hdev); hci_free_dev(hdev);
kfree(data);
return err; return err;
} }
...@@ -500,7 +497,6 @@ static void bpa10x_disconnect(struct usb_interface *intf) ...@@ -500,7 +497,6 @@ static void bpa10x_disconnect(struct usb_interface *intf)
hci_free_dev(data->hdev); hci_free_dev(data->hdev);
kfree_skb(data->rx_skb[0]); kfree_skb(data->rx_skb[0]);
kfree_skb(data->rx_skb[1]); kfree_skb(data->rx_skb[1]);
kfree(data);
} }
static struct usb_driver bpa10x_driver = { static struct usb_driver bpa10x_driver = {
......
...@@ -638,7 +638,7 @@ static int bt3c_probe(struct pcmcia_device *link) ...@@ -638,7 +638,7 @@ static int bt3c_probe(struct pcmcia_device *link)
bt3c_info_t *info; bt3c_info_t *info;
/* Create new info device */ /* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -654,10 +654,7 @@ static int bt3c_probe(struct pcmcia_device *link) ...@@ -654,10 +654,7 @@ static int bt3c_probe(struct pcmcia_device *link)
static void bt3c_detach(struct pcmcia_device *link) static void bt3c_detach(struct pcmcia_device *link)
{ {
bt3c_info_t *info = link->priv;
bt3c_release(link); bt3c_release(link);
kfree(info);
} }
static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data) static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data)
......
...@@ -956,11 +956,9 @@ static int btmrvl_sdio_probe(struct sdio_func *func, ...@@ -956,11 +956,9 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
BT_INFO("vendor=0x%x, device=0x%x, class=%d, fn=%d", BT_INFO("vendor=0x%x, device=0x%x, class=%d, fn=%d",
id->vendor, id->device, id->class, func->num); id->vendor, id->device, id->class, func->num);
card = kzalloc(sizeof(*card), GFP_KERNEL); card = devm_kzalloc(&func->dev, sizeof(*card), GFP_KERNEL);
if (!card) { if (!card)
ret = -ENOMEM; return -ENOMEM;
goto done;
}
card->func = func; card->func = func;
...@@ -974,8 +972,7 @@ static int btmrvl_sdio_probe(struct sdio_func *func, ...@@ -974,8 +972,7 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
if (btmrvl_sdio_register_dev(card) < 0) { if (btmrvl_sdio_register_dev(card) < 0) {
BT_ERR("Failed to register BT device!"); BT_ERR("Failed to register BT device!");
ret = -ENODEV; return -ENODEV;
goto free_card;
} }
/* Disable the interrupts on the card */ /* Disable the interrupts on the card */
...@@ -1023,9 +1020,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func, ...@@ -1023,9 +1020,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
btmrvl_sdio_disable_host_int(card); btmrvl_sdio_disable_host_int(card);
unreg_dev: unreg_dev:
btmrvl_sdio_unregister_dev(card); btmrvl_sdio_unregister_dev(card);
free_card:
kfree(card);
done:
return ret; return ret;
} }
...@@ -1047,7 +1041,6 @@ static void btmrvl_sdio_remove(struct sdio_func *func) ...@@ -1047,7 +1041,6 @@ static void btmrvl_sdio_remove(struct sdio_func *func)
BT_DBG("unregester dev"); BT_DBG("unregester dev");
btmrvl_sdio_unregister_dev(card); btmrvl_sdio_unregister_dev(card);
btmrvl_remove_card(card->priv); btmrvl_remove_card(card->priv);
kfree(card);
} }
} }
} }
......
...@@ -304,7 +304,7 @@ static int btsdio_probe(struct sdio_func *func, ...@@ -304,7 +304,7 @@ static int btsdio_probe(struct sdio_func *func,
tuple = tuple->next; tuple = tuple->next;
} }
data = kzalloc(sizeof(*data), GFP_KERNEL); data = devm_kzalloc(&func->dev, sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
...@@ -315,10 +315,8 @@ static int btsdio_probe(struct sdio_func *func, ...@@ -315,10 +315,8 @@ static int btsdio_probe(struct sdio_func *func,
skb_queue_head_init(&data->txq); skb_queue_head_init(&data->txq);
hdev = hci_alloc_dev(); hdev = hci_alloc_dev();
if (!hdev) { if (!hdev)
kfree(data);
return -ENOMEM; return -ENOMEM;
}
hdev->bus = HCI_SDIO; hdev->bus = HCI_SDIO;
hci_set_drvdata(hdev, data); hci_set_drvdata(hdev, data);
...@@ -340,7 +338,6 @@ static int btsdio_probe(struct sdio_func *func, ...@@ -340,7 +338,6 @@ static int btsdio_probe(struct sdio_func *func,
err = hci_register_dev(hdev); err = hci_register_dev(hdev);
if (err < 0) { if (err < 0) {
hci_free_dev(hdev); hci_free_dev(hdev);
kfree(data);
return err; return err;
} }
...@@ -366,7 +363,6 @@ static void btsdio_remove(struct sdio_func *func) ...@@ -366,7 +363,6 @@ static void btsdio_remove(struct sdio_func *func)
hci_unregister_dev(hdev); hci_unregister_dev(hdev);
hci_free_dev(hdev); hci_free_dev(hdev);
kfree(data);
} }
static struct sdio_driver btsdio_driver = { static struct sdio_driver btsdio_driver = {
......
...@@ -567,7 +567,7 @@ static int btuart_probe(struct pcmcia_device *link) ...@@ -567,7 +567,7 @@ static int btuart_probe(struct pcmcia_device *link)
btuart_info_t *info; btuart_info_t *info;
/* Create new info device */ /* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -583,10 +583,7 @@ static int btuart_probe(struct pcmcia_device *link) ...@@ -583,10 +583,7 @@ static int btuart_probe(struct pcmcia_device *link)
static void btuart_detach(struct pcmcia_device *link) static void btuart_detach(struct pcmcia_device *link)
{ {
btuart_info_t *info = link->priv;
btuart_release(link); btuart_release(link);
kfree(info);
} }
static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data) static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data)
......
...@@ -952,7 +952,7 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -952,7 +952,7 @@ static int btusb_probe(struct usb_interface *intf,
return -ENODEV; return -ENODEV;
} }
data = kzalloc(sizeof(*data), GFP_KERNEL); data = devm_kzalloc(&intf->dev, sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
...@@ -975,10 +975,8 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -975,10 +975,8 @@ static int btusb_probe(struct usb_interface *intf,
} }
} }
if (!data->intr_ep || !data->bulk_tx_ep || !data->bulk_rx_ep) { if (!data->intr_ep || !data->bulk_tx_ep || !data->bulk_rx_ep)
kfree(data);
return -ENODEV; return -ENODEV;
}
data->cmdreq_type = USB_TYPE_CLASS; data->cmdreq_type = USB_TYPE_CLASS;
...@@ -998,10 +996,8 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -998,10 +996,8 @@ static int btusb_probe(struct usb_interface *intf,
init_usb_anchor(&data->deferred); init_usb_anchor(&data->deferred);
hdev = hci_alloc_dev(); hdev = hci_alloc_dev();
if (!hdev) { if (!hdev)
kfree(data);
return -ENOMEM; return -ENOMEM;
}
hdev->bus = HCI_USB; hdev->bus = HCI_USB;
hci_set_drvdata(hdev, data); hci_set_drvdata(hdev, data);
...@@ -1069,7 +1065,6 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -1069,7 +1065,6 @@ static int btusb_probe(struct usb_interface *intf,
data->isoc, data); data->isoc, data);
if (err < 0) { if (err < 0) {
hci_free_dev(hdev); hci_free_dev(hdev);
kfree(data);
return err; return err;
} }
} }
...@@ -1077,7 +1072,6 @@ static int btusb_probe(struct usb_interface *intf, ...@@ -1077,7 +1072,6 @@ static int btusb_probe(struct usb_interface *intf,
err = hci_register_dev(hdev); err = hci_register_dev(hdev);
if (err < 0) { if (err < 0) {
hci_free_dev(hdev); hci_free_dev(hdev);
kfree(data);
return err; return err;
} }
...@@ -1110,7 +1104,6 @@ static void btusb_disconnect(struct usb_interface *intf) ...@@ -1110,7 +1104,6 @@ static void btusb_disconnect(struct usb_interface *intf)
usb_driver_release_interface(&btusb_driver, data->isoc); usb_driver_release_interface(&btusb_driver, data->isoc);
hci_free_dev(hdev); hci_free_dev(hdev);
kfree(data);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
......
...@@ -297,16 +297,14 @@ static int bt_ti_probe(struct platform_device *pdev) ...@@ -297,16 +297,14 @@ static int bt_ti_probe(struct platform_device *pdev)
struct hci_dev *hdev; struct hci_dev *hdev;
int err; int err;
hst = kzalloc(sizeof(struct ti_st), GFP_KERNEL); hst = devm_kzalloc(&pdev->dev, sizeof(struct ti_st), GFP_KERNEL);
if (!hst) if (!hst)
return -ENOMEM; return -ENOMEM;
/* Expose "hciX" device to user space */ /* Expose "hciX" device to user space */
hdev = hci_alloc_dev(); hdev = hci_alloc_dev();
if (!hdev) { if (!hdev)
kfree(hst);
return -ENOMEM; return -ENOMEM;
}
BT_DBG("hdev %p", hdev); BT_DBG("hdev %p", hdev);
...@@ -321,7 +319,6 @@ static int bt_ti_probe(struct platform_device *pdev) ...@@ -321,7 +319,6 @@ static int bt_ti_probe(struct platform_device *pdev)
err = hci_register_dev(hdev); err = hci_register_dev(hdev);
if (err < 0) { if (err < 0) {
BT_ERR("Can't register HCI device error %d", err); BT_ERR("Can't register HCI device error %d", err);
kfree(hst);
hci_free_dev(hdev); hci_free_dev(hdev);
return err; return err;
} }
...@@ -347,7 +344,6 @@ static int bt_ti_remove(struct platform_device *pdev) ...@@ -347,7 +344,6 @@ static int bt_ti_remove(struct platform_device *pdev)
hci_unregister_dev(hdev); hci_unregister_dev(hdev);
hci_free_dev(hdev); hci_free_dev(hdev);
kfree(hst);
dev_set_drvdata(&pdev->dev, NULL); dev_set_drvdata(&pdev->dev, NULL);
return 0; return 0;
......
...@@ -550,7 +550,7 @@ static int dtl1_probe(struct pcmcia_device *link) ...@@ -550,7 +550,7 @@ static int dtl1_probe(struct pcmcia_device *link)
dtl1_info_t *info; dtl1_info_t *info;
/* Create new info device */ /* Create new info device */
info = kzalloc(sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&link->dev, sizeof(*info), GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -569,7 +569,6 @@ static void dtl1_detach(struct pcmcia_device *link) ...@@ -569,7 +569,6 @@ static void dtl1_detach(struct pcmcia_device *link)
dtl1_close(info); dtl1_close(info);
pcmcia_disable_device(link); pcmcia_disable_device(link);
kfree(info);
} }
static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data) static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)
......
...@@ -1331,7 +1331,6 @@ struct ath5k_hw { ...@@ -1331,7 +1331,6 @@ struct ath5k_hw {
unsigned int nexttbtt; /* next beacon time in TU */ unsigned int nexttbtt; /* next beacon time in TU */
struct ath5k_txq *cabq; /* content after beacon */ struct ath5k_txq *cabq; /* content after beacon */
int power_level; /* Requested tx power in dBm */
bool assoc; /* associate state */ bool assoc; /* associate state */
bool enable_beacon; /* true if beacons are on */ bool enable_beacon; /* true if beacons are on */
...@@ -1425,6 +1424,7 @@ struct ath5k_hw { ...@@ -1425,6 +1424,7 @@ struct ath5k_hw {
/* Value in dB units */ /* Value in dB units */
s16 txp_cck_ofdm_pwr_delta; s16 txp_cck_ofdm_pwr_delta;
bool txp_setup; bool txp_setup;
int txp_requested; /* Requested tx power in dBm */
} ah_txpower; } ah_txpower;
struct ath5k_nfcal_hist ah_nfcal_hist; struct ath5k_nfcal_hist ah_nfcal_hist;
......
...@@ -723,7 +723,7 @@ ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf, ...@@ -723,7 +723,7 @@ ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf,
ret = ah->ah_setup_tx_desc(ah, ds, pktlen, ret = ah->ah_setup_tx_desc(ah, ds, pktlen,
ieee80211_get_hdrlen_from_skb(skb), padsize, ieee80211_get_hdrlen_from_skb(skb), padsize,
get_hw_packet_type(skb), get_hw_packet_type(skb),
(ah->power_level * 2), (ah->ah_txpower.txp_requested * 2),
hw_rate, hw_rate,
info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags, info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags,
cts_rate, duration); cts_rate, duration);
...@@ -1778,7 +1778,8 @@ ath5k_beacon_setup(struct ath5k_hw *ah, struct ath5k_buf *bf) ...@@ -1778,7 +1778,8 @@ ath5k_beacon_setup(struct ath5k_hw *ah, struct ath5k_buf *bf)
ds->ds_data = bf->skbaddr; ds->ds_data = bf->skbaddr;
ret = ah->ah_setup_tx_desc(ah, ds, skb->len, ret = ah->ah_setup_tx_desc(ah, ds, skb->len,
ieee80211_get_hdrlen_from_skb(skb), padsize, ieee80211_get_hdrlen_from_skb(skb), padsize,
AR5K_PKT_TYPE_BEACON, (ah->power_level * 2), AR5K_PKT_TYPE_BEACON,
(ah->ah_txpower.txp_requested * 2),
ieee80211_get_tx_rate(ah->hw, info)->hw_value, ieee80211_get_tx_rate(ah->hw, info)->hw_value,
1, AR5K_TXKEYIX_INVALID, 1, AR5K_TXKEYIX_INVALID,
antenna, flags, 0, 0); antenna, flags, 0, 0);
......
...@@ -207,8 +207,8 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed) ...@@ -207,8 +207,8 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
} }
if ((changed & IEEE80211_CONF_CHANGE_POWER) && if ((changed & IEEE80211_CONF_CHANGE_POWER) &&
(ah->power_level != conf->power_level)) { (ah->ah_txpower.txp_requested != conf->power_level)) {
ah->power_level = conf->power_level; ah->ah_txpower.txp_requested = conf->power_level;
/* Half dB steps */ /* Half dB steps */
ath5k_hw_set_txpower_limit(ah, (conf->power_level * 2)); ath5k_hw_set_txpower_limit(ah, (conf->power_level * 2));
......
...@@ -3516,6 +3516,7 @@ ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr, ...@@ -3516,6 +3516,7 @@ ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr,
{ {
unsigned int i; unsigned int i;
u16 *rates; u16 *rates;
s16 rate_idx_scaled = 0;
/* max_pwr is power level we got from driver/user in 0.5dB /* max_pwr is power level we got from driver/user in 0.5dB
* units, switch to 0.25dB units so we can compare */ * units, switch to 0.25dB units so we can compare */
...@@ -3562,20 +3563,32 @@ ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr, ...@@ -3562,20 +3563,32 @@ ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr,
for (i = 8; i <= 15; i++) for (i = 8; i <= 15; i++)
rates[i] -= ah->ah_txpower.txp_cck_ofdm_gainf_delta; rates[i] -= ah->ah_txpower.txp_cck_ofdm_gainf_delta;
/* Save min/max and current tx power for this channel
* in 0.25dB units.
*
* Note: We use rates[0] for current tx power because
* it covers most of the rates, in most cases. It's our
* tx power limit and what the user expects to see. */
ah->ah_txpower.txp_min_pwr = 2 * rates[7];
ah->ah_txpower.txp_cur_pwr = 2 * rates[0];
/* Set max txpower for correct OFDM operation on all rates
* -that is the txpower for 54Mbit-, it's used for the PAPD
* gain probe and it's in 0.5dB units */
ah->ah_txpower.txp_ofdm = rates[7];
/* Now that we have all rates setup use table offset to /* Now that we have all rates setup use table offset to
* match the power range set by user with the power indices * match the power range set by user with the power indices
* on PCDAC/PDADC table */ * on PCDAC/PDADC table */
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
rates[i] += ah->ah_txpower.txp_offset; rate_idx_scaled = rates[i] + ah->ah_txpower.txp_offset;
/* Don't get out of bounds */ /* Don't get out of bounds */
if (rates[i] > 63) if (rate_idx_scaled > 63)
rates[i] = 63; rate_idx_scaled = 63;
if (rate_idx_scaled < 0)
rate_idx_scaled = 0;
rates[i] = rate_idx_scaled;
} }
/* Min/max in 0.25dB units */
ah->ah_txpower.txp_min_pwr = 2 * rates[7];
ah->ah_txpower.txp_cur_pwr = 2 * rates[0];
ah->ah_txpower.txp_ofdm = rates[7];
} }
...@@ -3639,10 +3652,17 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3639,10 +3652,17 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
if (!ah->ah_txpower.txp_setup || if (!ah->ah_txpower.txp_setup ||
(channel->hw_value != curr_channel->hw_value) || (channel->hw_value != curr_channel->hw_value) ||
(channel->center_freq != curr_channel->center_freq)) { (channel->center_freq != curr_channel->center_freq)) {
/* Reset TX power values */ /* Reset TX power values but preserve requested
* tx power from above */
int requested_txpower = ah->ah_txpower.txp_requested;
memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower)); memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
/* Restore TPC setting and requested tx power */
ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER; ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
ah->ah_txpower.txp_requested = requested_txpower;
/* Calculate the powertable */ /* Calculate the powertable */
ret = ath5k_setup_channel_powertable(ah, channel, ret = ath5k_setup_channel_powertable(ah, channel,
ee_mode, type); ee_mode, type);
...@@ -3789,8 +3809,9 @@ ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel, ...@@ -3789,8 +3809,9 @@ ath5k_hw_phy_init(struct ath5k_hw *ah, struct ieee80211_channel *channel,
* RF buffer settings on 5211/5212+ so that we * RF buffer settings on 5211/5212+ so that we
* properly set curve indices. * properly set curve indices.
*/ */
ret = ath5k_hw_txpower(ah, channel, ah->ah_txpower.txp_cur_pwr ? ret = ath5k_hw_txpower(ah, channel, ah->ah_txpower.txp_requested ?
ah->ah_txpower.txp_cur_pwr / 2 : AR5K_TUNE_MAX_TXPOWER); ah->ah_txpower.txp_requested * 2 :
AR5K_TUNE_MAX_TXPOWER);
if (ret) if (ret)
return ret; return ret;
......
...@@ -4901,90 +4901,79 @@ static void ar9003_hw_set_power_per_rate_table(struct ath_hw *ah, ...@@ -4901,90 +4901,79 @@ static void ar9003_hw_set_power_per_rate_table(struct ath_hw *ah,
i, cfgCtl, pCtlMode[ctlMode], ctlIndex[i], i, cfgCtl, pCtlMode[ctlMode], ctlIndex[i],
chan->channel); chan->channel);
/* /*
* compare test group from regulatory * compare test group from regulatory
* channel list with test mode from pCtlMode * channel list with test mode from pCtlMode
* list * list
*/ */
if ((((cfgCtl & ~CTL_MODE_M) | if ((((cfgCtl & ~CTL_MODE_M) |
(pCtlMode[ctlMode] & CTL_MODE_M)) == (pCtlMode[ctlMode] & CTL_MODE_M)) ==
ctlIndex[i]) || ctlIndex[i]) ||
(((cfgCtl & ~CTL_MODE_M) | (((cfgCtl & ~CTL_MODE_M) |
(pCtlMode[ctlMode] & CTL_MODE_M)) == (pCtlMode[ctlMode] & CTL_MODE_M)) ==
((ctlIndex[i] & CTL_MODE_M) | ((ctlIndex[i] & CTL_MODE_M) |
SD_NO_CTL))) { SD_NO_CTL))) {
twiceMinEdgePower = twiceMinEdgePower =
ar9003_hw_get_max_edge_power(pEepData, ar9003_hw_get_max_edge_power(pEepData,
freq, i, freq, i,
is2ghz); is2ghz);
if ((cfgCtl & ~CTL_MODE_M) == SD_NO_CTL) if ((cfgCtl & ~CTL_MODE_M) == SD_NO_CTL)
/* /*
* Find the minimum of all CTL * Find the minimum of all CTL
* edge powers that apply to * edge powers that apply to
* this channel * this channel
*/ */
twiceMaxEdgePower = twiceMaxEdgePower =
min(twiceMaxEdgePower, min(twiceMaxEdgePower,
twiceMinEdgePower); twiceMinEdgePower);
else { else {
/* specific */ /* specific */
twiceMaxEdgePower = twiceMaxEdgePower = twiceMinEdgePower;
twiceMinEdgePower; break;
break;
}
} }
} }
}
minCtlPower = (u8)min(twiceMaxEdgePower, scaledPower); minCtlPower = (u8)min(twiceMaxEdgePower, scaledPower);
ath_dbg(common, REGULATORY, ath_dbg(common, REGULATORY,
"SEL-Min ctlMode %d pCtlMode %d 2xMaxEdge %d sP %d minCtlPwr %d\n", "SEL-Min ctlMode %d pCtlMode %d 2xMaxEdge %d sP %d minCtlPwr %d\n",
ctlMode, pCtlMode[ctlMode], twiceMaxEdgePower, ctlMode, pCtlMode[ctlMode], twiceMaxEdgePower,
scaledPower, minCtlPower); scaledPower, minCtlPower);
/* Apply ctl mode to correct target power set */ /* Apply ctl mode to correct target power set */
switch (pCtlMode[ctlMode]) { switch (pCtlMode[ctlMode]) {
case CTL_11B: case CTL_11B:
for (i = ALL_TARGET_LEGACY_1L_5L; for (i = ALL_TARGET_LEGACY_1L_5L;
i <= ALL_TARGET_LEGACY_11S; i++) i <= ALL_TARGET_LEGACY_11S; i++)
pPwrArray[i] = pPwrArray[i] = (u8)min((u16)pPwrArray[i],
(u8)min((u16)pPwrArray[i], minCtlPower);
minCtlPower); break;
break; case CTL_11A:
case CTL_11A: case CTL_11G:
case CTL_11G: for (i = ALL_TARGET_LEGACY_6_24;
for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++)
i <= ALL_TARGET_LEGACY_54; i++) pPwrArray[i] = (u8)min((u16)pPwrArray[i],
pPwrArray[i] = minCtlPower);
(u8)min((u16)pPwrArray[i], break;
minCtlPower); case CTL_5GHT20:
break; case CTL_2GHT20:
case CTL_5GHT20: for (i = ALL_TARGET_HT20_0_8_16;
case CTL_2GHT20: i <= ALL_TARGET_HT20_23; i++)
for (i = ALL_TARGET_HT20_0_8_16; pPwrArray[i] = (u8)min((u16)pPwrArray[i],
i <= ALL_TARGET_HT20_21; i++) minCtlPower);
pPwrArray[i] = break;
(u8)min((u16)pPwrArray[i], case CTL_5GHT40:
minCtlPower); case CTL_2GHT40:
pPwrArray[ALL_TARGET_HT20_22] = for (i = ALL_TARGET_HT40_0_8_16;
(u8)min((u16)pPwrArray[ALL_TARGET_HT20_22], i <= ALL_TARGET_HT40_23; i++)
minCtlPower); pPwrArray[i] = (u8)min((u16)pPwrArray[i],
pPwrArray[ALL_TARGET_HT20_23] = minCtlPower);
(u8)min((u16)pPwrArray[ALL_TARGET_HT20_23], break;
minCtlPower); default:
break; break;
case CTL_5GHT40: }
case CTL_2GHT40:
for (i = ALL_TARGET_HT40_0_8_16;
i <= ALL_TARGET_HT40_23; i++)
pPwrArray[i] =
(u8)min((u16)pPwrArray[i],
minCtlPower);
break;
default:
break;
}
} /* end ctl mode checking */ } /* end ctl mode checking */
} }
......
此差异已折叠。
...@@ -160,10 +160,6 @@ struct ath_rate_table { ...@@ -160,10 +160,6 @@ struct ath_rate_table {
u32 user_ratekbps; u32 user_ratekbps;
u8 ratecode; u8 ratecode;
u8 dot11rate; u8 dot11rate;
u8 ctrl_rate;
u8 cw40index;
u8 sgi_index;
u8 ht_index;
} info[RATE_TABLE_SIZE]; } info[RATE_TABLE_SIZE];
u32 probe_interval; u32 probe_interval;
u8 initial_ratemax; u8 initial_ratemax;
......
...@@ -341,6 +341,7 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) ...@@ -341,6 +341,7 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len)
if (SUPP(CARL9170FW_WLANTX_CAB)) { if (SUPP(CARL9170FW_WLANTX_CAB)) {
if_comb_types |= if_comb_types |=
BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_MESH_POINT) |
BIT(NL80211_IFTYPE_P2P_GO); BIT(NL80211_IFTYPE_P2P_GO);
} }
} }
......
...@@ -318,10 +318,10 @@ int carl9170_set_operating_mode(struct ar9170 *ar) ...@@ -318,10 +318,10 @@ int carl9170_set_operating_mode(struct ar9170 *ar)
bssid = common->curbssid; bssid = common->curbssid;
switch (vif->type) { switch (vif->type) {
case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
cam_mode |= AR9170_MAC_CAM_IBSS; cam_mode |= AR9170_MAC_CAM_IBSS;
break; break;
case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
cam_mode |= AR9170_MAC_CAM_AP; cam_mode |= AR9170_MAC_CAM_AP;
......
...@@ -616,10 +616,12 @@ static int carl9170_op_add_interface(struct ieee80211_hw *hw, ...@@ -616,10 +616,12 @@ static int carl9170_op_add_interface(struct ieee80211_hw *hw,
goto unlock; goto unlock;
case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
if ((vif->type == NL80211_IFTYPE_STATION) || if ((vif->type == NL80211_IFTYPE_STATION) ||
(vif->type == NL80211_IFTYPE_WDS) || (vif->type == NL80211_IFTYPE_WDS) ||
(vif->type == NL80211_IFTYPE_AP)) (vif->type == NL80211_IFTYPE_AP) ||
(vif->type == NL80211_IFTYPE_MESH_POINT))
break; break;
err = -EBUSY; err = -EBUSY;
......
...@@ -206,6 +206,7 @@ void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len) ...@@ -206,6 +206,7 @@ void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_MESH_POINT:
carl9170_update_beacon(ar, true); carl9170_update_beacon(ar, true);
break; break;
......
...@@ -4,6 +4,7 @@ b43-y += tables.o ...@@ -4,6 +4,7 @@ b43-y += tables.o
b43-$(CONFIG_B43_PHY_N) += tables_nphy.o b43-$(CONFIG_B43_PHY_N) += tables_nphy.o
b43-$(CONFIG_B43_PHY_N) += radio_2055.o b43-$(CONFIG_B43_PHY_N) += radio_2055.o
b43-$(CONFIG_B43_PHY_N) += radio_2056.o b43-$(CONFIG_B43_PHY_N) += radio_2056.o
b43-$(CONFIG_B43_PHY_N) += radio_2057.o
b43-y += phy_common.o b43-y += phy_common.o
b43-y += phy_g.o b43-y += phy_g.o
b43-y += phy_a.o b43-y += phy_a.o
......
...@@ -241,16 +241,18 @@ enum { ...@@ -241,16 +241,18 @@ enum {
#define B43_SHM_SH_PHYVER 0x0050 /* PHY version */ #define B43_SHM_SH_PHYVER 0x0050 /* PHY version */
#define B43_SHM_SH_PHYTYPE 0x0052 /* PHY type */ #define B43_SHM_SH_PHYTYPE 0x0052 /* PHY type */
#define B43_SHM_SH_ANTSWAP 0x005C /* Antenna swap threshold */ #define B43_SHM_SH_ANTSWAP 0x005C /* Antenna swap threshold */
#define B43_SHM_SH_HOSTFLO 0x005E /* Hostflags for ucode options (low) */ #define B43_SHM_SH_HOSTF1 0x005E /* Hostflags 1 for ucode options */
#define B43_SHM_SH_HOSTFMI 0x0060 /* Hostflags for ucode options (middle) */ #define B43_SHM_SH_HOSTF2 0x0060 /* Hostflags 2 for ucode options */
#define B43_SHM_SH_HOSTFHI 0x0062 /* Hostflags for ucode options (high) */ #define B43_SHM_SH_HOSTF3 0x0062 /* Hostflags 3 for ucode options */
#define B43_SHM_SH_RFATT 0x0064 /* Current radio attenuation value */ #define B43_SHM_SH_RFATT 0x0064 /* Current radio attenuation value */
#define B43_SHM_SH_RADAR 0x0066 /* Radar register */ #define B43_SHM_SH_RADAR 0x0066 /* Radar register */
#define B43_SHM_SH_PHYTXNOI 0x006E /* PHY noise directly after TX (lower 8bit only) */ #define B43_SHM_SH_PHYTXNOI 0x006E /* PHY noise directly after TX (lower 8bit only) */
#define B43_SHM_SH_RFRXSP1 0x0072 /* RF RX SP Register 1 */ #define B43_SHM_SH_RFRXSP1 0x0072 /* RF RX SP Register 1 */
#define B43_SHM_SH_HOSTF4 0x0078 /* Hostflags 4 for ucode options */
#define B43_SHM_SH_CHAN 0x00A0 /* Current channel (low 8bit only) */ #define B43_SHM_SH_CHAN 0x00A0 /* Current channel (low 8bit only) */
#define B43_SHM_SH_CHAN_5GHZ 0x0100 /* Bit set, if 5 Ghz channel */ #define B43_SHM_SH_CHAN_5GHZ 0x0100 /* Bit set, if 5 Ghz channel */
#define B43_SHM_SH_CHAN_40MHZ 0x0200 /* Bit set, if 40 Mhz channel width */ #define B43_SHM_SH_CHAN_40MHZ 0x0200 /* Bit set, if 40 Mhz channel width */
#define B43_SHM_SH_HOSTF5 0x00D4 /* Hostflags 5 for ucode options */
#define B43_SHM_SH_BCMCFIFOID 0x0108 /* Last posted cookie to the bcast/mcast FIFO */ #define B43_SHM_SH_BCMCFIFOID 0x0108 /* Last posted cookie to the bcast/mcast FIFO */
/* TSSI information */ /* TSSI information */
#define B43_SHM_SH_TSSI_CCK 0x0058 /* TSSI for last 4 CCK frames (32bit) */ #define B43_SHM_SH_TSSI_CCK 0x0058 /* TSSI for last 4 CCK frames (32bit) */
...@@ -415,6 +417,8 @@ enum { ...@@ -415,6 +417,8 @@ enum {
#define B43_PHYTYPE_HT 0x07 #define B43_PHYTYPE_HT 0x07
#define B43_PHYTYPE_LCN 0x08 #define B43_PHYTYPE_LCN 0x08
#define B43_PHYTYPE_LCNXN 0x09 #define B43_PHYTYPE_LCNXN 0x09
#define B43_PHYTYPE_LCN40 0x0a
#define B43_PHYTYPE_AC 0x0b
/* PHYRegisters */ /* PHYRegisters */
#define B43_PHY_ILT_A_CTRL 0x0072 #define B43_PHY_ILT_A_CTRL 0x0072
......
...@@ -533,11 +533,11 @@ u64 b43_hf_read(struct b43_wldev *dev) ...@@ -533,11 +533,11 @@ u64 b43_hf_read(struct b43_wldev *dev)
{ {
u64 ret; u64 ret;
ret = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFHI); ret = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF3);
ret <<= 16; ret <<= 16;
ret |= b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFMI); ret |= b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF2);
ret <<= 16; ret <<= 16;
ret |= b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFLO); ret |= b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF1);
return ret; return ret;
} }
...@@ -550,9 +550,9 @@ void b43_hf_write(struct b43_wldev *dev, u64 value) ...@@ -550,9 +550,9 @@ void b43_hf_write(struct b43_wldev *dev, u64 value)
lo = (value & 0x00000000FFFFULL); lo = (value & 0x00000000FFFFULL);
mi = (value & 0x0000FFFF0000ULL) >> 16; mi = (value & 0x0000FFFF0000ULL) >> 16;
hi = (value & 0xFFFF00000000ULL) >> 32; hi = (value & 0xFFFF00000000ULL) >> 32;
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFLO, lo); b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF1, lo);
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFMI, mi); b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF2, mi);
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFHI, hi); b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF3, hi);
} }
/* Read the firmware capabilities bitmask (Opensource firmware only) */ /* Read the firmware capabilities bitmask (Opensource firmware only) */
...@@ -4282,6 +4282,35 @@ static int b43_wireless_core_start(struct b43_wldev *dev) ...@@ -4282,6 +4282,35 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
return err; return err;
} }
static char *b43_phy_name(struct b43_wldev *dev, u8 phy_type)
{
switch (phy_type) {
case B43_PHYTYPE_A:
return "A";
case B43_PHYTYPE_B:
return "B";
case B43_PHYTYPE_G:
return "G";
case B43_PHYTYPE_N:
return "N";
case B43_PHYTYPE_LP:
return "LP";
case B43_PHYTYPE_SSLPN:
return "SSLPN";
case B43_PHYTYPE_HT:
return "HT";
case B43_PHYTYPE_LCN:
return "LCN";
case B43_PHYTYPE_LCNXN:
return "LCNXN";
case B43_PHYTYPE_LCN40:
return "LCN40";
case B43_PHYTYPE_AC:
return "AC";
}
return "UNKNOWN";
}
/* Get PHY and RADIO versioning numbers */ /* Get PHY and RADIO versioning numbers */
static int b43_phy_versioning(struct b43_wldev *dev) static int b43_phy_versioning(struct b43_wldev *dev)
{ {
...@@ -4342,13 +4371,13 @@ static int b43_phy_versioning(struct b43_wldev *dev) ...@@ -4342,13 +4371,13 @@ static int b43_phy_versioning(struct b43_wldev *dev)
unsupported = 1; unsupported = 1;
} }
if (unsupported) { if (unsupported) {
b43err(dev->wl, "FOUND UNSUPPORTED PHY " b43err(dev->wl, "FOUND UNSUPPORTED PHY (Analog %u, Type %d (%s), Revision %u)\n",
"(Analog %u, Type %u, Revision %u)\n", analog_type, phy_type, b43_phy_name(dev, phy_type),
analog_type, phy_type, phy_rev); phy_rev);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
b43dbg(dev->wl, "Found PHY: Analog %u, Type %u, Revision %u\n", b43info(dev->wl, "Found PHY: Analog %u, Type %d (%s), Revision %u\n",
analog_type, phy_type, phy_rev); analog_type, phy_type, b43_phy_name(dev, phy_type), phy_rev);
/* Get RADIO versioning */ /* Get RADIO versioning */
if (dev->dev->core_rev >= 24) { if (dev->dev->core_rev >= 24) {
......
...@@ -240,6 +240,21 @@ void b43_radio_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set) ...@@ -240,6 +240,21 @@ void b43_radio_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set)
(b43_radio_read16(dev, offset) & mask) | set); (b43_radio_read16(dev, offset) & mask) | set);
} }
bool b43_radio_wait_value(struct b43_wldev *dev, u16 offset, u16 mask,
u16 value, int delay, int timeout)
{
u16 val;
int i;
for (i = 0; i < timeout; i += delay) {
val = b43_radio_read(dev, offset);
if ((val & mask) == value)
return true;
udelay(delay);
}
return false;
}
u16 b43_phy_read(struct b43_wldev *dev, u16 reg) u16 b43_phy_read(struct b43_wldev *dev, u16 reg)
{ {
assert_mac_suspended(dev); assert_mac_suspended(dev);
...@@ -428,7 +443,7 @@ int b43_phy_shm_tssi_read(struct b43_wldev *dev, u16 shm_offset) ...@@ -428,7 +443,7 @@ int b43_phy_shm_tssi_read(struct b43_wldev *dev, u16 shm_offset)
average = (a + b + c + d + 2) / 4; average = (a + b + c + d + 2) / 4;
if (is_ofdm) { if (is_ofdm) {
/* Adjust for CCK-boost */ /* Adjust for CCK-boost */
if (b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTFLO) if (b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_HOSTF1)
& B43_HF_CCKBOOST) & B43_HF_CCKBOOST)
average = (average >= 13) ? (average - 13) : 0; average = (average >= 13) ? (average - 13) : 0;
} }
......
...@@ -364,6 +364,12 @@ void b43_radio_set(struct b43_wldev *dev, u16 offset, u16 set); ...@@ -364,6 +364,12 @@ void b43_radio_set(struct b43_wldev *dev, u16 offset, u16 set);
*/ */
void b43_radio_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set); void b43_radio_maskset(struct b43_wldev *dev, u16 offset, u16 mask, u16 set);
/**
* b43_radio_wait_value - Waits for a given value in masked register read
*/
bool b43_radio_wait_value(struct b43_wldev *dev, u16 offset, u16 mask,
u16 value, int delay, int timeout);
/** /**
* b43_radio_lock - Lock firmware radio register access * b43_radio_lock - Lock firmware radio register access
*/ */
......
此差异已折叠。
...@@ -785,6 +785,7 @@ struct b43_phy_n { ...@@ -785,6 +785,7 @@ struct b43_phy_n {
u16 papd_epsilon_offset[2]; u16 papd_epsilon_offset[2];
s32 preamble_override; s32 preamble_override;
u32 bb_mult_save; u32 bb_mult_save;
bool init_por;
bool gain_boost; bool gain_boost;
bool elna_gain_config; bool elna_gain_config;
......
/*
Broadcom B43 wireless driver
IEEE 802.11n 2057 radio device data tables
Copyright (c) 2010 Rafał Miłecki <zajec5@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "b43.h"
#include "radio_2057.h"
#include "phy_common.h"
static u16 r2057_rev4_init[42][2] = {
{ 0x0E, 0x20 }, { 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 },
{ 0x35, 0x26 }, { 0x3C, 0xff }, { 0x3D, 0xff }, { 0x3E, 0xff },
{ 0x3F, 0xff }, { 0x62, 0x33 }, { 0x8A, 0xf0 }, { 0x8B, 0x10 },
{ 0x8C, 0xf0 }, { 0x91, 0x3f }, { 0x92, 0x36 }, { 0xA4, 0x8c },
{ 0xA8, 0x55 }, { 0xAF, 0x01 }, { 0x10F, 0xf0 }, { 0x110, 0x10 },
{ 0x111, 0xf0 }, { 0x116, 0x3f }, { 0x117, 0x36 }, { 0x129, 0x8c },
{ 0x12D, 0x55 }, { 0x134, 0x01 }, { 0x15E, 0x00 }, { 0x15F, 0x00 },
{ 0x160, 0x00 }, { 0x161, 0x00 }, { 0x162, 0x00 }, { 0x163, 0x00 },
{ 0x169, 0x02 }, { 0x16A, 0x00 }, { 0x16B, 0x00 }, { 0x16C, 0x00 },
{ 0x1A4, 0x00 }, { 0x1A5, 0x00 }, { 0x1A6, 0x00 }, { 0x1AA, 0x00 },
{ 0x1AB, 0x00 }, { 0x1AC, 0x00 },
};
static u16 r2057_rev5_init[44][2] = {
{ 0x00, 0x00 }, { 0x01, 0x57 }, { 0x02, 0x20 }, { 0x23, 0x6 },
{ 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x51, 0x70 },
{ 0x59, 0x88 }, { 0x5C, 0x20 }, { 0x62, 0x33 }, { 0x63, 0x0f },
{ 0x64, 0x0f }, { 0x81, 0x01 }, { 0x91, 0x3f }, { 0x92, 0x36 },
{ 0xA1, 0x20 }, { 0xD6, 0x70 }, { 0xDE, 0x88 }, { 0xE1, 0x20 },
{ 0xE8, 0x0f }, { 0xE9, 0x0f }, { 0x106, 0x01 }, { 0x116, 0x3f },
{ 0x117, 0x36 }, { 0x126, 0x20 }, { 0x15E, 0x00 }, { 0x15F, 0x00 },
{ 0x160, 0x00 }, { 0x161, 0x00 }, { 0x162, 0x00 }, { 0x163, 0x00 },
{ 0x16A, 0x00 }, { 0x16B, 0x00 }, { 0x16C, 0x00 }, { 0x1A4, 0x00 },
{ 0x1A5, 0x00 }, { 0x1A6, 0x00 }, { 0x1AA, 0x00 }, { 0x1AB, 0x00 },
{ 0x1AC, 0x00 }, { 0x1B7, 0x0c }, { 0x1C1, 0x01 }, { 0x1C2, 0x80 },
};
static u16 r2057_rev5a_init[45][2] = {
{ 0x00, 0x15 }, { 0x01, 0x57 }, { 0x02, 0x20 }, { 0x23, 0x6 },
{ 0x31, 0x00 }, { 0x32, 0x00 }, { 0x33, 0x00 }, { 0x51, 0x70 },
{ 0x59, 0x88 }, { 0x5C, 0x20 }, { 0x62, 0x33 }, { 0x63, 0x0f },
{ 0x64, 0x0f }, { 0x81, 0x01 }, { 0x91, 0x3f }, { 0x92, 0x36 },
{ 0xC9, 0x01 }, { 0xD6, 0x70 }, { 0xDE, 0x88 }, { 0xE1, 0x20 },
{ 0xE8, 0x0f }, { 0xE9, 0x0f }, { 0x106, 0x01 }, { 0x116, 0x3f },
{ 0x117, 0x36 }, { 0x126, 0x20 }, { 0x14E, 0x01 }, { 0x15E, 0x00 },
{ 0x15F, 0x00 }, { 0x160, 0x00 }, { 0x161, 0x00 }, { 0x162, 0x00 },
{ 0x163, 0x00 }, { 0x16A, 0x00 }, { 0x16B, 0x00 }, { 0x16C, 0x00 },
{ 0x1A4, 0x00 }, { 0x1A5, 0x00 }, { 0x1A6, 0x00 }, { 0x1AA, 0x00 },
{ 0x1AB, 0x00 }, { 0x1AC, 0x00 }, { 0x1B7, 0x0c }, { 0x1C1, 0x01 },
{ 0x1C2, 0x80 },
};
static u16 r2057_rev7_init[54][2] = {
{ 0x00, 0x00 }, { 0x01, 0x57 }, { 0x02, 0x20 }, { 0x31, 0x00 },
{ 0x32, 0x00 }, { 0x33, 0x00 }, { 0x51, 0x70 }, { 0x59, 0x88 },
{ 0x5C, 0x20 }, { 0x62, 0x33 }, { 0x63, 0x0f }, { 0x64, 0x13 },
{ 0x66, 0xee }, { 0x6E, 0x58 }, { 0x75, 0x13 }, { 0x7B, 0x13 },
{ 0x7C, 0x14 }, { 0x7D, 0xee }, { 0x81, 0x01 }, { 0x91, 0x3f },
{ 0x92, 0x36 }, { 0xA1, 0x20 }, { 0xD6, 0x70 }, { 0xDE, 0x88 },
{ 0xE1, 0x20 }, { 0xE8, 0x0f }, { 0xE9, 0x13 }, { 0xEB, 0xee },
{ 0xF3, 0x58 }, { 0xFA, 0x13 }, { 0x100, 0x13 }, { 0x101, 0x14 },
{ 0x102, 0xee }, { 0x106, 0x01 }, { 0x116, 0x3f }, { 0x117, 0x36 },
{ 0x126, 0x20 }, { 0x15E, 0x00 }, { 0x15F, 0x00 }, { 0x160, 0x00 },
{ 0x161, 0x00 }, { 0x162, 0x00 }, { 0x163, 0x00 }, { 0x16A, 0x00 },
{ 0x16B, 0x00 }, { 0x16C, 0x00 }, { 0x1A4, 0x00 }, { 0x1A5, 0x00 },
{ 0x1A6, 0x00 }, { 0x1AA, 0x00 }, { 0x1AB, 0x00 }, { 0x1AC, 0x00 },
{ 0x1B7, 0x05 }, { 0x1C2, 0xa0 },
};
static u16 r2057_rev8_init[54][2] = {
{ 0x00, 0x08 }, { 0x01, 0x57 }, { 0x02, 0x20 }, { 0x31, 0x00 },
{ 0x32, 0x00 }, { 0x33, 0x00 }, { 0x51, 0x70 }, { 0x59, 0x88 },
{ 0x5C, 0x20 }, { 0x62, 0x33 }, { 0x63, 0x0f }, { 0x64, 0x0f },
{ 0x6E, 0x58 }, { 0x75, 0x13 }, { 0x7B, 0x13 }, { 0x7C, 0x0f },
{ 0x7D, 0xee }, { 0x81, 0x01 }, { 0x91, 0x3f }, { 0x92, 0x36 },
{ 0xA1, 0x20 }, { 0xC9, 0x01 }, { 0xD6, 0x70 }, { 0xDE, 0x88 },
{ 0xE1, 0x20 }, { 0xE8, 0x0f }, { 0xE9, 0x0f }, { 0xF3, 0x58 },
{ 0xFA, 0x13 }, { 0x100, 0x13 }, { 0x101, 0x0f }, { 0x102, 0xee },
{ 0x106, 0x01 }, { 0x116, 0x3f }, { 0x117, 0x36 }, { 0x126, 0x20 },
{ 0x14E, 0x01 }, { 0x15E, 0x00 }, { 0x15F, 0x00 }, { 0x160, 0x00 },
{ 0x161, 0x00 }, { 0x162, 0x00 }, { 0x163, 0x00 }, { 0x16A, 0x00 },
{ 0x16B, 0x00 }, { 0x16C, 0x00 }, { 0x1A4, 0x00 }, { 0x1A5, 0x00 },
{ 0x1A6, 0x00 }, { 0x1AA, 0x00 }, { 0x1AB, 0x00 }, { 0x1AC, 0x00 },
{ 0x1B7, 0x05 }, { 0x1C2, 0xa0 },
};
void r2057_upload_inittabs(struct b43_wldev *dev)
{
struct b43_phy *phy = &dev->phy;
u16 *table = NULL;
u16 size, i;
if (phy->rev == 7) {
table = r2057_rev4_init[0];
size = ARRAY_SIZE(r2057_rev4_init);
} else if (phy->rev == 8 || phy->rev == 9) {
if (phy->radio_rev == 5) {
if (phy->radio_rev == 8) {
table = r2057_rev5_init[0];
size = ARRAY_SIZE(r2057_rev5_init);
} else {
table = r2057_rev5a_init[0];
size = ARRAY_SIZE(r2057_rev5a_init);
}
} else if (phy->radio_rev == 7) {
table = r2057_rev7_init[0];
size = ARRAY_SIZE(r2057_rev7_init);
} else if (phy->radio_rev == 9) {
table = r2057_rev8_init[0];
size = ARRAY_SIZE(r2057_rev8_init);
}
}
if (table) {
for (i = 0; i < 10; i++) {
pr_info("radio_write 0x%X ", *table);
table++;
pr_info("0x%X\n", *table);
table++;
}
}
}
#ifndef B43_RADIO_2057_H_
#define B43_RADIO_2057_H_
#include <linux/types.h>
#include "tables_nphy.h"
#define R2057_DACBUF_VINCM_CORE0 0x000
#define R2057_IDCODE 0x001
#define R2057_RCCAL_MASTER 0x002
#define R2057_RCCAL_CAP_SIZE 0x003
#define R2057_RCAL_CONFIG 0x004
#define R2057_GPAIO_CONFIG 0x005
#define R2057_GPAIO_SEL1 0x006
#define R2057_GPAIO_SEL0 0x007
#define R2057_CLPO_CONFIG 0x008
#define R2057_BANDGAP_CONFIG 0x009
#define R2057_BANDGAP_RCAL_TRIM 0x00a
#define R2057_AFEREG_CONFIG 0x00b
#define R2057_TEMPSENSE_CONFIG 0x00c
#define R2057_XTAL_CONFIG1 0x00d
#define R2057_XTAL_ICORE_SIZE 0x00e
#define R2057_XTAL_BUF_SIZE 0x00f
#define R2057_XTAL_PULLCAP_SIZE 0x010
#define R2057_RFPLL_MASTER 0x011
#define R2057_VCOMONITOR_VTH_L 0x012
#define R2057_VCOMONITOR_VTH_H 0x013
#define R2057_VCOCAL_BIASRESET_RFPLLREG_VOUT 0x014
#define R2057_VCO_VARCSIZE_IDAC 0x015
#define R2057_VCOCAL_COUNTVAL0 0x016
#define R2057_VCOCAL_COUNTVAL1 0x017
#define R2057_VCOCAL_INTCLK_COUNT 0x018
#define R2057_VCOCAL_MASTER 0x019
#define R2057_VCOCAL_NUMCAPCHANGE 0x01a
#define R2057_VCOCAL_WINSIZE 0x01b
#define R2057_VCOCAL_DELAY_AFTER_REFRESH 0x01c
#define R2057_VCOCAL_DELAY_AFTER_CLOSELOOP 0x01d
#define R2057_VCOCAL_DELAY_AFTER_OPENLOOP 0x01e
#define R2057_VCOCAL_DELAY_BEFORE_OPENLOOP 0x01f
#define R2057_VCO_FORCECAPEN_FORCECAP1 0x020
#define R2057_VCO_FORCECAP0 0x021
#define R2057_RFPLL_REFMASTER_SPAREXTALSIZE 0x022
#define R2057_RFPLL_PFD_RESET_PW 0x023
#define R2057_RFPLL_LOOPFILTER_R2 0x024
#define R2057_RFPLL_LOOPFILTER_R1 0x025
#define R2057_RFPLL_LOOPFILTER_C3 0x026
#define R2057_RFPLL_LOOPFILTER_C2 0x027
#define R2057_RFPLL_LOOPFILTER_C1 0x028
#define R2057_CP_KPD_IDAC 0x029
#define R2057_RFPLL_IDACS 0x02a
#define R2057_RFPLL_MISC_EN 0x02b
#define R2057_RFPLL_MMD0 0x02c
#define R2057_RFPLL_MMD1 0x02d
#define R2057_RFPLL_MISC_CAL_RESETN 0x02e
#define R2057_JTAGXTAL_SIZE_CPBIAS_FILTRES 0x02f
#define R2057_VCO_ALCREF_BBPLLXTAL_SIZE 0x030
#define R2057_VCOCAL_READCAP0 0x031
#define R2057_VCOCAL_READCAP1 0x032
#define R2057_VCOCAL_STATUS 0x033
#define R2057_LOGEN_PUS 0x034
#define R2057_LOGEN_PTAT_RESETS 0x035
#define R2057_VCOBUF_IDACS 0x036
#define R2057_VCOBUF_TUNE 0x037
#define R2057_CMOSBUF_TX2GQ_IDACS 0x038
#define R2057_CMOSBUF_TX2GI_IDACS 0x039
#define R2057_CMOSBUF_TX5GQ_IDACS 0x03a
#define R2057_CMOSBUF_TX5GI_IDACS 0x03b
#define R2057_CMOSBUF_RX2GQ_IDACS 0x03c
#define R2057_CMOSBUF_RX2GI_IDACS 0x03d
#define R2057_CMOSBUF_RX5GQ_IDACS 0x03e
#define R2057_CMOSBUF_RX5GI_IDACS 0x03f
#define R2057_LOGEN_MX2G_IDACS 0x040
#define R2057_LOGEN_MX2G_TUNE 0x041
#define R2057_LOGEN_MX5G_IDACS 0x042
#define R2057_LOGEN_MX5G_TUNE 0x043
#define R2057_LOGEN_MX5G_RCCR 0x044
#define R2057_LOGEN_INDBUF2G_IDAC 0x045
#define R2057_LOGEN_INDBUF2G_IBOOST 0x046
#define R2057_LOGEN_INDBUF2G_TUNE 0x047
#define R2057_LOGEN_INDBUF5G_IDAC 0x048
#define R2057_LOGEN_INDBUF5G_IBOOST 0x049
#define R2057_LOGEN_INDBUF5G_TUNE 0x04a
#define R2057_CMOSBUF_TX_RCCR 0x04b
#define R2057_CMOSBUF_RX_RCCR 0x04c
#define R2057_LOGEN_SEL_PKDET 0x04d
#define R2057_CMOSBUF_SHAREIQ_PTAT 0x04e
#define R2057_RXTXBIAS_CONFIG_CORE0 0x04f
#define R2057_TXGM_TXRF_PUS_CORE0 0x050
#define R2057_TXGM_IDAC_BLEED_CORE0 0x051
#define R2057_TXGM_GAIN_CORE0 0x056
#define R2057_TXGM2G_PKDET_PUS_CORE0 0x057
#define R2057_PAD2G_PTATS_CORE0 0x058
#define R2057_PAD2G_IDACS_CORE0 0x059
#define R2057_PAD2G_BOOST_PU_CORE0 0x05a
#define R2057_PAD2G_CASCV_GAIN_CORE0 0x05b
#define R2057_TXMIX2G_TUNE_BOOST_PU_CORE0 0x05c
#define R2057_TXMIX2G_LODC_CORE0 0x05d
#define R2057_PAD2G_TUNE_PUS_CORE0 0x05e
#define R2057_IPA2G_GAIN_CORE0 0x05f
#define R2057_TSSI2G_SPARE1_CORE0 0x060
#define R2057_TSSI2G_SPARE2_CORE0 0x061
#define R2057_IPA2G_TUNEV_CASCV_PTAT_CORE0 0x062
#define R2057_IPA2G_IMAIN_CORE0 0x063
#define R2057_IPA2G_CASCONV_CORE0 0x064
#define R2057_IPA2G_CASCOFFV_CORE0 0x065
#define R2057_IPA2G_BIAS_FILTER_CORE0 0x066
#define R2057_TX5G_PKDET_CORE0 0x069
#define R2057_PGA_PTAT_TXGM5G_PU_CORE0 0x06a
#define R2057_PAD5G_PTATS1_CORE0 0x06b
#define R2057_PAD5G_CLASS_PTATS2_CORE0 0x06c
#define R2057_PGA_BOOSTPTAT_IMAIN_CORE0 0x06d
#define R2057_PAD5G_CASCV_IMAIN_CORE0 0x06e
#define R2057_TXMIX5G_IBOOST_PAD_IAUX_CORE0 0x06f
#define R2057_PGA_BOOST_TUNE_CORE0 0x070
#define R2057_PGA_GAIN_CORE0 0x071
#define R2057_PAD5G_CASCOFFV_GAIN_PUS_CORE0 0x072
#define R2057_TXMIX5G_BOOST_TUNE_CORE0 0x073
#define R2057_PAD5G_TUNE_MISC_PUS_CORE0 0x074
#define R2057_IPA5G_IAUX_CORE0 0x075
#define R2057_IPA5G_GAIN_CORE0 0x076
#define R2057_TSSI5G_SPARE1_CORE0 0x077
#define R2057_TSSI5G_SPARE2_CORE0 0x078
#define R2057_IPA5G_CASCOFFV_PU_CORE0 0x079
#define R2057_IPA5G_PTAT_CORE0 0x07a
#define R2057_IPA5G_IMAIN_CORE0 0x07b
#define R2057_IPA5G_CASCONV_CORE0 0x07c
#define R2057_IPA5G_BIAS_FILTER_CORE0 0x07d
#define R2057_PAD_BIAS_FILTER_BWS_CORE0 0x080
#define R2057_TR2G_CONFIG1_CORE0_NU 0x081
#define R2057_TR2G_CONFIG2_CORE0_NU 0x082
#define R2057_LNA5G_RFEN_CORE0 0x083
#define R2057_TR5G_CONFIG2_CORE0_NU 0x084
#define R2057_RXRFBIAS_IBOOST_PU_CORE0 0x085
#define R2057_RXRF_IABAND_RXGM_IMAIN_PTAT_CORE0 0x086
#define R2057_RXGM_CMFBITAIL_AUXPTAT_CORE0 0x087
#define R2057_RXMIX_ICORE_RXGM_IAUX_CORE0 0x088
#define R2057_RXMIX_CMFBITAIL_PU_CORE0 0x089
#define R2057_LNA2_IMAIN_PTAT_PU_CORE0 0x08a
#define R2057_LNA2_IAUX_PTAT_CORE0 0x08b
#define R2057_LNA1_IMAIN_PTAT_PU_CORE0 0x08c
#define R2057_LNA15G_INPUT_MATCH_TUNE_CORE0 0x08d
#define R2057_RXRFBIAS_BANDSEL_CORE0 0x08e
#define R2057_TIA_CONFIG_CORE0 0x08f
#define R2057_TIA_IQGAIN_CORE0 0x090
#define R2057_TIA_IBIAS2_CORE0 0x091
#define R2057_TIA_IBIAS1_CORE0 0x092
#define R2057_TIA_SPARE_Q_CORE0 0x093
#define R2057_TIA_SPARE_I_CORE0 0x094
#define R2057_RXMIX2G_PUS_CORE0 0x095
#define R2057_RXMIX2G_VCMREFS_CORE0 0x096
#define R2057_RXMIX2G_LODC_QI_CORE0 0x097
#define R2057_W12G_BW_LNA2G_PUS_CORE0 0x098
#define R2057_LNA2G_GAIN_CORE0 0x099
#define R2057_LNA2G_TUNE_CORE0 0x09a
#define R2057_RXMIX5G_PUS_CORE0 0x09b
#define R2057_RXMIX5G_VCMREFS_CORE0 0x09c
#define R2057_RXMIX5G_LODC_QI_CORE0 0x09d
#define R2057_W15G_BW_LNA5G_PUS_CORE0 0x09e
#define R2057_LNA5G_GAIN_CORE0 0x09f
#define R2057_LNA5G_TUNE_CORE0 0x0a0
#define R2057_LPFSEL_TXRX_RXBB_PUS_CORE0 0x0a1
#define R2057_RXBB_BIAS_MASTER_CORE0 0x0a2
#define R2057_RXBB_VGABUF_IDACS_CORE0 0x0a3
#define R2057_LPF_VCMREF_TXBUF_VCMREF_CORE0 0x0a4
#define R2057_TXBUF_VINCM_CORE0 0x0a5
#define R2057_TXBUF_IDACS_CORE0 0x0a6
#define R2057_LPF_RESP_RXBUF_BW_CORE0 0x0a7
#define R2057_RXBB_CC_CORE0 0x0a8
#define R2057_RXBB_SPARE3_CORE0 0x0a9
#define R2057_RXBB_RCCAL_HPC_CORE0 0x0aa
#define R2057_LPF_IDACS_CORE0 0x0ab
#define R2057_LPFBYP_DCLOOP_BYP_IDAC_CORE0 0x0ac
#define R2057_TXBUF_GAIN_CORE0 0x0ad
#define R2057_AFELOOPBACK_AACI_RESP_CORE0 0x0ae
#define R2057_RXBUF_DEGEN_CORE0 0x0af
#define R2057_RXBB_SPARE2_CORE0 0x0b0
#define R2057_RXBB_SPARE1_CORE0 0x0b1
#define R2057_RSSI_MASTER_CORE0 0x0b2
#define R2057_W2_MASTER_CORE0 0x0b3
#define R2057_NB_MASTER_CORE0 0x0b4
#define R2057_W2_IDACS0_Q_CORE0 0x0b5
#define R2057_W2_IDACS1_Q_CORE0 0x0b6
#define R2057_W2_IDACS0_I_CORE0 0x0b7
#define R2057_W2_IDACS1_I_CORE0 0x0b8
#define R2057_RSSI_GPAIOSEL_W1_IDACS_CORE0 0x0b9
#define R2057_NB_IDACS_Q_CORE0 0x0ba
#define R2057_NB_IDACS_I_CORE0 0x0bb
#define R2057_BACKUP4_CORE0 0x0c1
#define R2057_BACKUP3_CORE0 0x0c2
#define R2057_BACKUP2_CORE0 0x0c3
#define R2057_BACKUP1_CORE0 0x0c4
#define R2057_SPARE16_CORE0 0x0c5
#define R2057_SPARE15_CORE0 0x0c6
#define R2057_SPARE14_CORE0 0x0c7
#define R2057_SPARE13_CORE0 0x0c8
#define R2057_SPARE12_CORE0 0x0c9
#define R2057_SPARE11_CORE0 0x0ca
#define R2057_TX2G_BIAS_RESETS_CORE0 0x0cb
#define R2057_TX5G_BIAS_RESETS_CORE0 0x0cc
#define R2057_IQTEST_SEL_PU 0x0cd
#define R2057_XTAL_CONFIG2 0x0ce
#define R2057_BUFS_MISC_LPFBW_CORE0 0x0cf
#define R2057_TXLPF_RCCAL_CORE0 0x0d0
#define R2057_RXBB_GPAIOSEL_RXLPF_RCCAL_CORE0 0x0d1
#define R2057_LPF_GAIN_CORE0 0x0d2
#define R2057_DACBUF_IDACS_BW_CORE0 0x0d3
#define R2057_RXTXBIAS_CONFIG_CORE1 0x0d4
#define R2057_TXGM_TXRF_PUS_CORE1 0x0d5
#define R2057_TXGM_IDAC_BLEED_CORE1 0x0d6
#define R2057_TXGM_GAIN_CORE1 0x0db
#define R2057_TXGM2G_PKDET_PUS_CORE1 0x0dc
#define R2057_PAD2G_PTATS_CORE1 0x0dd
#define R2057_PAD2G_IDACS_CORE1 0x0de
#define R2057_PAD2G_BOOST_PU_CORE1 0x0df
#define R2057_PAD2G_CASCV_GAIN_CORE1 0x0e0
#define R2057_TXMIX2G_TUNE_BOOST_PU_CORE1 0x0e1
#define R2057_TXMIX2G_LODC_CORE1 0x0e2
#define R2057_PAD2G_TUNE_PUS_CORE1 0x0e3
#define R2057_IPA2G_GAIN_CORE1 0x0e4
#define R2057_TSSI2G_SPARE1_CORE1 0x0e5
#define R2057_TSSI2G_SPARE2_CORE1 0x0e6
#define R2057_IPA2G_TUNEV_CASCV_PTAT_CORE1 0x0e7
#define R2057_IPA2G_IMAIN_CORE1 0x0e8
#define R2057_IPA2G_CASCONV_CORE1 0x0e9
#define R2057_IPA2G_CASCOFFV_CORE1 0x0ea
#define R2057_IPA2G_BIAS_FILTER_CORE1 0x0eb
#define R2057_TX5G_PKDET_CORE1 0x0ee
#define R2057_PGA_PTAT_TXGM5G_PU_CORE1 0x0ef
#define R2057_PAD5G_PTATS1_CORE1 0x0f0
#define R2057_PAD5G_CLASS_PTATS2_CORE1 0x0f1
#define R2057_PGA_BOOSTPTAT_IMAIN_CORE1 0x0f2
#define R2057_PAD5G_CASCV_IMAIN_CORE1 0x0f3
#define R2057_TXMIX5G_IBOOST_PAD_IAUX_CORE1 0x0f4
#define R2057_PGA_BOOST_TUNE_CORE1 0x0f5
#define R2057_PGA_GAIN_CORE1 0x0f6
#define R2057_PAD5G_CASCOFFV_GAIN_PUS_CORE1 0x0f7
#define R2057_TXMIX5G_BOOST_TUNE_CORE1 0x0f8
#define R2057_PAD5G_TUNE_MISC_PUS_CORE1 0x0f9
#define R2057_IPA5G_IAUX_CORE1 0x0fa
#define R2057_IPA5G_GAIN_CORE1 0x0fb
#define R2057_TSSI5G_SPARE1_CORE1 0x0fc
#define R2057_TSSI5G_SPARE2_CORE1 0x0fd
#define R2057_IPA5G_CASCOFFV_PU_CORE1 0x0fe
#define R2057_IPA5G_PTAT_CORE1 0x0ff
#define R2057_IPA5G_IMAIN_CORE1 0x100
#define R2057_IPA5G_CASCONV_CORE1 0x101
#define R2057_IPA5G_BIAS_FILTER_CORE1 0x102
#define R2057_PAD_BIAS_FILTER_BWS_CORE1 0x105
#define R2057_TR2G_CONFIG1_CORE1_NU 0x106
#define R2057_TR2G_CONFIG2_CORE1_NU 0x107
#define R2057_LNA5G_RFEN_CORE1 0x108
#define R2057_TR5G_CONFIG2_CORE1_NU 0x109
#define R2057_RXRFBIAS_IBOOST_PU_CORE1 0x10a
#define R2057_RXRF_IABAND_RXGM_IMAIN_PTAT_CORE1 0x10b
#define R2057_RXGM_CMFBITAIL_AUXPTAT_CORE1 0x10c
#define R2057_RXMIX_ICORE_RXGM_IAUX_CORE1 0x10d
#define R2057_RXMIX_CMFBITAIL_PU_CORE1 0x10e
#define R2057_LNA2_IMAIN_PTAT_PU_CORE1 0x10f
#define R2057_LNA2_IAUX_PTAT_CORE1 0x110
#define R2057_LNA1_IMAIN_PTAT_PU_CORE1 0x111
#define R2057_LNA15G_INPUT_MATCH_TUNE_CORE1 0x112
#define R2057_RXRFBIAS_BANDSEL_CORE1 0x113
#define R2057_TIA_CONFIG_CORE1 0x114
#define R2057_TIA_IQGAIN_CORE1 0x115
#define R2057_TIA_IBIAS2_CORE1 0x116
#define R2057_TIA_IBIAS1_CORE1 0x117
#define R2057_TIA_SPARE_Q_CORE1 0x118
#define R2057_TIA_SPARE_I_CORE1 0x119
#define R2057_RXMIX2G_PUS_CORE1 0x11a
#define R2057_RXMIX2G_VCMREFS_CORE1 0x11b
#define R2057_RXMIX2G_LODC_QI_CORE1 0x11c
#define R2057_W12G_BW_LNA2G_PUS_CORE1 0x11d
#define R2057_LNA2G_GAIN_CORE1 0x11e
#define R2057_LNA2G_TUNE_CORE1 0x11f
#define R2057_RXMIX5G_PUS_CORE1 0x120
#define R2057_RXMIX5G_VCMREFS_CORE1 0x121
#define R2057_RXMIX5G_LODC_QI_CORE1 0x122
#define R2057_W15G_BW_LNA5G_PUS_CORE1 0x123
#define R2057_LNA5G_GAIN_CORE1 0x124
#define R2057_LNA5G_TUNE_CORE1 0x125
#define R2057_LPFSEL_TXRX_RXBB_PUS_CORE1 0x126
#define R2057_RXBB_BIAS_MASTER_CORE1 0x127
#define R2057_RXBB_VGABUF_IDACS_CORE1 0x128
#define R2057_LPF_VCMREF_TXBUF_VCMREF_CORE1 0x129
#define R2057_TXBUF_VINCM_CORE1 0x12a
#define R2057_TXBUF_IDACS_CORE1 0x12b
#define R2057_LPF_RESP_RXBUF_BW_CORE1 0x12c
#define R2057_RXBB_CC_CORE1 0x12d
#define R2057_RXBB_SPARE3_CORE1 0x12e
#define R2057_RXBB_RCCAL_HPC_CORE1 0x12f
#define R2057_LPF_IDACS_CORE1 0x130
#define R2057_LPFBYP_DCLOOP_BYP_IDAC_CORE1 0x131
#define R2057_TXBUF_GAIN_CORE1 0x132
#define R2057_AFELOOPBACK_AACI_RESP_CORE1 0x133
#define R2057_RXBUF_DEGEN_CORE1 0x134
#define R2057_RXBB_SPARE2_CORE1 0x135
#define R2057_RXBB_SPARE1_CORE1 0x136
#define R2057_RSSI_MASTER_CORE1 0x137
#define R2057_W2_MASTER_CORE1 0x138
#define R2057_NB_MASTER_CORE1 0x139
#define R2057_W2_IDACS0_Q_CORE1 0x13a
#define R2057_W2_IDACS1_Q_CORE1 0x13b
#define R2057_W2_IDACS0_I_CORE1 0x13c
#define R2057_W2_IDACS1_I_CORE1 0x13d
#define R2057_RSSI_GPAIOSEL_W1_IDACS_CORE1 0x13e
#define R2057_NB_IDACS_Q_CORE1 0x13f
#define R2057_NB_IDACS_I_CORE1 0x140
#define R2057_BACKUP4_CORE1 0x146
#define R2057_BACKUP3_CORE1 0x147
#define R2057_BACKUP2_CORE1 0x148
#define R2057_BACKUP1_CORE1 0x149
#define R2057_SPARE16_CORE1 0x14a
#define R2057_SPARE15_CORE1 0x14b
#define R2057_SPARE14_CORE1 0x14c
#define R2057_SPARE13_CORE1 0x14d
#define R2057_SPARE12_CORE1 0x14e
#define R2057_SPARE11_CORE1 0x14f
#define R2057_TX2G_BIAS_RESETS_CORE1 0x150
#define R2057_TX5G_BIAS_RESETS_CORE1 0x151
#define R2057_SPARE8_CORE1 0x152
#define R2057_SPARE7_CORE1 0x153
#define R2057_BUFS_MISC_LPFBW_CORE1 0x154
#define R2057_TXLPF_RCCAL_CORE1 0x155
#define R2057_RXBB_GPAIOSEL_RXLPF_RCCAL_CORE1 0x156
#define R2057_LPF_GAIN_CORE1 0x157
#define R2057_DACBUF_IDACS_BW_CORE1 0x158
#define R2057_DACBUF_VINCM_CORE1 0x159
#define R2057_RCCAL_START_R1_Q1_P1 0x15a
#define R2057_RCCAL_X1 0x15b
#define R2057_RCCAL_TRC0 0x15c
#define R2057_RCCAL_TRC1 0x15d
#define R2057_RCCAL_DONE_OSCCAP 0x15e
#define R2057_RCCAL_N0_0 0x15f
#define R2057_RCCAL_N0_1 0x160
#define R2057_RCCAL_N1_0 0x161
#define R2057_RCCAL_N1_1 0x162
#define R2057_RCAL_STATUS 0x163
#define R2057_XTALPUOVR_PINCTRL 0x164
#define R2057_OVR_REG0 0x165
#define R2057_OVR_REG1 0x166
#define R2057_OVR_REG2 0x167
#define R2057_OVR_REG3 0x168
#define R2057_OVR_REG4 0x169
#define R2057_RCCAL_SCAP_VAL 0x16a
#define R2057_RCCAL_BCAP_VAL 0x16b
#define R2057_RCCAL_HPC_VAL 0x16c
#define R2057_RCCAL_OVERRIDES 0x16d
#define R2057_TX0_IQCAL_GAIN_BW 0x170
#define R2057_TX0_LOFT_FINE_I 0x171
#define R2057_TX0_LOFT_FINE_Q 0x172
#define R2057_TX0_LOFT_COARSE_I 0x173
#define R2057_TX0_LOFT_COARSE_Q 0x174
#define R2057_TX0_TX_SSI_MASTER 0x175
#define R2057_TX0_IQCAL_VCM_HG 0x176
#define R2057_TX0_IQCAL_IDAC 0x177
#define R2057_TX0_TSSI_VCM 0x178
#define R2057_TX0_TX_SSI_MUX 0x179
#define R2057_TX0_TSSIA 0x17a
#define R2057_TX0_TSSIG 0x17b
#define R2057_TX0_TSSI_MISC1 0x17c
#define R2057_TX0_TXRXCOUPLE_2G_ATTEN 0x17d
#define R2057_TX0_TXRXCOUPLE_2G_PWRUP 0x17e
#define R2057_TX0_TXRXCOUPLE_5G_ATTEN 0x17f
#define R2057_TX0_TXRXCOUPLE_5G_PWRUP 0x180
#define R2057_TX1_IQCAL_GAIN_BW 0x190
#define R2057_TX1_LOFT_FINE_I 0x191
#define R2057_TX1_LOFT_FINE_Q 0x192
#define R2057_TX1_LOFT_COARSE_I 0x193
#define R2057_TX1_LOFT_COARSE_Q 0x194
#define R2057_TX1_TX_SSI_MASTER 0x195
#define R2057_TX1_IQCAL_VCM_HG 0x196
#define R2057_TX1_IQCAL_IDAC 0x197
#define R2057_TX1_TSSI_VCM 0x198
#define R2057_TX1_TX_SSI_MUX 0x199
#define R2057_TX1_TSSIA 0x19a
#define R2057_TX1_TSSIG 0x19b
#define R2057_TX1_TSSI_MISC1 0x19c
#define R2057_TX1_TXRXCOUPLE_2G_ATTEN 0x19d
#define R2057_TX1_TXRXCOUPLE_2G_PWRUP 0x19e
#define R2057_TX1_TXRXCOUPLE_5G_ATTEN 0x19f
#define R2057_TX1_TXRXCOUPLE_5G_PWRUP 0x1a0
#define R2057_AFE_VCM_CAL_MASTER_CORE0 0x1a1
#define R2057_AFE_SET_VCM_I_CORE0 0x1a2
#define R2057_AFE_SET_VCM_Q_CORE0 0x1a3
#define R2057_AFE_STATUS_VCM_IQADC_CORE0 0x1a4
#define R2057_AFE_STATUS_VCM_I_CORE0 0x1a5
#define R2057_AFE_STATUS_VCM_Q_CORE0 0x1a6
#define R2057_AFE_VCM_CAL_MASTER_CORE1 0x1a7
#define R2057_AFE_SET_VCM_I_CORE1 0x1a8
#define R2057_AFE_SET_VCM_Q_CORE1 0x1a9
#define R2057_AFE_STATUS_VCM_IQADC_CORE1 0x1aa
#define R2057_AFE_STATUS_VCM_I_CORE1 0x1ab
#define R2057_AFE_STATUS_VCM_Q_CORE1 0x1ac
#define R2057v7_DACBUF_VINCM_CORE0 0x1ad
#define R2057v7_RCCAL_MASTER 0x1ae
#define R2057v7_TR2G_CONFIG3_CORE0_NU 0x1af
#define R2057v7_TR2G_CONFIG3_CORE1_NU 0x1b0
#define R2057v7_LOGEN_PUS1 0x1b1
#define R2057v7_OVR_REG5 0x1b2
#define R2057v7_OVR_REG6 0x1b3
#define R2057v7_OVR_REG7 0x1b4
#define R2057v7_OVR_REG8 0x1b5
#define R2057v7_OVR_REG9 0x1b6
#define R2057v7_OVR_REG10 0x1b7
#define R2057v7_OVR_REG11 0x1b8
#define R2057v7_OVR_REG12 0x1b9
#define R2057v7_OVR_REG13 0x1ba
#define R2057v7_OVR_REG14 0x1bb
#define R2057v7_OVR_REG15 0x1bc
#define R2057v7_OVR_REG16 0x1bd
#define R2057v7_OVR_REG1 0x1be
#define R2057v7_OVR_REG18 0x1bf
#define R2057v7_OVR_REG19 0x1c0
#define R2057v7_OVR_REG20 0x1c1
#define R2057v7_OVR_REG21 0x1c2
#define R2057v7_OVR_REG2 0x1c3
#define R2057v7_OVR_REG23 0x1c4
#define R2057v7_OVR_REG24 0x1c5
#define R2057v7_OVR_REG25 0x1c6
#define R2057v7_OVR_REG26 0x1c7
#define R2057v7_OVR_REG27 0x1c8
#define R2057v7_OVR_REG28 0x1c9
#define R2057v7_IQTEST_SEL_PU2 0x1ca
#define R2057_VCM_MASK 0x7
void r2057_upload_inittabs(struct b43_wldev *dev);
#endif /* B43_RADIO_2057_H_ */
...@@ -2757,6 +2757,49 @@ const struct nphy_rf_control_override_rev3 tbl_rf_control_override_rev3[] = { ...@@ -2757,6 +2757,49 @@ const struct nphy_rf_control_override_rev3 tbl_rf_control_override_rev3[] = {
{ 0x00C0, 6, 0xE7, 0xF9, 0xEC, 0xFB } /* field == 0x4000 (fls 15) */ { 0x00C0, 6, 0xE7, 0xF9, 0xEC, 0xFB } /* field == 0x4000 (fls 15) */
}; };
/* field, val_addr_core0, val_addr_core1, val_mask, val_shift */
static const struct nphy_rf_control_override_rev7
tbl_rf_control_override_rev7_over0[] = {
{ 0x0004, 0x07A, 0x07D, 0x0002, 1 },
{ 0x0008, 0x07A, 0x07D, 0x0004, 2 },
{ 0x0010, 0x07A, 0x07D, 0x0010, 4 },
{ 0x0020, 0x07A, 0x07D, 0x0020, 5 },
{ 0x0040, 0x07A, 0x07D, 0x0040, 6 },
{ 0x0080, 0x0F8, 0x0FA, 0x0080, 7 },
{ 0x0400, 0x0F8, 0x0FA, 0x0070, 4 },
{ 0x0800, 0x07B, 0x07E, 0xFFFF, 0 },
{ 0x1000, 0x07C, 0x07F, 0xFFFF, 0 },
{ 0x6000, 0x348, 0x349, 0xFFFF, 0 },
{ 0x2000, 0x348, 0x349, 0x000F, 0 },
};
/* field, val_addr_core0, val_addr_core1, val_mask, val_shift */
static const struct nphy_rf_control_override_rev7
tbl_rf_control_override_rev7_over1[] = {
{ 0x0002, 0x340, 0x341, 0x0002, 1 },
{ 0x0008, 0x340, 0x341, 0x0008, 3 },
{ 0x0020, 0x340, 0x341, 0x0020, 5 },
{ 0x0010, 0x340, 0x341, 0x0010, 4 },
{ 0x0004, 0x340, 0x341, 0x0004, 2 },
{ 0x0080, 0x340, 0x341, 0x0700, 8 },
{ 0x0800, 0x340, 0x341, 0x4000, 14 },
{ 0x0400, 0x340, 0x341, 0x2000, 13 },
{ 0x0200, 0x340, 0x341, 0x0800, 12 },
{ 0x0100, 0x340, 0x341, 0x0100, 11 },
{ 0x0040, 0x340, 0x341, 0x0040, 6 },
{ 0x0001, 0x340, 0x341, 0x0001, 0 },
};
/* field, val_addr_core0, val_addr_core1, val_mask, val_shift */
static const struct nphy_rf_control_override_rev7
tbl_rf_control_override_rev7_over2[] = {
{ 0x0008, 0x344, 0x345, 0x0008, 3 },
{ 0x0002, 0x344, 0x345, 0x0002, 1 },
{ 0x0001, 0x344, 0x345, 0x0001, 0 },
{ 0x0004, 0x344, 0x345, 0x0004, 2 },
{ 0x0010, 0x344, 0x345, 0x0010, 4 },
};
struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_wa_phy6_radio11_ghz2 = { struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_wa_phy6_radio11_ghz2 = {
{ 10, 14, 19, 27 }, { 10, 14, 19, 27 },
{ -5, 6, 10, 15 }, { -5, 6, 10, 15 },
...@@ -3248,3 +3291,35 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent( ...@@ -3248,3 +3291,35 @@ struct nphy_gain_ctl_workaround_entry *b43_nphy_get_gain_ctl_workaround_ent(
return e; return e;
} }
const struct nphy_rf_control_override_rev7 *b43_nphy_get_rf_ctl_over_rev7(
struct b43_wldev *dev, u16 field, u8 override)
{
const struct nphy_rf_control_override_rev7 *e;
u8 size, i;
switch (override) {
case 0:
e = tbl_rf_control_override_rev7_over0;
size = ARRAY_SIZE(tbl_rf_control_override_rev7_over0);
break;
case 1:
e = tbl_rf_control_override_rev7_over1;
size = ARRAY_SIZE(tbl_rf_control_override_rev7_over1);
break;
case 2:
e = tbl_rf_control_override_rev7_over2;
size = ARRAY_SIZE(tbl_rf_control_override_rev7_over2);
break;
default:
b43err(dev->wl, "Invalid override value %d\n", override);
return NULL;
}
for (i = 0; i < size; i++) {
if (e[i].field == field)
return &e[i];
}
return NULL;
}
...@@ -35,6 +35,14 @@ struct nphy_rf_control_override_rev3 { ...@@ -35,6 +35,14 @@ struct nphy_rf_control_override_rev3 {
u8 val_addr1; u8 val_addr1;
}; };
struct nphy_rf_control_override_rev7 {
u16 field;
u16 val_addr_core0;
u16 val_addr_core1;
u16 val_mask;
u8 val_shift;
};
struct nphy_gain_ctl_workaround_entry { struct nphy_gain_ctl_workaround_entry {
s8 lna1_gain[4]; s8 lna1_gain[4];
s8 lna2_gain[4]; s8 lna2_gain[4];
...@@ -202,5 +210,7 @@ extern const struct nphy_rf_control_override_rev2 ...@@ -202,5 +210,7 @@ extern const struct nphy_rf_control_override_rev2
tbl_rf_control_override_rev2[]; tbl_rf_control_override_rev2[];
extern const struct nphy_rf_control_override_rev3 extern const struct nphy_rf_control_override_rev3
tbl_rf_control_override_rev3[]; tbl_rf_control_override_rev3[];
const struct nphy_rf_control_override_rev7 *b43_nphy_get_rf_ctl_over_rev7(
struct b43_wldev *dev, u16 field, u8 override);
#endif /* B43_TABLES_NPHY_H_ */ #endif /* B43_TABLES_NPHY_H_ */
...@@ -1920,7 +1920,7 @@ static int b43legacy_gpio_init(struct b43legacy_wldev *dev) ...@@ -1920,7 +1920,7 @@ static int b43legacy_gpio_init(struct b43legacy_wldev *dev)
return 0; return 0;
ssb_write32(gpiodev, B43legacy_GPIO_CONTROL, ssb_write32(gpiodev, B43legacy_GPIO_CONTROL,
(ssb_read32(gpiodev, B43legacy_GPIO_CONTROL) (ssb_read32(gpiodev, B43legacy_GPIO_CONTROL)
& mask) | set); & ~mask) | set);
return 0; return 0;
} }
......
...@@ -86,7 +86,9 @@ MODULE_AUTHOR("Broadcom Corporation"); ...@@ -86,7 +86,9 @@ MODULE_AUTHOR("Broadcom Corporation");
MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver."); MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver.");
MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards"); MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards");
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
/* This needs to be adjusted when brcms_firmwares changes */
MODULE_FIRMWARE("brcm/bcm43xx-0.fw");
MODULE_FIRMWARE("brcm/bcm43xx_hdr-0.fw");
/* recognized BCMA Core IDs */ /* recognized BCMA Core IDs */
static struct bcma_device_id brcms_coreid_table[] = { static struct bcma_device_id brcms_coreid_table[] = {
......
...@@ -7512,15 +7512,10 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh, ...@@ -7512,15 +7512,10 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
channel = BRCMS_CHAN_CHANNEL(rxh->RxChan); channel = BRCMS_CHAN_CHANNEL(rxh->RxChan);
if (channel > 14) { rx_status->band =
rx_status->band = IEEE80211_BAND_5GHZ; channel > 14 ? IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ;
rx_status->freq = ieee80211_ofdm_chan_to_freq( rx_status->freq =
WF_CHAN_FACTOR_5_G/2, channel); ieee80211_channel_to_frequency(channel, rx_status->band);
} else {
rx_status->band = IEEE80211_BAND_2GHZ;
rx_status->freq = ieee80211_dsss_chan_to_freq(channel);
}
rx_status->signal = wlc_phy_rssi_compute(wlc->hw->band->pi, rxh); rx_status->signal = wlc_phy_rssi_compute(wlc->hw->band->pi, rxh);
......
...@@ -67,11 +67,6 @@ ...@@ -67,11 +67,6 @@
#define WL_CHANSPEC_BAND_2G 0x2000 #define WL_CHANSPEC_BAND_2G 0x2000
#define INVCHANSPEC 255 #define INVCHANSPEC 255
/* used to calculate the chan_freq = chan_factor * 500Mhz + 5 * chan_number */
#define WF_CHAN_FACTOR_2_4_G 4814 /* 2.4 GHz band, 2407 MHz */
#define WF_CHAN_FACTOR_5_G 10000 /* 5 GHz band, 5000 MHz */
#define WF_CHAN_FACTOR_4_G 8000 /* 4.9 GHz band for Japan */
#define CHSPEC_CHANNEL(chspec) ((u8)((chspec) & WL_CHANSPEC_CHAN_MASK)) #define CHSPEC_CHANNEL(chspec) ((u8)((chspec) & WL_CHANSPEC_CHAN_MASK))
#define CHSPEC_BAND(chspec) ((chspec) & WL_CHANSPEC_BAND_MASK) #define CHSPEC_BAND(chspec) ((chspec) & WL_CHANSPEC_BAND_MASK)
......
...@@ -4860,7 +4860,7 @@ EXPORT_SYMBOL(il_add_beacon_time); ...@@ -4860,7 +4860,7 @@ EXPORT_SYMBOL(il_add_beacon_time);
#ifdef CONFIG_PM #ifdef CONFIG_PM
int static int
il_pci_suspend(struct device *device) il_pci_suspend(struct device *device)
{ {
struct pci_dev *pdev = to_pci_dev(device); struct pci_dev *pdev = to_pci_dev(device);
...@@ -4877,9 +4877,8 @@ il_pci_suspend(struct device *device) ...@@ -4877,9 +4877,8 @@ il_pci_suspend(struct device *device)
return 0; return 0;
} }
EXPORT_SYMBOL(il_pci_suspend);
int static int
il_pci_resume(struct device *device) il_pci_resume(struct device *device)
{ {
struct pci_dev *pdev = to_pci_dev(device); struct pci_dev *pdev = to_pci_dev(device);
...@@ -4906,16 +4905,8 @@ il_pci_resume(struct device *device) ...@@ -4906,16 +4905,8 @@ il_pci_resume(struct device *device)
return 0; return 0;
} }
EXPORT_SYMBOL(il_pci_resume);
const struct dev_pm_ops il_pm_ops = { SIMPLE_DEV_PM_OPS(il_pm_ops, il_pci_suspend, il_pci_resume);
.suspend = il_pci_suspend,
.resume = il_pci_resume,
.freeze = il_pci_suspend,
.thaw = il_pci_resume,
.poweroff = il_pci_suspend,
.restore = il_pci_resume,
};
EXPORT_SYMBOL(il_pm_ops); EXPORT_SYMBOL(il_pm_ops);
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
......
...@@ -1845,8 +1845,6 @@ __le32 il_add_beacon_time(struct il_priv *il, u32 base, u32 addon, ...@@ -1845,8 +1845,6 @@ __le32 il_add_beacon_time(struct il_priv *il, u32 base, u32 addon,
u32 beacon_interval); u32 beacon_interval);
#ifdef CONFIG_PM #ifdef CONFIG_PM
int il_pci_suspend(struct device *device);
int il_pci_resume(struct device *device);
extern const struct dev_pm_ops il_pm_ops; extern const struct dev_pm_ops il_pm_ops;
#define IL_LEGACY_PM_OPS (&il_pm_ops) #define IL_LEGACY_PM_OPS (&il_pm_ops)
......
...@@ -726,3 +726,29 @@ int mwifiex_get_tx_ba_stream_tbl(struct mwifiex_private *priv, ...@@ -726,3 +726,29 @@ int mwifiex_get_tx_ba_stream_tbl(struct mwifiex_private *priv,
return count; return count;
} }
/*
* This function retrieves the entry for specific tx BA stream table by RA and
* deletes it.
*/
void mwifiex_del_tx_ba_stream_tbl_by_ra(struct mwifiex_private *priv, u8 *ra)
{
struct mwifiex_tx_ba_stream_tbl *tbl, *tmp;
unsigned long flags;
if (!ra)
return;
spin_lock_irqsave(&priv->tx_ba_stream_tbl_lock, flags);
list_for_each_entry_safe(tbl, tmp, &priv->tx_ba_stream_tbl_ptr, list) {
if (!memcmp(tbl->ra, ra, ETH_ALEN)) {
spin_unlock_irqrestore(&priv->tx_ba_stream_tbl_lock,
flags);
mwifiex_11n_delete_tx_ba_stream_tbl_entry(priv, tbl);
spin_lock_irqsave(&priv->tx_ba_stream_tbl_lock, flags);
}
}
spin_unlock_irqrestore(&priv->tx_ba_stream_tbl_lock, flags);
return;
}
...@@ -69,6 +69,7 @@ int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv, ...@@ -69,6 +69,7 @@ int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv,
int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd, int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd,
int cmd_action, int cmd_action,
struct mwifiex_ds_11n_amsdu_aggr_ctrl *aa_ctrl); struct mwifiex_ds_11n_amsdu_aggr_ctrl *aa_ctrl);
void mwifiex_del_tx_ba_stream_tbl_by_ra(struct mwifiex_private *priv, u8 *ra);
/* /*
* This function checks whether AMPDU is allowed or not for a particular TID. * This function checks whether AMPDU is allowed or not for a particular TID.
...@@ -157,4 +158,18 @@ mwifiex_is_ba_stream_setup(struct mwifiex_private *priv, ...@@ -157,4 +158,18 @@ mwifiex_is_ba_stream_setup(struct mwifiex_private *priv,
return false; return false;
} }
/*
* This function checks whether associated station is 11n enabled
*/
static inline int mwifiex_is_sta_11n_enabled(struct mwifiex_private *priv,
struct mwifiex_sta_node *node)
{
if (!node || (priv->bss_role != MWIFIEX_BSS_ROLE_UAP) ||
!priv->ap_11n_enabled)
return 0;
return node->is_11n_enabled;
}
#endif /* !_MWIFIEX_11N_H_ */ #endif /* !_MWIFIEX_11N_H_ */
...@@ -62,9 +62,7 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr, ...@@ -62,9 +62,7 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr,
}; };
struct tx_packet_hdr *tx_header; struct tx_packet_hdr *tx_header;
skb_put(skb_aggr, sizeof(*tx_header)); tx_header = (void *)skb_put(skb_aggr, sizeof(*tx_header));
tx_header = (struct tx_packet_hdr *) skb_aggr->data;
/* Copy DA and SA */ /* Copy DA and SA */
dt_offset = 2 * ETH_ALEN; dt_offset = 2 * ETH_ALEN;
...@@ -82,12 +80,10 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr, ...@@ -82,12 +80,10 @@ mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr,
tx_header->eth803_hdr.h_proto = htons(skb_src->len + LLC_SNAP_LEN); tx_header->eth803_hdr.h_proto = htons(skb_src->len + LLC_SNAP_LEN);
/* Add payload */ /* Add payload */
skb_put(skb_aggr, skb_src->len); memcpy(skb_put(skb_aggr, skb_src->len), skb_src->data, skb_src->len);
memcpy(skb_aggr->data + sizeof(*tx_header), skb_src->data,
skb_src->len); /* Add padding for new MSDU to start from 4 byte boundary */
*pad = (((skb_src->len + LLC_SNAP_LEN) & 3)) ? (4 - (((skb_src->len + *pad = (4 - ((unsigned long)skb_aggr->tail & 0x3)) % 4;
LLC_SNAP_LEN)) & 3)) : 0;
skb_put(skb_aggr, *pad);
return skb_aggr->len + *pad; return skb_aggr->len + *pad;
} }
......
...@@ -54,8 +54,13 @@ mwifiex_11n_dispatch_pkt(struct mwifiex_private *priv, ...@@ -54,8 +54,13 @@ mwifiex_11n_dispatch_pkt(struct mwifiex_private *priv,
tbl->rx_reorder_ptr[i] = NULL; tbl->rx_reorder_ptr[i] = NULL;
} }
spin_unlock_irqrestore(&priv->rx_pkt_lock, flags); spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
if (rx_tmp_ptr) if (rx_tmp_ptr) {
mwifiex_process_rx_packet(priv->adapter, rx_tmp_ptr); if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
mwifiex_handle_uap_rx_forward(priv, rx_tmp_ptr);
else
mwifiex_process_rx_packet(priv->adapter,
rx_tmp_ptr);
}
} }
spin_lock_irqsave(&priv->rx_pkt_lock, flags); spin_lock_irqsave(&priv->rx_pkt_lock, flags);
...@@ -97,7 +102,11 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv, ...@@ -97,7 +102,11 @@ mwifiex_11n_scan_and_dispatch(struct mwifiex_private *priv,
rx_tmp_ptr = tbl->rx_reorder_ptr[i]; rx_tmp_ptr = tbl->rx_reorder_ptr[i];
tbl->rx_reorder_ptr[i] = NULL; tbl->rx_reorder_ptr[i] = NULL;
spin_unlock_irqrestore(&priv->rx_pkt_lock, flags); spin_unlock_irqrestore(&priv->rx_pkt_lock, flags);
mwifiex_process_rx_packet(priv->adapter, rx_tmp_ptr);
if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
mwifiex_handle_uap_rx_forward(priv, rx_tmp_ptr);
else
mwifiex_process_rx_packet(priv->adapter, rx_tmp_ptr);
} }
spin_lock_irqsave(&priv->rx_pkt_lock, flags); spin_lock_irqsave(&priv->rx_pkt_lock, flags);
...@@ -148,7 +157,7 @@ mwifiex_del_rx_reorder_entry(struct mwifiex_private *priv, ...@@ -148,7 +157,7 @@ mwifiex_del_rx_reorder_entry(struct mwifiex_private *priv,
* This function returns the pointer to an entry in Rx reordering * This function returns the pointer to an entry in Rx reordering
* table which matches the given TA/TID pair. * table which matches the given TA/TID pair.
*/ */
static struct mwifiex_rx_reorder_tbl * struct mwifiex_rx_reorder_tbl *
mwifiex_11n_get_rx_reorder_tbl(struct mwifiex_private *priv, int tid, u8 *ta) mwifiex_11n_get_rx_reorder_tbl(struct mwifiex_private *priv, int tid, u8 *ta)
{ {
struct mwifiex_rx_reorder_tbl *tbl; struct mwifiex_rx_reorder_tbl *tbl;
...@@ -167,6 +176,31 @@ mwifiex_11n_get_rx_reorder_tbl(struct mwifiex_private *priv, int tid, u8 *ta) ...@@ -167,6 +176,31 @@ mwifiex_11n_get_rx_reorder_tbl(struct mwifiex_private *priv, int tid, u8 *ta)
return NULL; return NULL;
} }
/* This function retrieves the pointer to an entry in Rx reordering
* table which matches the given TA and deletes it.
*/
void mwifiex_11n_del_rx_reorder_tbl_by_ta(struct mwifiex_private *priv, u8 *ta)
{
struct mwifiex_rx_reorder_tbl *tbl, *tmp;
unsigned long flags;
if (!ta)
return;
spin_lock_irqsave(&priv->rx_reorder_tbl_lock, flags);
list_for_each_entry_safe(tbl, tmp, &priv->rx_reorder_tbl_ptr, list) {
if (!memcmp(tbl->ta, ta, ETH_ALEN)) {
spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock,
flags);
mwifiex_del_rx_reorder_entry(priv, tbl);
spin_lock_irqsave(&priv->rx_reorder_tbl_lock, flags);
}
}
spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags);
return;
}
/* /*
* This function finds the last sequence number used in the packets * This function finds the last sequence number used in the packets
* buffered in Rx reordering table. * buffered in Rx reordering table.
...@@ -226,6 +260,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta, ...@@ -226,6 +260,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
struct mwifiex_rx_reorder_tbl *tbl, *new_node; struct mwifiex_rx_reorder_tbl *tbl, *new_node;
u16 last_seq = 0; u16 last_seq = 0;
unsigned long flags; unsigned long flags;
struct mwifiex_sta_node *node;
/* /*
* If we get a TID, ta pair which is already present dispatch all the * If we get a TID, ta pair which is already present dispatch all the
...@@ -248,13 +283,19 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta, ...@@ -248,13 +283,19 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
new_node->tid = tid; new_node->tid = tid;
memcpy(new_node->ta, ta, ETH_ALEN); memcpy(new_node->ta, ta, ETH_ALEN);
new_node->start_win = seq_num; new_node->start_win = seq_num;
if (mwifiex_queuing_ra_based(priv))
/* TODO for adhoc */ if (mwifiex_queuing_ra_based(priv)) {
dev_dbg(priv->adapter->dev, dev_dbg(priv->adapter->dev,
"info: ADHOC:last_seq=%d start_win=%d\n", "info: AP/ADHOC:last_seq=%d start_win=%d\n",
last_seq, new_node->start_win); last_seq, new_node->start_win);
else if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP) {
node = mwifiex_get_sta_entry(priv, ta);
if (node)
last_seq = node->rx_seq[tid];
}
} else {
last_seq = priv->rx_seq[tid]; last_seq = priv->rx_seq[tid];
}
if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM && if (last_seq != MWIFIEX_DEF_11N_RX_SEQ_NUM &&
last_seq >= new_node->start_win) last_seq >= new_node->start_win)
...@@ -396,8 +437,13 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv, ...@@ -396,8 +437,13 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta); tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta);
if (!tbl) { if (!tbl) {
if (pkt_type != PKT_TYPE_BAR) if (pkt_type != PKT_TYPE_BAR) {
mwifiex_process_rx_packet(priv->adapter, payload); if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
mwifiex_handle_uap_rx_forward(priv, payload);
else
mwifiex_process_rx_packet(priv->adapter,
payload);
}
return 0; return 0;
} }
start_win = tbl->start_win; start_win = tbl->start_win;
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#define ADDBA_RSP_STATUS_ACCEPT 0 #define ADDBA_RSP_STATUS_ACCEPT 0
#define MWIFIEX_DEF_11N_RX_SEQ_NUM 0xffff #define MWIFIEX_DEF_11N_RX_SEQ_NUM 0xffff
#define BA_SETUP_MAX_PACKET_THRESHOLD 16
#define BA_SETUP_PACKET_OFFSET 16
static inline void mwifiex_reset_11n_rx_seq_num(struct mwifiex_private *priv) static inline void mwifiex_reset_11n_rx_seq_num(struct mwifiex_private *priv)
{ {
...@@ -68,5 +70,8 @@ struct mwifiex_rx_reorder_tbl *mwifiex_11n_get_rxreorder_tbl(struct ...@@ -68,5 +70,8 @@ struct mwifiex_rx_reorder_tbl *mwifiex_11n_get_rxreorder_tbl(struct
mwifiex_private mwifiex_private
*priv, int tid, *priv, int tid,
u8 *ta); u8 *ta);
struct mwifiex_rx_reorder_tbl *
mwifiex_11n_get_rx_reorder_tbl(struct mwifiex_private *priv, int tid, u8 *ta);
void mwifiex_11n_del_rx_reorder_tbl_by_ta(struct mwifiex_private *priv, u8 *ta);
#endif /* _MWIFIEX_11N_RXREORDER_H_ */ #endif /* _MWIFIEX_11N_RXREORDER_H_ */
...@@ -33,8 +33,10 @@ mwifiex-y += uap_cmd.o ...@@ -33,8 +33,10 @@ mwifiex-y += uap_cmd.o
mwifiex-y += ie.o mwifiex-y += ie.o
mwifiex-y += sta_cmdresp.o mwifiex-y += sta_cmdresp.o
mwifiex-y += sta_event.o mwifiex-y += sta_event.o
mwifiex-y += uap_event.o
mwifiex-y += sta_tx.o mwifiex-y += sta_tx.o
mwifiex-y += sta_rx.o mwifiex-y += sta_rx.o
mwifiex-y += uap_txrx.o
mwifiex-y += cfg80211.o mwifiex-y += cfg80211.o
mwifiex-$(CONFIG_DEBUG_FS) += debugfs.o mwifiex-$(CONFIG_DEBUG_FS) += debugfs.o
obj-$(CONFIG_MWIFIEX) += mwifiex.o obj-$(CONFIG_MWIFIEX) += mwifiex.o
......
...@@ -99,7 +99,7 @@ mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -99,7 +99,7 @@ mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const u8 *peer_mac = pairwise ? mac_addr : bc_mac; const u8 *peer_mac = pairwise ? mac_addr : bc_mac;
if (mwifiex_set_encode(priv, NULL, 0, key_index, peer_mac, 1)) { if (mwifiex_set_encode(priv, NULL, NULL, 0, key_index, peer_mac, 1)) {
wiphy_err(wiphy, "deleting the crypto keys\n"); wiphy_err(wiphy, "deleting the crypto keys\n");
return -EFAULT; return -EFAULT;
} }
...@@ -171,7 +171,8 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -171,7 +171,8 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev,
if (priv->bss_type == MWIFIEX_BSS_TYPE_UAP) { if (priv->bss_type == MWIFIEX_BSS_TYPE_UAP) {
priv->wep_key_curr_index = key_index; priv->wep_key_curr_index = key_index;
} else if (mwifiex_set_encode(priv, NULL, 0, key_index, NULL, 0)) { } else if (mwifiex_set_encode(priv, NULL, NULL, 0, key_index,
NULL, 0)) {
wiphy_err(wiphy, "set default Tx key index\n"); wiphy_err(wiphy, "set default Tx key index\n");
return -EFAULT; return -EFAULT;
} }
...@@ -207,7 +208,7 @@ mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -207,7 +208,7 @@ mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
return 0; return 0;
} }
if (mwifiex_set_encode(priv, params->key, params->key_len, if (mwifiex_set_encode(priv, params, params->key, params->key_len,
key_index, peer_mac, 0)) { key_index, peer_mac, 0)) {
wiphy_err(wiphy, "crypto keys added\n"); wiphy_err(wiphy, "crypto keys added\n");
return -EFAULT; return -EFAULT;
...@@ -748,6 +749,7 @@ static const u32 mwifiex_cipher_suites[] = { ...@@ -748,6 +749,7 @@ static const u32 mwifiex_cipher_suites[] = {
WLAN_CIPHER_SUITE_WEP104, WLAN_CIPHER_SUITE_WEP104,
WLAN_CIPHER_SUITE_TKIP, WLAN_CIPHER_SUITE_TKIP,
WLAN_CIPHER_SUITE_CCMP, WLAN_CIPHER_SUITE_CCMP,
WLAN_CIPHER_SUITE_AES_CMAC,
}; };
/* /*
...@@ -906,6 +908,8 @@ static int mwifiex_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) ...@@ -906,6 +908,8 @@ static int mwifiex_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
if (mwifiex_del_mgmt_ies(priv)) if (mwifiex_del_mgmt_ies(priv))
wiphy_err(wiphy, "Failed to delete mgmt IEs!\n"); wiphy_err(wiphy, "Failed to delete mgmt IEs!\n");
priv->ap_11n_enabled = 0;
if (mwifiex_send_cmd_sync(priv, HostCmd_CMD_UAP_BSS_STOP, if (mwifiex_send_cmd_sync(priv, HostCmd_CMD_UAP_BSS_STOP,
HostCmd_ACT_GEN_SET, 0, NULL)) { HostCmd_ACT_GEN_SET, 0, NULL)) {
wiphy_err(wiphy, "Failed to stop the BSS\n"); wiphy_err(wiphy, "Failed to stop the BSS\n");
...@@ -1159,7 +1163,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, ...@@ -1159,7 +1163,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
priv->wep_key_curr_index = 0; priv->wep_key_curr_index = 0;
priv->sec_info.encryption_mode = 0; priv->sec_info.encryption_mode = 0;
priv->sec_info.is_authtype_auto = 0; priv->sec_info.is_authtype_auto = 0;
ret = mwifiex_set_encode(priv, NULL, 0, 0, NULL, 1); ret = mwifiex_set_encode(priv, NULL, NULL, 0, 0, NULL, 1);
if (mode == NL80211_IFTYPE_ADHOC) { if (mode == NL80211_IFTYPE_ADHOC) {
/* "privacy" is set only for ad-hoc mode */ /* "privacy" is set only for ad-hoc mode */
...@@ -1206,8 +1210,9 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid, ...@@ -1206,8 +1210,9 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
"info: setting wep encryption" "info: setting wep encryption"
" with key len %d\n", sme->key_len); " with key len %d\n", sme->key_len);
priv->wep_key_curr_index = sme->key_idx; priv->wep_key_curr_index = sme->key_idx;
ret = mwifiex_set_encode(priv, sme->key, sme->key_len, ret = mwifiex_set_encode(priv, NULL, sme->key,
sme->key_idx, NULL, 0); sme->key_len, sme->key_idx,
NULL, 0);
} }
} }
done: done:
......
...@@ -447,7 +447,10 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter) ...@@ -447,7 +447,10 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
} }
ret = mwifiex_process_sta_event(priv); if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
ret = mwifiex_process_uap_event(priv);
else
ret = mwifiex_process_sta_event(priv);
adapter->event_cause = 0; adapter->event_cause = 0;
adapter->event_skb = NULL; adapter->event_skb = NULL;
......
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
#define MWIFIEX_SDIO_BLOCK_SIZE 256 #define MWIFIEX_SDIO_BLOCK_SIZE 256
#define MWIFIEX_BUF_FLAG_REQUEUED_PKT BIT(0) #define MWIFIEX_BUF_FLAG_REQUEUED_PKT BIT(0)
#define MWIFIEX_BUF_FLAG_BRIDGED_PKT BIT(1)
#define MWIFIEX_BRIDGED_PKTS_THRESHOLD 1024
enum mwifiex_bss_type { enum mwifiex_bss_type {
MWIFIEX_BSS_TYPE_STA = 0, MWIFIEX_BSS_TYPE_STA = 0,
......
...@@ -65,10 +65,12 @@ enum KEY_TYPE_ID { ...@@ -65,10 +65,12 @@ enum KEY_TYPE_ID {
KEY_TYPE_ID_TKIP, KEY_TYPE_ID_TKIP,
KEY_TYPE_ID_AES, KEY_TYPE_ID_AES,
KEY_TYPE_ID_WAPI, KEY_TYPE_ID_WAPI,
KEY_TYPE_ID_AES_CMAC,
}; };
#define KEY_MCAST BIT(0) #define KEY_MCAST BIT(0)
#define KEY_UNICAST BIT(1) #define KEY_UNICAST BIT(1)
#define KEY_ENABLED BIT(2) #define KEY_ENABLED BIT(2)
#define KEY_IGTK BIT(10)
#define WAPI_KEY_LEN 50 #define WAPI_KEY_LEN 50
...@@ -424,10 +426,10 @@ struct txpd { ...@@ -424,10 +426,10 @@ struct txpd {
struct rxpd { struct rxpd {
u8 bss_type; u8 bss_type;
u8 bss_num; u8 bss_num;
u16 rx_pkt_length; __le16 rx_pkt_length;
u16 rx_pkt_offset; __le16 rx_pkt_offset;
u16 rx_pkt_type; __le16 rx_pkt_type;
u16 seq_num; __le16 seq_num;
u8 priority; u8 priority;
u8 rx_rate; u8 rx_rate;
s8 snr; s8 snr;
...@@ -439,6 +441,31 @@ struct rxpd { ...@@ -439,6 +441,31 @@ struct rxpd {
u8 reserved; u8 reserved;
} __packed; } __packed;
struct uap_txpd {
u8 bss_type;
u8 bss_num;
__le16 tx_pkt_length;
__le16 tx_pkt_offset;
__le16 tx_pkt_type;
__le32 tx_control;
u8 priority;
u8 flags;
u8 pkt_delay_2ms;
u8 reserved1;
__le32 reserved2;
};
struct uap_rxpd {
u8 bss_type;
u8 bss_num;
__le16 rx_pkt_length;
__le16 rx_pkt_offset;
__le16 rx_pkt_type;
__le16 seq_num;
u8 priority;
u8 reserved1;
};
enum mwifiex_chan_scan_mode_bitmasks { enum mwifiex_chan_scan_mode_bitmasks {
MWIFIEX_PASSIVE_SCAN = BIT(0), MWIFIEX_PASSIVE_SCAN = BIT(0),
MWIFIEX_DISABLE_CHAN_FILT = BIT(1), MWIFIEX_DISABLE_CHAN_FILT = BIT(1),
...@@ -558,6 +585,13 @@ struct mwifiex_ie_type_key_param_set { ...@@ -558,6 +585,13 @@ struct mwifiex_ie_type_key_param_set {
u8 key[50]; u8 key[50];
} __packed; } __packed;
#define IGTK_PN_LEN 8
struct mwifiex_cmac_param {
u8 ipn[IGTK_PN_LEN];
u8 key[WLAN_KEY_LEN_AES_CMAC];
} __packed;
struct host_cmd_ds_802_11_key_material { struct host_cmd_ds_802_11_key_material {
__le16 action; __le16 action;
struct mwifiex_ie_type_key_param_set key_param_set; struct mwifiex_ie_type_key_param_set key_param_set;
......
...@@ -64,60 +64,72 @@ static void scan_delay_timer_fn(unsigned long data) ...@@ -64,60 +64,72 @@ static void scan_delay_timer_fn(unsigned long data)
struct cmd_ctrl_node *cmd_node, *tmp_node; struct cmd_ctrl_node *cmd_node, *tmp_node;
unsigned long flags; unsigned long flags;
if (!mwifiex_wmm_lists_empty(adapter)) { if (adapter->scan_delay_cnt == MWIFIEX_MAX_SCAN_DELAY_CNT) {
if (adapter->scan_delay_cnt == MWIFIEX_MAX_SCAN_DELAY_CNT) { /*
* Abort scan operation by cancelling all pending scan
* commands
*/
spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
list_for_each_entry_safe(cmd_node, tmp_node,
&adapter->scan_pending_q, list) {
list_del(&cmd_node->list);
cmd_node->wait_q_enabled = false;
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
}
spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags);
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
adapter->scan_processing = false;
adapter->scan_delay_cnt = 0;
adapter->empty_tx_q_cnt = 0;
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
if (priv->user_scan_cfg) {
dev_dbg(priv->adapter->dev,
"info: %s: scan aborted\n", __func__);
cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL;
kfree(priv->user_scan_cfg);
priv->user_scan_cfg = NULL;
}
goto done;
}
if (!atomic_read(&priv->adapter->is_tx_received)) {
adapter->empty_tx_q_cnt++;
if (adapter->empty_tx_q_cnt == MWIFIEX_MAX_EMPTY_TX_Q_CNT) {
/* /*
* Abort scan operation by cancelling all pending scan * No Tx traffic for 200msec. Get scan command from
* command * scan pending queue and put to cmd pending queue to
* resume scan operation
*/ */
adapter->scan_delay_cnt = 0;
adapter->empty_tx_q_cnt = 0;
spin_lock_irqsave(&adapter->scan_pending_q_lock, flags); spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
list_for_each_entry_safe(cmd_node, tmp_node, cmd_node = list_first_entry(&adapter->scan_pending_q,
&adapter->scan_pending_q, struct cmd_ctrl_node, list);
list) { list_del(&cmd_node->list);
list_del(&cmd_node->list);
cmd_node->wait_q_enabled = false;
mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
}
spin_unlock_irqrestore(&adapter->scan_pending_q_lock, spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
flags); flags);
spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); mwifiex_insert_cmd_to_pending_q(adapter, cmd_node,
adapter->scan_processing = false; true);
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, goto done;
flags);
if (priv->user_scan_cfg) {
dev_dbg(priv->adapter->dev,
"info: %s: scan aborted\n", __func__);
cfg80211_scan_done(priv->scan_request, 1);
priv->scan_request = NULL;
kfree(priv->user_scan_cfg);
priv->user_scan_cfg = NULL;
}
} else {
/*
* Tx data queue is still not empty, delay scan
* operation further by 20msec.
*/
mod_timer(&priv->scan_delay_timer, jiffies +
msecs_to_jiffies(MWIFIEX_SCAN_DELAY_MSEC));
adapter->scan_delay_cnt++;
} }
queue_work(priv->adapter->workqueue, &priv->adapter->main_work);
} else { } else {
/* adapter->empty_tx_q_cnt = 0;
* Tx data queue is empty. Get scan command from scan_pending_q
* and put to cmd_pending_q to resume scan operation
*/
adapter->scan_delay_cnt = 0;
spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
cmd_node = list_first_entry(&adapter->scan_pending_q,
struct cmd_ctrl_node, list);
list_del(&cmd_node->list);
spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags);
mwifiex_insert_cmd_to_pending_q(adapter, cmd_node, true);
} }
/* Delay scan operation further by 20msec */
mod_timer(&priv->scan_delay_timer, jiffies +
msecs_to_jiffies(MWIFIEX_SCAN_DELAY_MSEC));
adapter->scan_delay_cnt++;
done:
if (atomic_read(&priv->adapter->is_tx_received))
atomic_set(&priv->adapter->is_tx_received, false);
return;
} }
/* /*
...@@ -196,6 +208,7 @@ static int mwifiex_init_priv(struct mwifiex_private *priv) ...@@ -196,6 +208,7 @@ static int mwifiex_init_priv(struct mwifiex_private *priv)
priv->curr_bcn_size = 0; priv->curr_bcn_size = 0;
priv->wps_ie = NULL; priv->wps_ie = NULL;
priv->wps_ie_len = 0; priv->wps_ie_len = 0;
priv->ap_11n_enabled = 0;
priv->scan_block = false; priv->scan_block = false;
...@@ -345,6 +358,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) ...@@ -345,6 +358,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter)); memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter));
adapter->arp_filter_size = 0; adapter->arp_filter_size = 0;
adapter->max_mgmt_ie_index = MAX_MGMT_IE_INDEX; adapter->max_mgmt_ie_index = MAX_MGMT_IE_INDEX;
adapter->empty_tx_q_cnt = 0;
} }
/* /*
...@@ -410,6 +424,7 @@ static void mwifiex_free_lock_list(struct mwifiex_adapter *adapter) ...@@ -410,6 +424,7 @@ static void mwifiex_free_lock_list(struct mwifiex_adapter *adapter)
list_del(&priv->wmm.tid_tbl_ptr[j].ra_list); list_del(&priv->wmm.tid_tbl_ptr[j].ra_list);
list_del(&priv->tx_ba_stream_tbl_ptr); list_del(&priv->tx_ba_stream_tbl_ptr);
list_del(&priv->rx_reorder_tbl_ptr); list_del(&priv->rx_reorder_tbl_ptr);
list_del(&priv->sta_list);
} }
} }
} }
...@@ -472,6 +487,7 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) ...@@ -472,6 +487,7 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
spin_lock_init(&priv->rx_pkt_lock); spin_lock_init(&priv->rx_pkt_lock);
spin_lock_init(&priv->wmm.ra_list_spinlock); spin_lock_init(&priv->wmm.ra_list_spinlock);
spin_lock_init(&priv->curr_bcn_buf_lock); spin_lock_init(&priv->curr_bcn_buf_lock);
spin_lock_init(&priv->sta_list_spinlock);
} }
} }
...@@ -504,6 +520,7 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) ...@@ -504,6 +520,7 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter)
} }
INIT_LIST_HEAD(&priv->tx_ba_stream_tbl_ptr); INIT_LIST_HEAD(&priv->tx_ba_stream_tbl_ptr);
INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr); INIT_LIST_HEAD(&priv->rx_reorder_tbl_ptr);
INIT_LIST_HEAD(&priv->sta_list);
spin_lock_init(&priv->tx_ba_stream_tbl_lock); spin_lock_init(&priv->tx_ba_stream_tbl_lock);
spin_lock_init(&priv->rx_reorder_tbl_lock); spin_lock_init(&priv->rx_reorder_tbl_lock);
......
...@@ -213,7 +213,7 @@ struct mwifiex_debug_info { ...@@ -213,7 +213,7 @@ struct mwifiex_debug_info {
}; };
#define MWIFIEX_KEY_INDEX_UNICAST 0x40000000 #define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
#define WAPI_RXPN_LEN 16 #define PN_LEN 16
struct mwifiex_ds_encrypt_key { struct mwifiex_ds_encrypt_key {
u32 key_disable; u32 key_disable;
...@@ -222,7 +222,8 @@ struct mwifiex_ds_encrypt_key { ...@@ -222,7 +222,8 @@ struct mwifiex_ds_encrypt_key {
u8 key_material[WLAN_MAX_KEY_LEN]; u8 key_material[WLAN_MAX_KEY_LEN];
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
u32 is_wapi_key; u32 is_wapi_key;
u8 wapi_rxpn[WAPI_RXPN_LEN]; u8 pn[PN_LEN]; /* packet number */
u8 is_igtk_key;
}; };
struct mwifiex_power_cfg { struct mwifiex_power_cfg {
......
...@@ -520,6 +520,9 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -520,6 +520,9 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
mwifiex_wmm_add_buf_txqueue(priv, skb); mwifiex_wmm_add_buf_txqueue(priv, skb);
atomic_inc(&priv->adapter->tx_pending); atomic_inc(&priv->adapter->tx_pending);
if (priv->adapter->scan_delay_cnt)
atomic_set(&priv->adapter->is_tx_received, true);
if (atomic_read(&priv->adapter->tx_pending) >= MAX_TX_PENDING) { if (atomic_read(&priv->adapter->tx_pending) >= MAX_TX_PENDING) {
mwifiex_set_trans_start(dev); mwifiex_set_trans_start(dev);
mwifiex_stop_net_dev_queue(priv->netdev, priv->adapter); mwifiex_stop_net_dev_queue(priv->netdev, priv->adapter);
......
...@@ -88,6 +88,7 @@ enum { ...@@ -88,6 +88,7 @@ enum {
#define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S) #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S)
#define MWIFIEX_MAX_SCAN_DELAY_CNT 50 #define MWIFIEX_MAX_SCAN_DELAY_CNT 50
#define MWIFIEX_MAX_EMPTY_TX_Q_CNT 10
#define MWIFIEX_SCAN_DELAY_MSEC 20 #define MWIFIEX_SCAN_DELAY_MSEC 20
#define RSN_GTK_OUI_OFFSET 2 #define RSN_GTK_OUI_OFFSET 2
...@@ -199,6 +200,9 @@ struct mwifiex_ra_list_tbl { ...@@ -199,6 +200,9 @@ struct mwifiex_ra_list_tbl {
u8 ra[ETH_ALEN]; u8 ra[ETH_ALEN];
u32 total_pkts_size; u32 total_pkts_size;
u32 is_11n_enabled; u32 is_11n_enabled;
u16 max_amsdu;
u16 pkt_count;
u8 ba_packet_thr;
}; };
struct mwifiex_tid_tbl { struct mwifiex_tid_tbl {
...@@ -431,6 +435,9 @@ struct mwifiex_private { ...@@ -431,6 +435,9 @@ struct mwifiex_private {
u8 wmm_enabled; u8 wmm_enabled;
u8 wmm_qosinfo; u8 wmm_qosinfo;
struct mwifiex_wmm_desc wmm; struct mwifiex_wmm_desc wmm;
struct list_head sta_list;
/* spin lock for associated station list */
spinlock_t sta_list_spinlock;
struct list_head tx_ba_stream_tbl_ptr; struct list_head tx_ba_stream_tbl_ptr;
/* spin lock for tx_ba_stream_tbl_ptr queue */ /* spin lock for tx_ba_stream_tbl_ptr queue */
spinlock_t tx_ba_stream_tbl_lock; spinlock_t tx_ba_stream_tbl_lock;
...@@ -486,6 +493,7 @@ struct mwifiex_private { ...@@ -486,6 +493,7 @@ struct mwifiex_private {
u16 assocresp_idx; u16 assocresp_idx;
u16 rsn_idx; u16 rsn_idx;
struct timer_list scan_delay_timer; struct timer_list scan_delay_timer;
u8 ap_11n_enabled;
}; };
enum mwifiex_ba_status { enum mwifiex_ba_status {
...@@ -550,6 +558,19 @@ struct mwifiex_bss_priv { ...@@ -550,6 +558,19 @@ struct mwifiex_bss_priv {
u64 fw_tsf; u64 fw_tsf;
}; };
/* This is AP specific structure which stores information
* about associated STA
*/
struct mwifiex_sta_node {
struct list_head list;
u8 mac_addr[ETH_ALEN];
u8 is_wmm_enabled;
u8 is_11n_enabled;
u8 ampdu_sta[MAX_NUM_TID];
u16 rx_seq[MAX_NUM_TID];
u16 max_amsdu;
};
struct mwifiex_if_ops { struct mwifiex_if_ops {
int (*init_if) (struct mwifiex_adapter *); int (*init_if) (struct mwifiex_adapter *);
void (*cleanup_if) (struct mwifiex_adapter *); void (*cleanup_if) (struct mwifiex_adapter *);
...@@ -690,6 +711,9 @@ struct mwifiex_adapter { ...@@ -690,6 +711,9 @@ struct mwifiex_adapter {
u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
u16 max_mgmt_ie_index; u16 max_mgmt_ie_index;
u8 scan_delay_cnt; u8 scan_delay_cnt;
u8 empty_tx_q_cnt;
atomic_t is_tx_received;
atomic_t pending_bridged_pkts;
}; };
int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); int mwifiex_init_lock_list(struct mwifiex_adapter *adapter);
...@@ -780,7 +804,15 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no, ...@@ -780,7 +804,15 @@ int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no,
struct host_cmd_ds_command *resp); struct host_cmd_ds_command *resp);
int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *, int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *,
struct sk_buff *skb); struct sk_buff *skb);
int mwifiex_process_uap_rx_packet(struct mwifiex_adapter *adapter,
struct sk_buff *skb);
int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
struct sk_buff *skb);
int mwifiex_process_sta_event(struct mwifiex_private *); int mwifiex_process_sta_event(struct mwifiex_private *);
int mwifiex_process_uap_event(struct mwifiex_private *);
struct mwifiex_sta_node *
mwifiex_get_sta_entry(struct mwifiex_private *priv, u8 *mac);
void mwifiex_delete_all_station_list(struct mwifiex_private *priv);
void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb); void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb);
int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta); int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta);
int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd, int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
...@@ -949,9 +981,9 @@ int mwifiex_scan_networks(struct mwifiex_private *priv, ...@@ -949,9 +981,9 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
const struct mwifiex_user_scan_cfg *user_scan_in); const struct mwifiex_user_scan_cfg *user_scan_in);
int mwifiex_set_radio(struct mwifiex_private *priv, u8 option); int mwifiex_set_radio(struct mwifiex_private *priv, u8 option);
int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp,
int key_len, u8 key_index, const u8 *mac_addr, const u8 *key, int key_len, u8 key_index,
int disable); const u8 *mac_addr, int disable);
int mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len); int mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len);
......
...@@ -989,6 +989,8 @@ mwifiex_config_scan(struct mwifiex_private *priv, ...@@ -989,6 +989,8 @@ mwifiex_config_scan(struct mwifiex_private *priv,
*max_chan_per_scan = 2; *max_chan_per_scan = 2;
else if (chan_num < MWIFIEX_LIMIT_3_CHANNELS_PER_SCAN_CMD) else if (chan_num < MWIFIEX_LIMIT_3_CHANNELS_PER_SCAN_CMD)
*max_chan_per_scan = 3; *max_chan_per_scan = 3;
else
*max_chan_per_scan = 4;
} }
} }
...@@ -1433,9 +1435,9 @@ int mwifiex_check_network_compatibility(struct mwifiex_private *priv, ...@@ -1433,9 +1435,9 @@ int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
if (ret) if (ret)
dev_err(priv->adapter->dev, "cannot find ssid " dev_err(priv->adapter->dev, "cannot find ssid "
"%s\n", bss_desc->ssid.ssid); "%s\n", bss_desc->ssid.ssid);
break; break;
default: default:
ret = 0; ret = 0;
} }
} }
......
...@@ -610,7 +610,7 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, ...@@ -610,7 +610,7 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
memcpy(&key_material->key_param_set.key[2], memcpy(&key_material->key_param_set.key[2],
enc_key->key_material, enc_key->key_len); enc_key->key_material, enc_key->key_len);
memcpy(&key_material->key_param_set.key[2 + enc_key->key_len], memcpy(&key_material->key_param_set.key[2 + enc_key->key_len],
enc_key->wapi_rxpn, WAPI_RXPN_LEN); enc_key->pn, PN_LEN);
key_material->key_param_set.length = key_material->key_param_set.length =
cpu_to_le16(WAPI_KEY_LEN + KEYPARAMSET_FIXED_LEN); cpu_to_le16(WAPI_KEY_LEN + KEYPARAMSET_FIXED_LEN);
...@@ -621,23 +621,38 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, ...@@ -621,23 +621,38 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
return ret; return ret;
} }
if (enc_key->key_len == WLAN_KEY_LEN_CCMP) { if (enc_key->key_len == WLAN_KEY_LEN_CCMP) {
dev_dbg(priv->adapter->dev, "cmd: WPA_AES\n"); if (enc_key->is_igtk_key) {
key_material->key_param_set.key_type_id = dev_dbg(priv->adapter->dev, "cmd: CMAC_AES\n");
key_material->key_param_set.key_type_id =
cpu_to_le16(KEY_TYPE_ID_AES_CMAC);
if (cmd_oid == KEY_INFO_ENABLED)
key_material->key_param_set.key_info =
cpu_to_le16(KEY_ENABLED);
else
key_material->key_param_set.key_info =
cpu_to_le16(!KEY_ENABLED);
key_material->key_param_set.key_info |=
cpu_to_le16(KEY_IGTK);
} else {
dev_dbg(priv->adapter->dev, "cmd: WPA_AES\n");
key_material->key_param_set.key_type_id =
cpu_to_le16(KEY_TYPE_ID_AES); cpu_to_le16(KEY_TYPE_ID_AES);
if (cmd_oid == KEY_INFO_ENABLED) if (cmd_oid == KEY_INFO_ENABLED)
key_material->key_param_set.key_info = key_material->key_param_set.key_info =
cpu_to_le16(KEY_ENABLED); cpu_to_le16(KEY_ENABLED);
else else
key_material->key_param_set.key_info = key_material->key_param_set.key_info =
cpu_to_le16(!KEY_ENABLED); cpu_to_le16(!KEY_ENABLED);
if (enc_key->key_index & MWIFIEX_KEY_INDEX_UNICAST) if (enc_key->key_index & MWIFIEX_KEY_INDEX_UNICAST)
/* AES pairwise key: unicast */ /* AES pairwise key: unicast */
key_material->key_param_set.key_info |= key_material->key_param_set.key_info |=
cpu_to_le16(KEY_UNICAST); cpu_to_le16(KEY_UNICAST);
else /* AES group key: multicast */ else /* AES group key: multicast */
key_material->key_param_set.key_info |= key_material->key_param_set.key_info |=
cpu_to_le16(KEY_MCAST); cpu_to_le16(KEY_MCAST);
}
} else if (enc_key->key_len == WLAN_KEY_LEN_TKIP) { } else if (enc_key->key_len == WLAN_KEY_LEN_TKIP) {
dev_dbg(priv->adapter->dev, "cmd: WPA_TKIP\n"); dev_dbg(priv->adapter->dev, "cmd: WPA_TKIP\n");
key_material->key_param_set.key_type_id = key_material->key_param_set.key_type_id =
...@@ -668,6 +683,24 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, ...@@ -668,6 +683,24 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
key_param_len = (u16)(enc_key->key_len + KEYPARAMSET_FIXED_LEN) key_param_len = (u16)(enc_key->key_len + KEYPARAMSET_FIXED_LEN)
+ sizeof(struct mwifiex_ie_types_header); + sizeof(struct mwifiex_ie_types_header);
if (le16_to_cpu(key_material->key_param_set.key_type_id) ==
KEY_TYPE_ID_AES_CMAC) {
struct mwifiex_cmac_param *param =
(void *)key_material->key_param_set.key;
memcpy(param->ipn, enc_key->pn, IGTK_PN_LEN);
memcpy(param->key, enc_key->key_material,
WLAN_KEY_LEN_AES_CMAC);
key_param_len = sizeof(struct mwifiex_cmac_param);
key_material->key_param_set.key_len =
cpu_to_le16(key_param_len);
key_param_len += KEYPARAMSET_FIXED_LEN;
key_material->key_param_set.length =
cpu_to_le16(key_param_len);
key_param_len += sizeof(struct mwifiex_ie_types_header);
}
cmd->size = cpu_to_le16(sizeof(key_material->action) + S_DS_GEN cmd->size = cpu_to_le16(sizeof(key_material->action) + S_DS_GEN
+ key_param_len); + key_param_len);
......
...@@ -184,10 +184,9 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv) ...@@ -184,10 +184,9 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv)
int mwifiex_process_sta_event(struct mwifiex_private *priv) int mwifiex_process_sta_event(struct mwifiex_private *priv)
{ {
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
int len, ret = 0; int ret = 0;
u32 eventcause = adapter->event_cause; u32 eventcause = adapter->event_cause;
struct station_info sinfo; u16 ctrl;
struct mwifiex_assoc_event *event;
switch (eventcause) { switch (eventcause) {
case EVENT_DUMMY_HOST_WAKEUP_SIGNAL: case EVENT_DUMMY_HOST_WAKEUP_SIGNAL:
...@@ -279,10 +278,16 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) ...@@ -279,10 +278,16 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
case EVENT_MIC_ERR_UNICAST: case EVENT_MIC_ERR_UNICAST:
dev_dbg(adapter->dev, "event: UNICAST MIC ERROR\n"); dev_dbg(adapter->dev, "event: UNICAST MIC ERROR\n");
cfg80211_michael_mic_failure(priv->netdev, priv->cfg_bssid,
NL80211_KEYTYPE_PAIRWISE,
-1, NULL, GFP_KERNEL);
break; break;
case EVENT_MIC_ERR_MULTICAST: case EVENT_MIC_ERR_MULTICAST:
dev_dbg(adapter->dev, "event: MULTICAST MIC ERROR\n"); dev_dbg(adapter->dev, "event: MULTICAST MIC ERROR\n");
cfg80211_michael_mic_failure(priv->netdev, priv->cfg_bssid,
NL80211_KEYTYPE_GROUP,
-1, NULL, GFP_KERNEL);
break; break;
case EVENT_MIB_CHANGED: case EVENT_MIB_CHANGED:
case EVENT_INIT_DONE: case EVENT_INIT_DONE:
...@@ -384,11 +389,11 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) ...@@ -384,11 +389,11 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
adapter->event_body); adapter->event_body);
break; break;
case EVENT_AMSDU_AGGR_CTRL: case EVENT_AMSDU_AGGR_CTRL:
dev_dbg(adapter->dev, "event: AMSDU_AGGR_CTRL %d\n", ctrl = le16_to_cpu(*(__le16 *)adapter->event_body);
*(u16 *) adapter->event_body); dev_dbg(adapter->dev, "event: AMSDU_AGGR_CTRL %d\n", ctrl);
adapter->tx_buf_size = adapter->tx_buf_size =
min(adapter->curr_tx_buf_size, min_t(u16, adapter->curr_tx_buf_size, ctrl);
le16_to_cpu(*(__le16 *) adapter->event_body));
dev_dbg(adapter->dev, "event: tx_buf_size %d\n", dev_dbg(adapter->dev, "event: tx_buf_size %d\n",
adapter->tx_buf_size); adapter->tx_buf_size);
break; break;
...@@ -405,51 +410,6 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv) ...@@ -405,51 +410,6 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
dev_dbg(adapter->dev, "event: HOSTWAKE_STAIE %d\n", eventcause); dev_dbg(adapter->dev, "event: HOSTWAKE_STAIE %d\n", eventcause);
break; break;
case EVENT_UAP_STA_ASSOC:
memset(&sinfo, 0, sizeof(sinfo));
event = (struct mwifiex_assoc_event *)
(adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER);
if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) {
len = -1;
if (ieee80211_is_assoc_req(event->frame_control))
len = 0;
else if (ieee80211_is_reassoc_req(event->frame_control))
/* There will be ETH_ALEN bytes of
* current_ap_addr before the re-assoc ies.
*/
len = ETH_ALEN;
if (len != -1) {
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
sinfo.assoc_req_ies = &event->data[len];
len = (u8 *)sinfo.assoc_req_ies -
(u8 *)&event->frame_control;
sinfo.assoc_req_ies_len =
le16_to_cpu(event->len) - (u16)len;
}
}
cfg80211_new_sta(priv->netdev, event->sta_addr, &sinfo,
GFP_KERNEL);
break;
case EVENT_UAP_STA_DEAUTH:
cfg80211_del_sta(priv->netdev, adapter->event_body +
MWIFIEX_UAP_EVENT_EXTRA_HEADER, GFP_KERNEL);
break;
case EVENT_UAP_BSS_IDLE:
priv->media_connected = false;
break;
case EVENT_UAP_BSS_ACTIVE:
priv->media_connected = true;
break;
case EVENT_UAP_BSS_START:
dev_dbg(adapter->dev, "AP EVENT: event id: %#x\n", eventcause);
memcpy(priv->netdev->dev_addr, adapter->event_body+2, ETH_ALEN);
break;
case EVENT_UAP_MIC_COUNTERMEASURES:
/* For future development */
dev_dbg(adapter->dev, "AP EVENT: event id: %#x\n", eventcause);
break;
default: default:
dev_dbg(adapter->dev, "event: unknown event id: %#x\n", dev_dbg(adapter->dev, "event: unknown event id: %#x\n",
eventcause); eventcause);
......
...@@ -942,20 +942,26 @@ mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, char *version, ...@@ -942,20 +942,26 @@ mwifiex_drv_get_driver_version(struct mwifiex_adapter *adapter, char *version,
* This function allocates the IOCTL request buffer, fills it * This function allocates the IOCTL request buffer, fills it
* with requisite parameters and calls the IOCTL handler. * with requisite parameters and calls the IOCTL handler.
*/ */
int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, int mwifiex_set_encode(struct mwifiex_private *priv, struct key_params *kp,
int key_len, u8 key_index, const u8 *key, int key_len, u8 key_index,
const u8 *mac_addr, int disable) const u8 *mac_addr, int disable)
{ {
struct mwifiex_ds_encrypt_key encrypt_key; struct mwifiex_ds_encrypt_key encrypt_key;
memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key)); memset(&encrypt_key, 0, sizeof(struct mwifiex_ds_encrypt_key));
encrypt_key.key_len = key_len; encrypt_key.key_len = key_len;
if (kp && kp->cipher == WLAN_CIPHER_SUITE_AES_CMAC)
encrypt_key.is_igtk_key = true;
if (!disable) { if (!disable) {
encrypt_key.key_index = key_index; encrypt_key.key_index = key_index;
if (key_len) if (key_len)
memcpy(encrypt_key.key_material, key, key_len); memcpy(encrypt_key.key_material, key, key_len);
if (mac_addr) if (mac_addr)
memcpy(encrypt_key.mac_addr, mac_addr, ETH_ALEN); memcpy(encrypt_key.mac_addr, mac_addr, ETH_ALEN);
if (kp && kp->seq && kp->seq_len)
memcpy(encrypt_key.pn, kp->seq, kp->seq_len);
} else { } else {
encrypt_key.key_disable = true; encrypt_key.key_disable = true;
if (mac_addr) if (mac_addr)
......
...@@ -54,8 +54,8 @@ int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter, ...@@ -54,8 +54,8 @@ int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter,
local_rx_pd = (struct rxpd *) (skb->data); local_rx_pd = (struct rxpd *) (skb->data);
rx_pkt_hdr = (struct rx_packet_hdr *) ((u8 *) local_rx_pd + rx_pkt_hdr = (void *)local_rx_pd +
local_rx_pd->rx_pkt_offset); le16_to_cpu(local_rx_pd->rx_pkt_offset);
if (!memcmp(&rx_pkt_hdr->rfc1042_hdr, if (!memcmp(&rx_pkt_hdr->rfc1042_hdr,
rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr))) { rfc1042_eth_hdr, sizeof(rfc1042_eth_hdr))) {
...@@ -125,7 +125,7 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, ...@@ -125,7 +125,7 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter,
struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb);
struct rx_packet_hdr *rx_pkt_hdr; struct rx_packet_hdr *rx_pkt_hdr;
u8 ta[ETH_ALEN]; u8 ta[ETH_ALEN];
u16 rx_pkt_type; u16 rx_pkt_type, rx_pkt_offset, rx_pkt_length, seq_num;
struct mwifiex_private *priv = struct mwifiex_private *priv =
mwifiex_get_priv_by_id(adapter, rx_info->bss_num, mwifiex_get_priv_by_id(adapter, rx_info->bss_num,
rx_info->bss_type); rx_info->bss_type);
...@@ -134,16 +134,17 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, ...@@ -134,16 +134,17 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter,
return -1; return -1;
local_rx_pd = (struct rxpd *) (skb->data); local_rx_pd = (struct rxpd *) (skb->data);
rx_pkt_type = local_rx_pd->rx_pkt_type; rx_pkt_type = le16_to_cpu(local_rx_pd->rx_pkt_type);
rx_pkt_offset = le16_to_cpu(local_rx_pd->rx_pkt_offset);
rx_pkt_length = le16_to_cpu(local_rx_pd->rx_pkt_length);
seq_num = le16_to_cpu(local_rx_pd->seq_num);
rx_pkt_hdr = (struct rx_packet_hdr *) ((u8 *) local_rx_pd + rx_pkt_hdr = (void *)local_rx_pd + rx_pkt_offset;
local_rx_pd->rx_pkt_offset);
if ((local_rx_pd->rx_pkt_offset + local_rx_pd->rx_pkt_length) > if ((rx_pkt_offset + rx_pkt_length) > (u16) skb->len) {
(u16) skb->len) { dev_err(adapter->dev,
dev_err(adapter->dev, "wrong rx packet: len=%d," "wrong rx packet: len=%d, rx_pkt_offset=%d, rx_pkt_length=%d\n",
" rx_pkt_offset=%d, rx_pkt_length=%d\n", skb->len, skb->len, rx_pkt_offset, rx_pkt_length);
local_rx_pd->rx_pkt_offset, local_rx_pd->rx_pkt_length);
priv->stats.rx_dropped++; priv->stats.rx_dropped++;
if (adapter->if_ops.data_complete) if (adapter->if_ops.data_complete)
...@@ -154,14 +155,14 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, ...@@ -154,14 +155,14 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter,
return ret; return ret;
} }
if (local_rx_pd->rx_pkt_type == PKT_TYPE_AMSDU) { if (rx_pkt_type == PKT_TYPE_AMSDU) {
struct sk_buff_head list; struct sk_buff_head list;
struct sk_buff *rx_skb; struct sk_buff *rx_skb;
__skb_queue_head_init(&list); __skb_queue_head_init(&list);
skb_pull(skb, local_rx_pd->rx_pkt_offset); skb_pull(skb, rx_pkt_offset);
skb_trim(skb, local_rx_pd->rx_pkt_length); skb_trim(skb, rx_pkt_length);
ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr, ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr,
priv->wdev->iftype, 0, false); priv->wdev->iftype, 0, false);
...@@ -189,17 +190,14 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, ...@@ -189,17 +190,14 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter,
memcpy(ta, rx_pkt_hdr->eth803_hdr.h_source, ETH_ALEN); memcpy(ta, rx_pkt_hdr->eth803_hdr.h_source, ETH_ALEN);
} else { } else {
if (rx_pkt_type != PKT_TYPE_BAR) if (rx_pkt_type != PKT_TYPE_BAR)
priv->rx_seq[local_rx_pd->priority] = priv->rx_seq[local_rx_pd->priority] = seq_num;
local_rx_pd->seq_num;
memcpy(ta, priv->curr_bss_params.bss_descriptor.mac_address, memcpy(ta, priv->curr_bss_params.bss_descriptor.mac_address,
ETH_ALEN); ETH_ALEN);
} }
/* Reorder and send to OS */ /* Reorder and send to OS */
ret = mwifiex_11n_rx_reorder_pkt(priv, local_rx_pd->seq_num, ret = mwifiex_11n_rx_reorder_pkt(priv, seq_num, local_rx_pd->priority,
local_rx_pd->priority, ta, ta, (u8) rx_pkt_type, skb);
(u8) local_rx_pd->rx_pkt_type,
skb);
if (ret || (rx_pkt_type == PKT_TYPE_BAR)) { if (ret || (rx_pkt_type == PKT_TYPE_BAR)) {
if (adapter->if_ops.data_complete) if (adapter->if_ops.data_complete)
......
...@@ -51,6 +51,9 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, ...@@ -51,6 +51,9 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter,
rx_info->bss_num = priv->bss_num; rx_info->bss_num = priv->bss_num;
rx_info->bss_type = priv->bss_type; rx_info->bss_type = priv->bss_type;
if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP)
return mwifiex_process_uap_rx_packet(adapter, skb);
return mwifiex_process_sta_rx_packet(adapter, skb); return mwifiex_process_sta_rx_packet(adapter, skb);
} }
EXPORT_SYMBOL_GPL(mwifiex_handle_rx_packet); EXPORT_SYMBOL_GPL(mwifiex_handle_rx_packet);
...@@ -157,6 +160,8 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, ...@@ -157,6 +160,8 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
priv->stats.tx_errors++; priv->stats.tx_errors++;
} }
if (tx_info->flags & MWIFIEX_BUF_FLAG_BRIDGED_PKT)
atomic_dec_return(&adapter->pending_bridged_pkts);
if (atomic_dec_return(&adapter->tx_pending) >= LOW_TX_PENDING) if (atomic_dec_return(&adapter->tx_pending) >= LOW_TX_PENDING)
goto done; goto done;
......
...@@ -167,6 +167,7 @@ mwifiex_set_ht_params(struct mwifiex_private *priv, ...@@ -167,6 +167,7 @@ mwifiex_set_ht_params(struct mwifiex_private *priv,
if (ht_ie) { if (ht_ie) {
memcpy(&bss_cfg->ht_cap, ht_ie + 2, memcpy(&bss_cfg->ht_cap, ht_ie + 2,
sizeof(struct ieee80211_ht_cap)); sizeof(struct ieee80211_ht_cap));
priv->ap_11n_enabled = 1;
} else { } else {
memset(&bss_cfg->ht_cap , 0, sizeof(struct ieee80211_ht_cap)); memset(&bss_cfg->ht_cap , 0, sizeof(struct ieee80211_ht_cap));
bss_cfg->ht_cap.cap_info = cpu_to_le16(MWIFIEX_DEF_HT_CAP); bss_cfg->ht_cap.cap_info = cpu_to_le16(MWIFIEX_DEF_HT_CAP);
......
此差异已折叠。
此差异已折叠。
...@@ -127,6 +127,29 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, u8 *ra) ...@@ -127,6 +127,29 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, u8 *ra)
return ra_list; return ra_list;
} }
/* This function returns random no between 16 and 32 to be used as threshold
* for no of packets after which BA setup is initiated.
*/
static u8 mwifiex_get_random_ba_threshold(void)
{
u32 sec, usec;
struct timeval ba_tstamp;
u8 ba_threshold;
/* setup ba_packet_threshold here random number between
* [BA_SETUP_PACKET_OFFSET,
* BA_SETUP_PACKET_OFFSET+BA_SETUP_MAX_PACKET_THRESHOLD-1]
*/
do_gettimeofday(&ba_tstamp);
sec = (ba_tstamp.tv_sec & 0xFFFF) + (ba_tstamp.tv_sec >> 16);
usec = (ba_tstamp.tv_usec & 0xFFFF) + (ba_tstamp.tv_usec >> 16);
ba_threshold = (((sec << 16) + usec) % BA_SETUP_MAX_PACKET_THRESHOLD)
+ BA_SETUP_PACKET_OFFSET;
return ba_threshold;
}
/* /*
* This function allocates and adds a RA list for all TIDs * This function allocates and adds a RA list for all TIDs
* with the given RA. * with the given RA.
...@@ -137,6 +160,12 @@ mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra) ...@@ -137,6 +160,12 @@ mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra)
int i; int i;
struct mwifiex_ra_list_tbl *ra_list; struct mwifiex_ra_list_tbl *ra_list;
struct mwifiex_adapter *adapter = priv->adapter; struct mwifiex_adapter *adapter = priv->adapter;
struct mwifiex_sta_node *node;
unsigned long flags;
spin_lock_irqsave(&priv->sta_list_spinlock, flags);
node = mwifiex_get_sta_entry(priv, ra);
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
for (i = 0; i < MAX_NUM_TID; ++i) { for (i = 0; i < MAX_NUM_TID; ++i) {
ra_list = mwifiex_wmm_allocate_ralist_node(adapter, ra); ra_list = mwifiex_wmm_allocate_ralist_node(adapter, ra);
...@@ -145,14 +174,24 @@ mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra) ...@@ -145,14 +174,24 @@ mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra)
if (!ra_list) if (!ra_list)
break; break;
if (!mwifiex_queuing_ra_based(priv)) ra_list->is_11n_enabled = 0;
if (!mwifiex_queuing_ra_based(priv)) {
ra_list->is_11n_enabled = IS_11N_ENABLED(priv); ra_list->is_11n_enabled = IS_11N_ENABLED(priv);
else } else {
ra_list->is_11n_enabled = false; ra_list->is_11n_enabled =
mwifiex_is_sta_11n_enabled(priv, node);
if (ra_list->is_11n_enabled)
ra_list->max_amsdu = node->max_amsdu;
}
dev_dbg(adapter->dev, "data: ralist %p: is_11n_enabled=%d\n", dev_dbg(adapter->dev, "data: ralist %p: is_11n_enabled=%d\n",
ra_list, ra_list->is_11n_enabled); ra_list, ra_list->is_11n_enabled);
if (ra_list->is_11n_enabled) {
ra_list->pkt_count = 0;
ra_list->ba_packet_thr =
mwifiex_get_random_ba_threshold();
}
list_add_tail(&ra_list->list, list_add_tail(&ra_list->list,
&priv->wmm.tid_tbl_ptr[i].ra_list); &priv->wmm.tid_tbl_ptr[i].ra_list);
...@@ -647,6 +686,7 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv, ...@@ -647,6 +686,7 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv,
skb_queue_tail(&ra_list->skb_head, skb); skb_queue_tail(&ra_list->skb_head, skb);
ra_list->total_pkts_size += skb->len; ra_list->total_pkts_size += skb->len;
ra_list->pkt_count++;
atomic_inc(&priv->wmm.tx_pkts_queued); atomic_inc(&priv->wmm.tx_pkts_queued);
...@@ -986,10 +1026,17 @@ mwifiex_is_11n_aggragation_possible(struct mwifiex_private *priv, ...@@ -986,10 +1026,17 @@ mwifiex_is_11n_aggragation_possible(struct mwifiex_private *priv,
{ {
int count = 0, total_size = 0; int count = 0, total_size = 0;
struct sk_buff *skb, *tmp; struct sk_buff *skb, *tmp;
int max_amsdu_size;
if (priv->bss_role == MWIFIEX_BSS_ROLE_UAP && priv->ap_11n_enabled &&
ptr->is_11n_enabled)
max_amsdu_size = min_t(int, ptr->max_amsdu, max_buf_size);
else
max_amsdu_size = max_buf_size;
skb_queue_walk_safe(&ptr->skb_head, skb, tmp) { skb_queue_walk_safe(&ptr->skb_head, skb, tmp) {
total_size += skb->len; total_size += skb->len;
if (total_size >= max_buf_size) if (total_size >= max_amsdu_size)
break; break;
if (++count >= MIN_NUM_AMSDU) if (++count >= MIN_NUM_AMSDU)
return true; return true;
...@@ -1050,6 +1097,7 @@ mwifiex_send_single_packet(struct mwifiex_private *priv, ...@@ -1050,6 +1097,7 @@ mwifiex_send_single_packet(struct mwifiex_private *priv,
skb_queue_tail(&ptr->skb_head, skb); skb_queue_tail(&ptr->skb_head, skb);
ptr->total_pkts_size += skb->len; ptr->total_pkts_size += skb->len;
ptr->pkt_count++;
tx_info->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT; tx_info->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT;
spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
ra_list_flags); ra_list_flags);
...@@ -1231,7 +1279,8 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) ...@@ -1231,7 +1279,8 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
/* ra_list_spinlock has been freed in /* ra_list_spinlock has been freed in
mwifiex_send_single_packet() */ mwifiex_send_single_packet() */
} else { } else {
if (mwifiex_is_ampdu_allowed(priv, tid)) { if (mwifiex_is_ampdu_allowed(priv, tid) &&
ptr->pkt_count > ptr->ba_packet_thr) {
if (mwifiex_space_avail_for_new_ba_stream(adapter)) { if (mwifiex_space_avail_for_new_ba_stream(adapter)) {
mwifiex_create_ba_tbl(priv, ptr->ra, tid, mwifiex_create_ba_tbl(priv, ptr->ra, tid,
BA_SETUP_INPROGRESS); BA_SETUP_INPROGRESS);
......
此差异已折叠。
...@@ -57,6 +57,18 @@ struct pda_channel_output_limit { ...@@ -57,6 +57,18 @@ struct pda_channel_output_limit {
u8 rate_set_size; u8 rate_set_size;
} __packed; } __packed;
struct pda_channel_output_limit_point_longbow {
__le16 val_bpsk;
__le16 val_qpsk;
__le16 val_16qam;
__le16 val_64qam;
} __packed;
struct pda_channel_output_limit_longbow {
__le16 freq;
struct pda_channel_output_limit_point_longbow point[3];
} __packed;
struct pda_pa_curve_data_sample_rev0 { struct pda_pa_curve_data_sample_rev0 {
u8 rf_power; u8 rf_power;
u8 pa_detector; u8 pa_detector;
......
此差异已折叠。
...@@ -105,6 +105,7 @@ struct p54p_priv { ...@@ -105,6 +105,7 @@ struct p54p_priv {
struct sk_buff *tx_buf_data[32]; struct sk_buff *tx_buf_data[32];
struct sk_buff *tx_buf_mgmt[4]; struct sk_buff *tx_buf_mgmt[4];
struct completion boot_comp; struct completion boot_comp;
struct completion fw_loaded;
}; };
#endif /* P54USB_H */ #endif /* P54USB_H */
......
...@@ -190,16 +190,30 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) ...@@ -190,16 +190,30 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
{ {
struct ssb_bus *bus = mcore->dev->bus; struct ssb_bus *bus = mcore->dev->bus;
mcore->flash_buswidth = 2; /* When there is no chipcommon on the bus there is 4MB flash */
if (bus->chipco.dev) { if (!bus->chipco.dev) {
mcore->flash_window = 0x1c000000; mcore->flash_buswidth = 2;
mcore->flash_window_size = 0x02000000; mcore->flash_window = SSB_FLASH1;
mcore->flash_window_size = SSB_FLASH1_SZ;
return;
}
/* There is ChipCommon, so use it to read info about flash */
switch (bus->chipco.capabilities & SSB_CHIPCO_CAP_FLASHT) {
case SSB_CHIPCO_FLASHT_STSER:
case SSB_CHIPCO_FLASHT_ATSER:
pr_err("Serial flash not supported\n");
break;
case SSB_CHIPCO_FLASHT_PARA:
pr_debug("Found parallel flash\n");
mcore->flash_window = SSB_FLASH2;
mcore->flash_window_size = SSB_FLASH2_SZ;
if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG) if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG)
& SSB_CHIPCO_CFG_DS16) == 0) & SSB_CHIPCO_CFG_DS16) == 0)
mcore->flash_buswidth = 1; mcore->flash_buswidth = 1;
} else { else
mcore->flash_window = 0x1fc00000; mcore->flash_buswidth = 2;
mcore->flash_window_size = 0x00400000; break;
} }
} }
......
...@@ -11,11 +11,13 @@ ...@@ -11,11 +11,13 @@
#define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */ #define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */
#define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */ #define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */
#define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */ #define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */
#define BCMA_CLKCTLST_EXTRESREQ_SHIFT 8
#define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */ #define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */
#define BCMA_CLKCTLST_HAVEHT 0x00020000 /* HT available */ #define BCMA_CLKCTLST_HAVEHT 0x00020000 /* HT available */
#define BCMA_CLKCTLST_BP_ON_ALP 0x00040000 /* RO: running on ALP clock */ #define BCMA_CLKCTLST_BP_ON_ALP 0x00040000 /* RO: running on ALP clock */
#define BCMA_CLKCTLST_BP_ON_HT 0x00080000 /* RO: running on HT clock */ #define BCMA_CLKCTLST_BP_ON_HT 0x00080000 /* RO: running on HT clock */
#define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */ #define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */
#define BCMA_CLKCTLST_EXTRESST_SHIFT 24
/* Is there any BCM4328 on BCMA bus? */ /* Is there any BCM4328 on BCMA bus? */
#define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */ #define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */
#define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */ #define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */
......
...@@ -504,7 +504,9 @@ ...@@ -504,7 +504,9 @@
#define SSB_CHIPCO_FLASHCTL_ST_SE 0x02D8 /* Sector Erase */ #define SSB_CHIPCO_FLASHCTL_ST_SE 0x02D8 /* Sector Erase */
#define SSB_CHIPCO_FLASHCTL_ST_BE 0x00C7 /* Bulk Erase */ #define SSB_CHIPCO_FLASHCTL_ST_BE 0x00C7 /* Bulk Erase */
#define SSB_CHIPCO_FLASHCTL_ST_DP 0x00B9 /* Deep Power-down */ #define SSB_CHIPCO_FLASHCTL_ST_DP 0x00B9 /* Deep Power-down */
#define SSB_CHIPCO_FLASHCTL_ST_RSIG 0x03AB /* Read Electronic Signature */ #define SSB_CHIPCO_FLASHCTL_ST_RES 0x03AB /* Read Electronic Signature */
#define SSB_CHIPCO_FLASHCTL_ST_CSA 0x1000 /* Keep chip select asserted */
#define SSB_CHIPCO_FLASHCTL_ST_SSE 0x0220 /* Sub-sector Erase */
/* Status register bits for ST flashes */ /* Status register bits for ST flashes */
#define SSB_CHIPCO_FLASHSTA_ST_WIP 0x01 /* Write In Progress */ #define SSB_CHIPCO_FLASHSTA_ST_WIP 0x01 /* Write In Progress */
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/poll.h> #include <linux/poll.h>
#include <net/sock.h> #include <net/sock.h>
#include <linux/seq_file.h>
#ifndef AF_BLUETOOTH #ifndef AF_BLUETOOTH
#define AF_BLUETOOTH 31 #define AF_BLUETOOTH 31
...@@ -202,6 +203,10 @@ enum { ...@@ -202,6 +203,10 @@ enum {
struct bt_sock_list { struct bt_sock_list {
struct hlist_head head; struct hlist_head head;
rwlock_t lock; rwlock_t lock;
#ifdef CONFIG_PROC_FS
struct file_operations fops;
int (* custom_seq_show)(struct seq_file *, void *);
#endif
}; };
int bt_sock_register(int proto, const struct net_proto_family *ops); int bt_sock_register(int proto, const struct net_proto_family *ops);
...@@ -292,6 +297,11 @@ extern void hci_sock_cleanup(void); ...@@ -292,6 +297,11 @@ extern void hci_sock_cleanup(void);
extern int bt_sysfs_init(void); extern int bt_sysfs_init(void);
extern void bt_sysfs_cleanup(void); extern void bt_sysfs_cleanup(void);
extern int bt_procfs_init(struct module* module, struct net *net, const char *name,
struct bt_sock_list* sk_list,
int (* seq_show)(struct seq_file *, void *));
extern void bt_procfs_cleanup(struct net *net, const char *name);
extern struct dentry *bt_debugfs; extern struct dentry *bt_debugfs;
int l2cap_init(void); int l2cap_init(void);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -108,8 +108,8 @@ struct smp_cmd_security_req { ...@@ -108,8 +108,8 @@ struct smp_cmd_security_req {
#define SMP_CONFIRM_FAILED 0x04 #define SMP_CONFIRM_FAILED 0x04
#define SMP_PAIRING_NOTSUPP 0x05 #define SMP_PAIRING_NOTSUPP 0x05
#define SMP_ENC_KEY_SIZE 0x06 #define SMP_ENC_KEY_SIZE 0x06
#define SMP_CMD_NOTSUPP 0x07 #define SMP_CMD_NOTSUPP 0x07
#define SMP_UNSPECIFIED 0x08 #define SMP_UNSPECIFIED 0x08
#define SMP_REPEATED_ATTEMPTS 0x09 #define SMP_REPEATED_ATTEMPTS 0x09
#define SMP_MIN_ENC_KEY_SIZE 7 #define SMP_MIN_ENC_KEY_SIZE 7
...@@ -123,8 +123,8 @@ struct smp_chan { ...@@ -123,8 +123,8 @@ struct smp_chan {
struct l2cap_conn *conn; struct l2cap_conn *conn;
u8 preq[7]; /* SMP Pairing Request */ u8 preq[7]; /* SMP Pairing Request */
u8 prsp[7]; /* SMP Pairing Response */ u8 prsp[7]; /* SMP Pairing Response */
u8 prnd[16]; /* SMP Pairing Random (local) */ u8 prnd[16]; /* SMP Pairing Random (local) */
u8 rrnd[16]; /* SMP Pairing Random (remote) */ u8 rrnd[16]; /* SMP Pairing Random (remote) */
u8 pcnf[16]; /* SMP Pairing Confirm */ u8 pcnf[16]; /* SMP Pairing Confirm */
u8 tk[16]; /* SMP Temporary Key */ u8 tk[16]; /* SMP Temporary Key */
u8 enc_key_size; u8 enc_key_size;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册