Commit 9d72a9e1 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Greg Kroah-Hartman

ath6kl: remove Bluetooth PAL code and WMI ACL TX/RX data support

ath6kl used to have an internal PAL for Bluetooth 3.0 support
but this is no longer supported. The target used a WMI with an
ACL header for supporting these frames. Userspace would use
the ioctl AR6000_XIOCTL_ACL_DATA to send data to the target
and the firmware would generate ACL frames.

Remove both the parsing of the frames and the ioctl support.
We leave a warning for now for if the target generates some
sort of ACL data frame, later on we can remove this warning
once we have proven the target is no longer generating these
frames. It should be noted this also provides a fix for the
processing of spurious ACL data frames from the target,
previously they would not be dropped if they were generated
by the target but EXPORT_HCI_PAL_INTERFACE was not compiled
in.

Cc: Naveen Singh <nsingh@atheros.com>
Cc: Prerepa (Dham) Viswanadham <dham@atheros.com>
Cc: Shanmugamkamatchi Balashanmugam <sbalashanmugam@atheros.com>
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1fd8d024
......@@ -142,7 +142,6 @@ ath6kl-y += os/linux/netbuf.o
ath6kl-y += os/linux/wireless_ext.o
ath6kl-y += os/linux/ioctl.o
ath6kl-y += os/linux/hci_bridge.o
ath6kl-y += os/linux/ar6k_pal.o
ath6kl-y += miscdrv/common_drv.o
ath6kl-y += miscdrv/credit_dist.o
ath6kl-y += wmi/wmi.o
......
......@@ -118,7 +118,7 @@ typedef enum {
typedef enum {
WMI_DATA_HDR_DATA_TYPE_802_3 = 0,
WMI_DATA_HDR_DATA_TYPE_802_11,
WMI_DATA_HDR_DATA_TYPE_ACL,
WMI_DATA_HDR_DATA_TYPE_ACL, /* used to be used for the PAL */
} WMI_DATA_HDR_DATA_TYPE;
#define WMI_DATA_HDR_DATA_TYPE_MASK 0x3
......
......@@ -147,7 +147,6 @@ unsigned int panic_on_assert = 1;
unsigned int nohifscattersupport = NOHIFSCATTERSUPPORT_DEFAULT;
unsigned int setuphci = SETUPHCI_DEFAULT;
unsigned int setuphcipal = SETUPHCIPAL_DEFAULT;
unsigned int loghci = 0;
unsigned int setupbtdev = SETUPBTDEV_DEFAULT;
#ifndef EXPORT_HCI_BRIDGE_INTERFACE
......@@ -190,7 +189,6 @@ module_param(irqprocmode, uint, 0644);
module_param(nohifscattersupport, uint, 0644);
module_param(panic_on_assert, uint, 0644);
module_param(setuphci, uint, 0644);
module_param(setuphcipal, uint, 0644);
module_param(loghci, uint, 0644);
module_param(setupbtdev, uint, 0644);
#ifndef EXPORT_HCI_BRIDGE_INTERFACE
......@@ -344,8 +342,6 @@ ar6000_sysfs_bmi_write(struct file *fp, struct kobject *kobj,
static int
ar6000_sysfs_bmi_init(struct ar6_softc *ar);
/* HCI PAL callback function declarations */
int ar6k_setup_hci_pal(struct ar6_softc *ar);
void ar6k_cleanup_hci_pal(struct ar6_softc *ar);
static void
......@@ -2027,15 +2023,6 @@ ar6000_stop_endpoint(struct net_device *dev, bool keepprofile, bool getdbglogs)
// END workaround
if (setuphci)
ar6000_cleanup_hci(ar);
#endif
#ifdef EXPORT_HCI_PAL_INTERFACE
if (setuphcipal && (NULL != ar6kHciPalCallbacks_g.cleanupTransport)) {
ar6kHciPalCallbacks_g.cleanupTransport(ar);
}
#else
/* cleanup hci pal driver data structures */
if(setuphcipal)
ar6k_cleanup_hci_pal(ar);
#endif
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,(" Shutting down HTC .... \n"));
/* stop HTC */
......@@ -2737,13 +2724,6 @@ int ar6000_init(struct net_device *dev)
status = ar6000_setup_hci(ar);
}
#endif
#ifdef EXPORT_HCI_PAL_INTERFACE
if (setuphcipal && (NULL != ar6kHciPalCallbacks_g.setupTransport))
status = ar6kHciPalCallbacks_g.setupTransport(ar);
#else
if(setuphcipal)
status = ar6k_setup_hci_pal(ar);
#endif
} while (false);
......@@ -3705,8 +3685,23 @@ ar6000_rx(void *Context, struct htc_packet *pPacket)
WMI_DATA_HDR *dhdr = (WMI_DATA_HDR *)A_NETBUF_DATA(skb);
bool is_amsdu;
u8 tid;
bool is_acl_data_frame;
is_acl_data_frame = WMI_DATA_HDR_GET_DATA_TYPE(dhdr) == WMI_DATA_HDR_DATA_TYPE_ACL;
/*
* This check can be removed if after a while we do not
* see the warning. For now we leave it to ensure
* we drop these frames accordingly in case the
* target generates them for some reason. These
* were used for an internal PAL but that's not
* used or supported anymore. These frames should
* not come up from the target.
*/
if (WARN_ON(WMI_DATA_HDR_GET_DATA_TYPE(dhdr) ==
WMI_DATA_HDR_DATA_TYPE_ACL)) {
AR6000_STAT_INC(ar, rx_errors);
A_NETBUF_FREE(skb);
return;
}
#ifdef CONFIG_PM
ar6000_check_wow_status(ar, NULL, false);
#endif /* CONFIG_PM */
......@@ -3728,7 +3723,7 @@ ar6000_rx(void *Context, struct htc_packet *pPacket)
* ACL data frames don't follow ethernet frame bounds for
* min length
*/
if (ar->arNetworkType != AP_NETWORK && !is_acl_data_frame &&
if (ar->arNetworkType != AP_NETWORK &&
((pPacket->ActualLength < minHdrLen) ||
(pPacket->ActualLength > AR6000_MAX_RX_MESSAGE_SIZE)))
{
......@@ -3863,7 +3858,7 @@ ar6000_rx(void *Context, struct htc_packet *pPacket)
/* NWF: print the 802.11 hdr bytes */
if(containsDot11Hdr) {
status = wmi_dot11_hdr_remove(ar->arWmi,skb);
} else if(!is_amsdu && !is_acl_data_frame) {
} else if(!is_amsdu) {
status = wmi_dot3_2_dix(skb);
}
......@@ -3873,16 +3868,6 @@ ar6000_rx(void *Context, struct htc_packet *pPacket)
goto rx_done;
}
if (is_acl_data_frame) {
A_NETBUF_PUSH(skb, sizeof(int));
*((short *)A_NETBUF_DATA(skb)) = WMI_ACL_DATA_EVENTID;
/* send the data packet to PAL driver */
if(ar6k_pal_config_g.fpar6k_pal_recv_pkt) {
if((*ar6k_pal_config_g.fpar6k_pal_recv_pkt)(ar->hcipal_info, skb) == true)
goto rx_done;
}
}
if ((ar->arNetDev->flags & IFF_UP) == IFF_UP) {
if (ar->arNetworkType == AP_NETWORK) {
struct sk_buff *skb1 = NULL;
......@@ -4829,12 +4814,6 @@ ar6000_hci_event_rcv_evt(struct ar6_softc *ar, WMI_HCI_EVENT *cmd)
buf += sizeof(int);
memcpy(buf, cmd->buf, cmd->evt_buf_sz);
if(ar6k_pal_config_g.fpar6k_pal_recv_pkt)
{
/* pass the cmd packet to PAL driver */
if((*ar6k_pal_config_g.fpar6k_pal_recv_pkt)(ar->hcipal_info, osbuf) == true)
return;
}
ar6000_deliver_frames_to_nw_stack(ar->arNetDev, osbuf);
if(loghci) {
A_PRINTF_LOG("HCI Event From PAL <-- \n");
......
This diff is collapsed.
......@@ -215,12 +215,6 @@ typedef enum _AR6K_BIN_FILE {
#define SETUPHCI_DEFAULT 0
#endif /* SETUPHCI_ENABLED */
#ifdef SETUPHCIPAL_ENABLED
#define SETUPHCIPAL_DEFAULT 1
#else
#define SETUPHCIPAL_DEFAULT 0
#endif /* SETUPHCIPAL_ENABLED */
#ifdef SETUPBTDEV_ENABLED
#define SETUPBTDEV_DEFAULT 1
#else
......@@ -571,7 +565,6 @@ struct ar6_softc {
#ifndef EXPORT_HCI_BRIDGE_INTERFACE
void *hcidev_info;
#endif
void *hcipal_info;
WMI_AP_MODE_STAT arAPStats;
u8 ap_hidden_ssid;
u8 ap_country_code[3];
......
......@@ -942,7 +942,7 @@ typedef enum {
#define AR6000_XIOCTL_HCI_CMD 132
#define AR6000_XIOCTL_ACL_DATA 133
#define AR6000_XIOCTL_ACL_DATA 133 /* used to be used for PAL */
#define AR6000_XIOCTL_WLAN_CONN_PRECEDENCE 134
......
......@@ -266,7 +266,7 @@ u8 xioctl_filter[] = {
(0xFF), /* AR6000_XIOCTL_DELE_AGGR 130 */
(0xFF), /* AR6000_XIOCTL_FETCH_TARGET_REGS 131 */
(0xFF), /* AR6000_XIOCTL_HCI_CMD 132 */
(0xFF), /* AR6000_XIOCTL_ACL_DATA 133 */
(0xFF), /* AR6000_XIOCTL_ACL_DATA(used to be used for PAL) 133 */
(0xFF), /* AR6000_XIOCTL_WLAN_CONN_PRECEDENCE 134 */
(AP_NETWORK), /* AR6000_XIOCTL_AP_SET_11BG_RATESET 135 */
(0xFF),
......
......@@ -1488,57 +1488,6 @@ prof_count_rx(u32 addr, u32 count)
}
#endif /* CONFIG_TARGET_PROFILE_SUPPORT */
static int
ar6000_create_acl_data_osbuf(struct net_device *dev, u8 *userdata, void **p_osbuf)
{
void *osbuf = NULL;
u8 tmp_space[8];
HCI_ACL_DATA_PKT *acl;
u8 hdr_size, *datap=NULL;
int ret = 0;
/* ACL is in data path. There is a need to create pool
* mechanism for allocating and freeing NETBUFs - ToDo later.
*/
*p_osbuf = NULL;
acl = (HCI_ACL_DATA_PKT *)tmp_space;
hdr_size = sizeof(acl->hdl_and_flags) + sizeof(acl->data_len);
do {
if (a_copy_from_user(acl, userdata, hdr_size)) {
ret = A_EFAULT;
break;
}
osbuf = A_NETBUF_ALLOC(hdr_size + acl->data_len);
if (osbuf == NULL) {
ret = A_NO_MEMORY;
break;
}
A_NETBUF_PUT(osbuf, hdr_size + acl->data_len);
datap = (u8 *)A_NETBUF_DATA(osbuf);
/* Real copy to osbuf */
acl = (HCI_ACL_DATA_PKT *)(datap);
memcpy(acl, tmp_space, hdr_size);
if (a_copy_from_user(acl->data, userdata + hdr_size, acl->data_len)) {
ret = A_EFAULT;
break;
}
} while(false);
if (ret == 0) {
*p_osbuf = osbuf;
} else {
A_NETBUF_FREE(osbuf);
}
return ret;
}
int
ar6000_ioctl_ap_setparam(struct ar6_softc *ar, int param, int value)
{
......@@ -4411,23 +4360,6 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
break;
}
#endif
case AR6000_XIOCTL_ACL_DATA:
{
void *osbuf = NULL;
if (ar->arWmiReady == false) {
ret = -EIO;
} else if (ar6000_create_acl_data_osbuf(dev, (u8 *)userdata, &osbuf) != 0) {
ret = -EIO;
} else {
if (wmi_data_hdr_add(ar->arWmi, osbuf, DATA_MSGTYPE, 0, WMI_DATA_HDR_DATA_TYPE_ACL,0,NULL) != 0) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("XIOCTL_ACL_DATA - wmi_data_hdr_add failed\n"));
} else {
/* Send data buffer over HTC */
ar6000_acl_data_tx(osbuf, ar->arNetDev);
}
}
break;
}
case AR6000_XIOCTL_HCI_CMD:
{
char tmp_buf[512];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment