Skip to content

Commit

Permalink
Merge tag 'wireless-drivers-next-for-davem-2018-03-24' of git://git.k…
Browse files Browse the repository at this point in the history
…ernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for 4.17

The biggest changes are the bluetooth related patches to the rsi
driver. It adds a new bluetooth driver which communicates directly
with the wireless driver and the interface is defined in
include/net/rsi_91x.h.

Major changes:

wl1251

* read the MAC address from the NVS file

rtlwifi

* enable mac80211 fast-tx support

mt76

* add capability to select tx/rx antennas

mt7601

* let mac80211 validate rx CCMP Packet Number (PN)

rsi

* bluetooth: add new btrsi driver

* btcoex support with the new btrsi driver
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 26, 2018
2 parents da18ab3 + 28bf831 commit 996bfed
Show file tree
Hide file tree
Showing 98 changed files with 2,065 additions and 727 deletions.
2 changes: 1 addition & 1 deletion drivers/bcma/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI

config BCMA_DRIVER_PCI_HOSTMODE
bool "Driver for PCI core working in hostmode"
depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY && BCMA = y
help
PCI core hostmode operation (external PCI bus).

Expand Down
2 changes: 1 addition & 1 deletion drivers/bcma/driver_chipcommon_pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc)
* Add some delay; allow resources to come up and settle.
* Delay is required for SoC (early init).
*/
mdelay(2);
usleep_range(2000, 2500);
}

/* Disable to allow reading SPROM. Don't know the adventages of enabling it. */
Expand Down
1 change: 1 addition & 0 deletions drivers/bcma/host_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_DELL, 0x0016) },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_DELL, 0x0018) },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_FOXCONN, 0xe092) },
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_HP, 0x804a) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
Expand Down
12 changes: 12 additions & 0 deletions drivers/bluetooth/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -392,4 +392,16 @@ config BT_QCOMSMD
Say Y here to compile support for HCI over Qualcomm SMD into the
kernel or say M to compile as a module.

config BT_HCIRSI
tristate "Redpine HCI support"
default n
select RSI_COEX
help
Redpine BT driver.
This driver handles BT traffic from upper layers and pass
to the RSI_91x coex module for further scheduling to device

Say Y here to compile support for HCI over Redpine into the
kernel or say M to compile as a module.

endmenu
2 changes: 2 additions & 0 deletions drivers/bluetooth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ obj-$(CONFIG_BT_QCA) += btqca.o

obj-$(CONFIG_BT_HCIUART_NOKIA) += hci_nokia.o

obj-$(CONFIG_BT_HCIRSI) += btrsi.o

btmrvl-y := btmrvl_main.o
btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o

Expand Down
188 changes: 188 additions & 0 deletions drivers/bluetooth/btrsi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
/**
* Copyright (c) 2017 Redpine Signals Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <asm/unaligned.h>
#include <net/rsi_91x.h>
#include <net/genetlink.h>

#define RSI_HEADROOM_FOR_BT_HAL 16
#define RSI_FRAME_DESC_SIZE 16

struct rsi_hci_adapter {
void *priv;
struct rsi_proto_ops *proto_ops;
struct hci_dev *hdev;
};

static int rsi_hci_open(struct hci_dev *hdev)
{
return 0;
}

static int rsi_hci_close(struct hci_dev *hdev)
{
return 0;
}

static int rsi_hci_flush(struct hci_dev *hdev)
{
return 0;
}

static int rsi_hci_send_pkt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct rsi_hci_adapter *h_adapter = hci_get_drvdata(hdev);
struct sk_buff *new_skb = NULL;

switch (hci_skb_pkt_type(skb)) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
case HCI_ACLDATA_PKT:
hdev->stat.acl_tx++;
break;
case HCI_SCODATA_PKT:
hdev->stat.sco_tx++;
break;
}

if (skb_headroom(skb) < RSI_HEADROOM_FOR_BT_HAL) {
/* Insufficient skb headroom - allocate a new skb */
new_skb = skb_realloc_headroom(skb, RSI_HEADROOM_FOR_BT_HAL);
if (unlikely(!new_skb))
return -ENOMEM;
bt_cb(new_skb)->pkt_type = hci_skb_pkt_type(skb);
kfree_skb(skb);
skb = new_skb;
}

return h_adapter->proto_ops->coex_send_pkt(h_adapter->priv, skb,
RSI_BT_Q);
}

static int rsi_hci_recv_pkt(void *priv, const u8 *pkt)
{
struct rsi_hci_adapter *h_adapter = priv;
struct hci_dev *hdev = h_adapter->hdev;
struct sk_buff *skb;
int pkt_len = get_unaligned_le16(pkt) & 0x0fff;

skb = dev_alloc_skb(pkt_len);
if (!skb)
return -ENOMEM;

memcpy(skb->data, pkt + RSI_FRAME_DESC_SIZE, pkt_len);
skb_put(skb, pkt_len);
h_adapter->hdev->stat.byte_rx += skb->len;

hci_skb_pkt_type(skb) = pkt[14];

return hci_recv_frame(hdev, skb);
}

