Skip to content

Commit 996bfed

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2018-03-24' of git://git.kernel.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 <[email protected]>
2 parents da18ab3 + 28bf831 commit 996bfed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2065
-727
lines changed

drivers/bcma/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI
5555

5656
config BCMA_DRIVER_PCI_HOSTMODE
5757
bool "Driver for PCI core working in hostmode"
58-
depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
58+
depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY && BCMA = y
5959
help
6060
PCI core hostmode operation (external PCI bus).
6161

drivers/bcma/driver_chipcommon_pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc)
203203
* Add some delay; allow resources to come up and settle.
204204
* Delay is required for SoC (early init).
205205
*/
206-
mdelay(2);
206+
usleep_range(2000, 2500);
207207
}
208208

209209
/* Disable to allow reading SPROM. Don't know the adventages of enabling it. */

drivers/bcma/host_pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
297297
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_DELL, 0x0016) },
298298
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_DELL, 0x0018) },
299299
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_FOXCONN, 0xe092) },
300+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_BROADCOM, 0x4365, PCI_VENDOR_ID_HP, 0x804a) },
300301
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
301302
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
302303
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },

drivers/bluetooth/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,4 +392,16 @@ config BT_QCOMSMD
392392
Say Y here to compile support for HCI over Qualcomm SMD into the
393393
kernel or say M to compile as a module.
394394

395+
config BT_HCIRSI
396+
tristate "Redpine HCI support"
397+
default n
398+
select RSI_COEX
399+
help
400+
Redpine BT driver.
401+
This driver handles BT traffic from upper layers and pass
402+
to the RSI_91x coex module for further scheduling to device
403+
404+
Say Y here to compile support for HCI over Redpine into the
405+
kernel or say M to compile as a module.
406+
395407
endmenu

drivers/bluetooth/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ obj-$(CONFIG_BT_QCA) += btqca.o
2828

2929
obj-$(CONFIG_BT_HCIUART_NOKIA) += hci_nokia.o
3030

31+
obj-$(CONFIG_BT_HCIRSI) += btrsi.o
32+
3133
btmrvl-y := btmrvl_main.o
3234
btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o
3335

