hci_sock.c (98817a84ff1c755c347ac633ff017a623a631fad) | hci_sock.c (19186c7b45c134820ea6fde3165a2cf30c1ace47) |
---|---|
1/* 2 BlueZ - Bluetooth protocol stack for Linux 3 Copyright (C) 2000-2001 Qualcomm Incorporated 4 5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License version 2 as --- 38 unchanged lines hidden (view full) --- 47 48/* Socket info */ 49#define hci_pi(sk) ((struct hci_pinfo *) sk) 50 51struct hci_pinfo { 52 struct bt_sock bt; 53 struct hci_dev *hdev; 54 struct hci_filter filter; | 1/* 2 BlueZ - Bluetooth protocol stack for Linux 3 Copyright (C) 2000-2001 Qualcomm Incorporated 4 5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License version 2 as --- 38 unchanged lines hidden (view full) --- 47 48/* Socket info */ 49#define hci_pi(sk) ((struct hci_pinfo *) sk) 50 51struct hci_pinfo { 52 struct bt_sock bt; 53 struct hci_dev *hdev; 54 struct hci_filter filter; |
55 __u32 cmsg_mask; | 55 __u8 cmsg_mask; |
56 unsigned short channel; 57 unsigned long flags; 58 __u32 cookie; 59 char comm[TASK_COMM_LEN]; 60}; 61 62void hci_sock_set_flag(struct sock *sk, int nr) 63{ --- 374 unchanged lines hidden (view full) --- 438 return NULL; 439 440 opcode = cpu_to_le16(HCI_MON_DEL_INDEX); 441 break; 442 443 case HCI_DEV_SETUP: 444 if (hdev->manufacturer == 0xffff) 445 return NULL; | 56 unsigned short channel; 57 unsigned long flags; 58 __u32 cookie; 59 char comm[TASK_COMM_LEN]; 60}; 61 62void hci_sock_set_flag(struct sock *sk, int nr) 63{ --- 374 unchanged lines hidden (view full) --- 438 return NULL; 439 440 opcode = cpu_to_le16(HCI_MON_DEL_INDEX); 441 break; 442 443 case HCI_DEV_SETUP: 444 if (hdev->manufacturer == 0xffff) 445 return NULL; |
446 fallthrough; |
|
446 | 447 |
447 /* fall through */ 448 | |
449 case HCI_DEV_UP: 450 skb = bt_skb_alloc(HCI_MON_INDEX_INFO_SIZE, GFP_ATOMIC); 451 if (!skb) 452 return NULL; 453 454 ii = skb_put(skb, HCI_MON_INDEX_INFO_SIZE); 455 bacpy(&ii->bdaddr, &hdev->bdaddr); 456 ii->manufacturer = cpu_to_le16(hdev->manufacturer); --- 937 unchanged lines hidden (view full) --- 1394done: 1395 release_sock(sk); 1396 return err; 1397} 1398 1399static void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, 1400 struct sk_buff *skb) 1401{ | 448 case HCI_DEV_UP: 449 skb = bt_skb_alloc(HCI_MON_INDEX_INFO_SIZE, GFP_ATOMIC); 450 if (!skb) 451 return NULL; 452 453 ii = skb_put(skb, HCI_MON_INDEX_INFO_SIZE); 454 bacpy(&ii->bdaddr, &hdev->bdaddr); 455 ii->manufacturer = cpu_to_le16(hdev->manufacturer); --- 937 unchanged lines hidden (view full) --- 1393done: 1394 release_sock(sk); 1395 return err; 1396} 1397 1398static void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, 1399 struct sk_buff *skb) 1400{ |
1402 __u32 mask = hci_pi(sk)->cmsg_mask; | 1401 __u8 mask = hci_pi(sk)->cmsg_mask; |
1403 1404 if (mask & HCI_CMSG_DIR) { 1405 int incoming = bt_cb(skb)->incoming; 1406 put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(incoming), 1407 &incoming); 1408 } 1409 1410 if (mask & HCI_CMSG_TSTAMP) { --- 690 unchanged lines hidden --- | 1402 1403 if (mask & HCI_CMSG_DIR) { 1404 int incoming = bt_cb(skb)->incoming; 1405 put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(incoming), 1406 &incoming); 1407 } 1408 1409 if (mask & HCI_CMSG_TSTAMP) { --- 690 unchanged lines hidden --- |