static int rsi_hci_attach(void *priv, struct rsi_proto_ops *ops)
{
struct rsi_hci_adapter *h_adapter = NULL;
struct hci_dev *hdev;
int err = 0;

h_adapter = kzalloc(sizeof(*h_adapter), GFP_KERNEL);
if (!h_adapter)
return -ENOMEM;

h_adapter->priv = priv;
ops->set_bt_context(priv, h_adapter);
h_adapter->proto_ops = ops;

hdev = hci_alloc_dev();
if (!hdev) {
BT_ERR("Failed to alloc HCI device");
goto err;
}

h_adapter->hdev = hdev;

if (ops->get_host_intf(priv) == RSI_HOST_INTF_SDIO)
hdev->bus = HCI_SDIO;
else
hdev->bus = HCI_USB;

hci_set_drvdata(hdev, h_adapter);
hdev->dev_type = HCI_PRIMARY;
hdev->open = rsi_hci_open;
hdev->close = rsi_hci_close;
hdev->flush = rsi_hci_flush;
hdev->send = rsi_hci_send_pkt;

err = hci_register_dev(hdev);
if (err < 0) {
BT_ERR("HCI registration failed with errcode %d", err);
hci_free_dev(hdev);
goto err;
}

return 0;
err:
h_adapter->hdev = NULL;
kfree(h_adapter);
return -EINVAL;
}

static void rsi_hci_detach(void *priv)
{
struct rsi_hci_adapter *h_adapter = priv;
struct hci_dev *hdev;

if (!h_adapter)
return;

hdev = h_adapter->hdev;
if (hdev) {
hci_unregister_dev(hdev);
hci_free_dev(hdev);
h_adapter->hdev = NULL;
}

kfree(h_adapter);
}

const struct rsi_mod_ops rsi_bt_ops = {
.attach = rsi_hci_attach,
.detach = rsi_hci_detach,
.recv_pkt = rsi_hci_recv_pkt,
};
EXPORT_SYMBOL(rsi_bt_ops);

static int rsi_91x_bt_module_init(void)
{
return 0;
}

static void rsi_91x_bt_module_exit(void)
{
return;
}

module_init(rsi_91x_bt_module_init);
module_exit(rsi_91x_bt_module_exit);
MODULE_AUTHOR("Redpine Signals Inc");
MODULE_DESCRIPTION("RSI BT driver");
MODULE_SUPPORTED_DEVICE("RSI-BT");
MODULE_LICENSE("Dual BSD/GPL");
4 changes: 2 additions & 2 deletions drivers/net/wireless/admtek/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ config WLAN_VENDOR_ADMTEK
If you have a wireless card belonging to this class, say Y.

Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about cards. If you say Y, you will be asked for
kernel: saying N will just cause the configurator to skip all the
questions about these cards. If you say Y, you will be asked for
your specific card in the following questions.

if WLAN_VENDOR_ADMTEK
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ config WLAN_VENDOR_ATH
If you have a wireless card belonging to this class, say Y.

Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about cards. If you say Y, you will be asked for
kernel: saying N will just cause the configurator to skip all the
questions about these cards. If you say Y, you will be asked for
your specific card in the following questions.

For more information and documentation on this module you can visit:
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/atmel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ config WLAN_VENDOR_ATMEL
If you have a wireless card belonging to this class, say Y.

Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about cards. If you say Y, you will be asked for
kernel: saying N will just cause the configurator to skip all the
questions about these cards. If you say Y, you will be asked for
your specific card in the following questions.

if WLAN_VENDOR_ATMEL
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/broadcom/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ config WLAN_VENDOR_BROADCOM
If you have a wireless card belonging to this class, say Y.

Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about cards. If you say Y, you will be asked for
kernel: saying N will just cause the configurator to skip all the
questions about these cards. If you say Y, you will be asked for
your specific card in the following questions.

if WLAN_VENDOR_BROADCOM
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ void brcmf_dev_reset(struct device *dev);
/* Configure the "global" bus state used by upper layers */
void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);

int brcmf_bus_started(struct device *dev);
s32 brcmf_iovar_data_set(struct device *dev, char *name, void *data, u32 len);
void brcmf_bus_add_txhdrlen(struct device *dev, uint len);

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -5124,6 +5124,9 @@ static int brcmf_cfg80211_set_pmk(struct wiphy *wiphy, struct net_device *dev,
if (WARN_ON(ifp->vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_1X))
return -EINVAL;

if (conf->pmk_len > BRCMF_WSEC_MAX_PSK_LEN)
return -ERANGE;

return brcmf_set_pmk(ifp, conf->pmk, conf->pmk_len);
}

Expand Down
3 changes: 0 additions & 3 deletions drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)

/* Enable tx beamforming, errors can be ignored (not supported) */
(void)brcmf_fil_iovar_int_set(ifp, "txbf", 1);

/* do bus specific preinit here */
err = brcmf_bus_preinit(ifp->drvr->bus_if);
done:
return err;
}
Expand Down
Loading

0 comments on commit 996bfed

Please sign in to comment.