drivers/bluetooth/btrsi.c

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
/**
2+
* Copyright (c) 2017 Redpine Signals Inc.
3+
*
4+
* Permission to use, copy, modify, and/or distribute this software for any
5+
* purpose with or without fee is hereby granted, provided that the above
6+
* copyright notice and this permission notice appear in all copies.
7+
*
8+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15+
*/
16+
#include <linux/version.h>
17+
#include <linux/module.h>
18+
#include <linux/kernel.h>
19+
#include <net/bluetooth/bluetooth.h>
20+
#include <net/bluetooth/hci_core.h>
21+
#include <asm/unaligned.h>
22+
#include <net/rsi_91x.h>
23+
#include <net/genetlink.h>
24+
25+
#define RSI_HEADROOM_FOR_BT_HAL 16
26+
#define RSI_FRAME_DESC_SIZE 16
27+
28+
struct rsi_hci_adapter {
29+
void *priv;
30+
struct rsi_proto_ops *proto_ops;
31+
struct hci_dev *hdev;
32+
};
33+
34+
static int rsi_hci_open(struct hci_dev *hdev)
35+
{
36+
return 0;
37+
}
38+
39+
static int rsi_hci_close(struct hci_dev *hdev)
40+
{
41+
return 0;
42+
}
43+
44+
static int rsi_hci_flush(struct hci_dev *hdev)
45+
{
46+
return 0;
47+
}
48+
49+
static int rsi_hci_send_pkt(struct hci_dev *hdev, struct sk_buff *skb)
50+
{
51+
struct rsi_hci_adapter *h_adapter = hci_get_drvdata(hdev);
52+
struct sk_buff *new_skb = NULL;
53+
54+
switch (hci_skb_pkt_type(skb)) {
55+
case HCI_COMMAND_PKT:
56+
hdev->stat.cmd_tx++;
57+
break;
58+
case HCI_ACLDATA_PKT:
59+
hdev->stat.acl_tx++;
60+
break;
61+
case HCI_SCODATA_PKT:
62+
hdev->stat.sco_tx++;
63+
break;
64+
}
65+
66+
if (skb_headroom(skb) < RSI_HEADROOM_FOR_BT_HAL) {
67+
/* Insufficient skb headroom - allocate a new skb */
68+
new_skb = skb_realloc_headroom(skb, RSI_HEADROOM_FOR_BT_HAL);
69+
if (unlikely(!new_skb))
70+
return -ENOMEM;
71+
bt_cb(new_skb)->pkt_type = hci_skb_pkt_type(skb);
72+
kfree_skb(skb);
73+
skb = new_skb;
74+
}
75+
76+
return h_adapter->proto_ops->coex_send_pkt(h_adapter->priv, skb,
77+
RSI_BT_Q);
78+
}
79+
80+
static int rsi_hci_recv_pkt(void *priv, const u8 *pkt)
81+
{
82+
struct rsi_hci_adapter *h_adapter = priv;
83+
struct hci_dev *hdev = h_adapter->hdev;
84+
struct sk_buff *skb;
85+
int pkt_len = get_unaligned_le16(pkt) & 0x0fff;
86+
87+
skb = dev_alloc_skb(pkt_len);
88+
if (!skb)
89+
return -ENOMEM;
90+
91+
memcpy(skb->data, pkt + RSI_FRAME_DESC_SIZE, pkt_len);
92+
skb_put(skb, pkt_len);
93+
h_adapter->hdev->stat.byte_rx += skb->len;
94+
95+
hci_skb_pkt_type(skb) = pkt[14];
96+
97+
return hci_recv_frame(hdev, skb);
98+
}
99+
100+
static int rsi_hci_attach(void *priv, struct rsi_proto_ops *ops)
101+
{
102+
struct rsi_hci_adapter *h_adapter = NULL;
103+
struct hci_dev *hdev;
104+
int err = 0;
105+
106+
h_adapter = kzalloc(sizeof(*h_adapter), GFP_KERNEL);
107+
if (!h_adapter)
108+
return -ENOMEM;
109+
110+
h_adapter->priv = priv;
111+
ops->set_bt_context(priv, h_adapter);
112+
h_adapter->proto_ops = ops;
113+
114+
hdev = hci_alloc_dev();
115+
if (!hdev) {
116+
BT_ERR("Failed to alloc HCI device");
117+
goto err;
118+
}
119+
120+
h_adapter->hdev = hdev;
121+
122+
if (ops->get_host_intf(priv) == RSI_HOST_INTF_SDIO)
123+
hdev->bus = HCI_SDIO;
124+
else
125+
hdev->bus = HCI_USB;
126+
127+
hci_set_drvdata(hdev, h_adapter);
128+
hdev->dev_type = HCI_PRIMARY;
129+
hdev->open = rsi_hci_open;
130+
hdev->close = rsi_hci_close;
131+
hdev->flush = rsi_hci_flush;
132+
hdev->send = rsi_hci_send_pkt;
133+
134+
err = hci_register_dev(hdev);
135+
if (err < 0) {
136+
BT_ERR("HCI registration failed with errcode %d", err);
137+
hci_free_dev(hdev);
138+
goto err;
139+
}
140+
141+
return 0;
142+
err:
143+
h_adapter->hdev = NULL;
144+
kfree(h_adapter);
145+
return -EINVAL;
146+
}
147+
148+
static void rsi_hci_detach(void *priv)
149+
{
150+
struct rsi_hci_adapter *h_adapter = priv;
151+
struct hci_dev *hdev;
152+
153+
if (!h_adapter)
154+
return;
155+
156+
hdev = h_adapter->hdev;
157+
if (hdev) {
158+
hci_unregister_dev(hdev);
159+
hci_free_dev(hdev);
160+
h_adapter->hdev = NULL;
161+
}
162+
163+
kfree(h_adapter);
164+
}
165+
166+
const struct rsi_mod_ops rsi_bt_ops = {
167+
.attach = rsi_hci_attach,
168+
.detach = rsi_hci_detach,
169+
.recv_pkt = rsi_hci_recv_pkt,
170+
};
171+
EXPORT_SYMBOL(rsi_bt_ops);
172+
173+
static int rsi_91x_bt_module_init(void)
174+
{
175+
return 0;
176+
}
177+
178+
static void rsi_91x_bt_module_exit(void)
179+
{
180+
return;
181+
}
182+
183+
module_init(rsi_91x_bt_module_init);
184+
module_exit(rsi_91x_bt_module_exit);
185+
MODULE_AUTHOR("Redpine Signals Inc");
186+
MODULE_DESCRIPTION("RSI BT driver");
187+
MODULE_SUPPORTED_DEVICE("RSI-BT");
188+
MODULE_LICENSE("Dual BSD/GPL");

drivers/net/wireless/admtek/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ config WLAN_VENDOR_ADMTEK
55
If you have a wireless card belonging to this class, say Y.
66

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

1212
if WLAN_VENDOR_ADMTEK

drivers/net/wireless/ath/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ config WLAN_VENDOR_ATH
88
If you have a wireless card belonging to this class, say Y.
99

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

1515
For more information and documentation on this module you can visit:

drivers/net/wireless/atmel/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ config WLAN_VENDOR_ATMEL
55
If you have a wireless card belonging to this class, say Y.
66

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

1212
if WLAN_VENDOR_ATMEL

drivers/net/wireless/broadcom/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ config WLAN_VENDOR_BROADCOM
55
If you have a wireless card belonging to this class, say Y.
66

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

1212
if WLAN_VENDOR_BROADCOM

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ void brcmf_dev_reset(struct device *dev);
253253
/* Configure the "global" bus state used by upper layers */
254254
void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);
255255

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5124,6 +5124,9 @@ static int brcmf_cfg80211_set_pmk(struct wiphy *wiphy, struct net_device *dev,
51245124
if (WARN_ON(ifp->vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_1X))
51255125
return -EINVAL;
51265126

5127+
if (conf->pmk_len > BRCMF_WSEC_MAX_PSK_LEN)
5128+
return -ERANGE;
5129+
51275130
return brcmf_set_pmk(ifp, conf->pmk, conf->pmk_len);
51285131
}
51295132

drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
365365

366366
/* Enable tx beamforming, errors can be ignored (not supported) */
367367
(void)brcmf_fil_iovar_int_set(ifp, "txbf", 1);
368-
369-
/* do bus specific preinit here */
370-
err = brcmf_bus_preinit(ifp->drvr->bus_if);
371368
done:
372369
return err;
373370
}

0 commit comments

Comments
 (0)