mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-04 04:04:19 +00:00
Bluetooth: btmrvl: get rid of struct btmrvl_cmd
Replace this proprietary structure with the standard one (struct hci_command_hdr). Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
c037874ca2
commit
7d5b400cb0
@ -116,12 +116,6 @@ struct btmrvl_private {
|
|||||||
#define PS_SLEEP 0x01
|
#define PS_SLEEP 0x01
|
||||||
#define PS_AWAKE 0x00
|
#define PS_AWAKE 0x00
|
||||||
|
|
||||||
struct btmrvl_cmd {
|
|
||||||
__le16 ocf_ogf;
|
|
||||||
u8 length;
|
|
||||||
u8 data[4];
|
|
||||||
} __packed;
|
|
||||||
|
|
||||||
struct btmrvl_event {
|
struct btmrvl_event {
|
||||||
u8 ec; /* event counter */
|
u8 ec; /* event counter */
|
||||||
u8 length;
|
u8 length;
|
||||||
|
@ -170,20 +170,20 @@ static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 cmd_no,
|
|||||||
const void *param, u8 len)
|
const void *param, u8 len)
|
||||||
{
|
{
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct btmrvl_cmd *cmd;
|
struct hci_command_hdr *hdr;
|
||||||
|
|
||||||
skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
|
skb = bt_skb_alloc(HCI_COMMAND_HDR_SIZE + len, GFP_ATOMIC);
|
||||||
if (skb == NULL) {
|
if (skb == NULL) {
|
||||||
BT_ERR("No free skb");
|
BT_ERR("No free skb");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
|
hdr = (struct hci_command_hdr *)skb_put(skb, HCI_COMMAND_HDR_SIZE);
|
||||||
cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF, cmd_no));
|
hdr->opcode = cpu_to_le16(hci_opcode_pack(OGF, cmd_no));
|
||||||
cmd->length = len;
|
hdr->plen = len;
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
memcpy(cmd->data, param, len);
|
memcpy(skb_put(skb, len), param, len);
|
||||||
|
|
||||||
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user