|
@@ -80,31 +80,33 @@ static inline void hci_st_tx_complete(struct hci_st *hst, int pkt_type)
|
|
* status.hci_st_open() function will wait for signal from this
|
|
* status.hci_st_open() function will wait for signal from this
|
|
* API when st_register() function returns ST_PENDING.
|
|
* API when st_register() function returns ST_PENDING.
|
|
*/
|
|
*/
|
|
-static void hci_st_registration_completion_cb(char data)
|
|
|
|
|
|
+static void hci_st_registration_completion_cb(void *priv_data, char data)
|
|
{
|
|
{
|
|
|
|
+ struct hci_st *lhst = (struct hci_st *)priv_data;
|
|
BTDRV_API_START();
|
|
BTDRV_API_START();
|
|
|
|
|
|
/* hci_st_open() function needs value of 'data' to know
|
|
/* hci_st_open() function needs value of 'data' to know
|
|
* the registration status(success/fail),So have a back
|
|
* the registration status(success/fail),So have a back
|
|
* up of it.
|
|
* up of it.
|
|
*/
|
|
*/
|
|
- hst->streg_cbdata = data;
|
|
|
|
|
|
+ lhst->streg_cbdata = data;
|
|
|
|
|
|
/* Got a feedback from ST for BT driver registration
|
|
/* Got a feedback from ST for BT driver registration
|
|
* request.Wackup hci_st_open() function to continue
|
|
* request.Wackup hci_st_open() function to continue
|
|
* it's open operation.
|
|
* it's open operation.
|
|
*/
|
|
*/
|
|
- complete(&hst->wait_for_btdrv_reg_completion);
|
|
|
|
|
|
+ complete(&lhst->wait_for_btdrv_reg_completion);
|
|
|
|
|
|
BTDRV_API_EXIT(0);
|
|
BTDRV_API_EXIT(0);
|
|
}
|
|
}
|
|
|
|
|
|
/* Called by Shared Transport layer when receive data is
|
|
/* Called by Shared Transport layer when receive data is
|
|
* available */
|
|
* available */
|
|
-static long hci_st_receive(struct sk_buff *skb)
|
|
|
|
|
|
+static long hci_st_receive(void *priv_data, struct sk_buff *skb)
|
|
{
|
|
{
|
|
int err;
|
|
int err;
|
|
int len;
|
|
int len;
|
|
|
|
+ struct hci_st *lhst = (struct hci_st *)priv_data;
|
|
|
|
|
|
BTDRV_API_START();
|
|
BTDRV_API_START();
|
|
|
|
|
|
@@ -116,13 +118,13 @@ static long hci_st_receive(struct sk_buff *skb)
|
|
BTDRV_API_EXIT(-EFAULT);
|
|
BTDRV_API_EXIT(-EFAULT);
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
}
|
|
}
|
|
- if (!hst) {
|
|
|
|
|
|
+ if (!lhst) {
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
BT_DRV_ERR("Invalid hci_st memory,freeing SKB");
|
|
BT_DRV_ERR("Invalid hci_st memory,freeing SKB");
|
|
BTDRV_API_EXIT(-EFAULT);
|
|
BTDRV_API_EXIT(-EFAULT);
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
}
|
|
}
|
|
- if (!test_bit(BT_DRV_RUNNING, &hst->flags)) {
|
|
|
|
|
|
+ if (!test_bit(BT_DRV_RUNNING, &lhst->flags)) {
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
BT_DRV_ERR("Device is not running,freeing SKB");
|
|
BT_DRV_ERR("Device is not running,freeing SKB");
|
|
BTDRV_API_EXIT(-EINVAL);
|
|
BTDRV_API_EXIT(-EINVAL);
|
|
@@ -130,7 +132,7 @@ static long hci_st_receive(struct sk_buff *skb)
|
|
}
|
|
}
|
|
|
|
|
|
len = skb->len;
|
|
len = skb->len;
|
|
- skb->dev = (struct net_device *)hst->hdev;
|
|
|
|
|
|
+ skb->dev = (struct net_device *)lhst->hdev;
|
|
|
|
|
|
/* Forward skb to HCI CORE layer */
|
|
/* Forward skb to HCI CORE layer */
|
|
err = hci_recv_frame(skb);
|
|
err = hci_recv_frame(skb);
|
|
@@ -141,7 +143,7 @@ static long hci_st_receive(struct sk_buff *skb)
|
|
BTDRV_API_EXIT(err);
|
|
BTDRV_API_EXIT(err);
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
- hst->hdev->stat.byte_rx += len;
|
|
|
|
|
|
+ lhst->hdev->stat.byte_rx += len;
|
|
|
|
|
|
BTDRV_API_EXIT(0);
|
|
BTDRV_API_EXIT(0);
|
|
return 0;
|
|
return 0;
|
|
@@ -189,6 +191,11 @@ static int hci_st_open(struct hci_dev *hdev)
|
|
* make it as NULL */
|
|
* make it as NULL */
|
|
hci_st_proto.write = NULL;
|
|
hci_st_proto.write = NULL;
|
|
|
|
|
|
|
|
+ /* send in the hst to be received at registration complete callback
|
|
|
|
+ * and during st's receive
|
|
|
|
+ */
|
|
|
|
+ hci_st_proto.priv_data = hst;
|
|
|
|
+
|
|
/* Register with ST layer */
|
|
/* Register with ST layer */
|
|
err = st_register(&hci_st_proto);
|
|
err = st_register(&hci_st_proto);
|
|
if (err == -EINPROGRESS) {
|
|
if (err == -EINPROGRESS) {
|