rtl8xxxu: Initial functionality to handle C2H events for 8723bu

The 64 bit mailbox commands also provide a different method for
mailbox command responses (C2H events).

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Jes Sorensen 2016-02-29 17:04:48 -05:00 committed by Kalle Valo
parent b18cdfdb67
commit b2b43b7837
2 changed files with 87 additions and 1 deletions

View File

@ -6815,6 +6815,36 @@ static int rtl8723bu_parse_rx_desc(struct rtl8xxxu_priv *priv,
return rx_type;
}
static void rtl8723bu_handle_c2h(struct rtl8xxxu_priv *priv,
struct sk_buff *skb)
{
struct rtl8723bu_c2h *c2h = (struct rtl8723bu_c2h *)skb->data;
struct device *dev = &priv->udev->dev;
int len;
len = skb->len - 2;
pr_info("%s: C2H ID %02x seq %02x, len %02x %02x\n", __func__,
c2h->id, c2h->seq, len, c2h->bt_info.response_source);
switch(c2h->id) {
case C2H_8723B_BT_INFO:
if (c2h->bt_info.response_source >
BT_INFO_SRC_8723B_BT_ACTIVE_SEND)
dev_info(dev, "C2H_BT_INFO WiFi only firmware\n");
else
dev_info(dev, "C2H_BT_INFO BT/WiFi coexist firmware\n");
if (c2h->bt_info.bt_has_reset)
dev_info(dev, "BT has been reset\n");
break;
default:
pr_info("%s: Unhandled C2H event %02x\n", __func__, c2h->id);
break;
}
}
static void rtl8xxxu_rx_complete(struct urb *urb)
{
struct rtl8xxxu_rx_urb *rx_urb =
@ -6843,8 +6873,10 @@ static void rtl8xxxu_rx_complete(struct urb *urb)
if (rx_type == RX_TYPE_DATA_PKT)
ieee80211_rx_irqsafe(hw, skb);
else
else {
rtl8723bu_handle_c2h(priv, skb);
dev_kfree_skb(skb);
}
skb = NULL;
rx_urb->urb.context = NULL;

View File

@ -899,6 +899,60 @@ struct h2c_cmd {
};
};
enum c2h_evt_8723b {
C2H_8723B_DEBUG = 0,
C2H_8723B_TSF = 1,
C2H_8723B_AP_RPT_RSP = 2,
C2H_8723B_CCX_TX_RPT = 3,
C2H_8723B_BT_RSSI = 4,
C2H_8723B_BT_OP_MODE = 5,
C2H_8723B_EXT_RA_RPT = 6,
C2H_8723B_BT_INFO = 9,
C2H_8723B_HW_INFO_EXCH = 10,
C2H_8723B_BT_MP_INFO = 11,
C2H_8723B_FW_DEBUG = 0xff,
};
enum bt_info_src_8723b {
BT_INFO_SRC_8723B_WIFI_FW = 0x0,
BT_INFO_SRC_8723B_BT_RSP = 0x1,
BT_INFO_SRC_8723B_BT_ACTIVE_SEND = 0x2,
};
struct rtl8723bu_c2h {
u8 id;
u8 seq;
union {
struct {
u8 payload[0];
} __packed raw;
struct {
u8 response_source:4;
u8 dummy0_0:4;
u8 bt_info;
u8 retry_count:4;
u8 dummy2_0:1;
u8 bt_page:1;
u8 tx_rx_mask:1;
u8 dummy2_2:1;
u8 rssi;
u8 basic_rate:1;
u8 bt_has_reset:1;
u8 dummy4_1:1;;
u8 ignore_wlan:1;
u8 auto_report:1;
u8 dummy4_2:3;
u8 a4;
u8 a5;
} __packed bt_info;
};
};
struct rtl8xxxu_fileops;
struct rtl8xxxu_priv {