Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291036
b: refs/heads/master
c: 490c5ba
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg committed Feb 23, 2012
1 parent aa48230 commit f2df57a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f9a903c57bb42b9f7ad8fb7867859d3252229ab
refs/heads/master: 490c5baba7a5ad80782d5eb778638d1cfc8d70ce
3 changes: 3 additions & 0 deletions trunk/include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ struct le_scan_params {
int timeout;
};

#define HCI_MAX_SHORT_NAME_LENGTH 10

#define NUM_REASSEMBLY 4
struct hci_dev {
struct list_head list;
Expand All @@ -141,6 +143,7 @@ struct hci_dev {
__u8 dev_type;
bdaddr_t bdaddr;
__u8 dev_name[HCI_MAX_NAME_LENGTH];
__u8 short_name[HCI_MAX_SHORT_NAME_LENGTH];
__u8 eir[HCI_MAX_EIR_LENGTH];
__u8 dev_class[3];
__u8 major_class;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/net/bluetooth/mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct mgmt_rp_read_index_list {
/* Reserve one extra byte for names in management messages so that they
* are always guaranteed to be nul-terminated */
#define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1)
#define MGMT_MAX_SHORT_NAME_LENGTH (10 + 1)
#define MGMT_MAX_SHORT_NAME_LENGTH (HCI_MAX_SHORT_NAME_LENGTH + 1)

#define MGMT_SETTING_POWERED 0x00000001
#define MGMT_SETTING_CONNECTABLE 0x00000002
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,9 @@ static int set_local_name(struct sock *sk, u16 index, void *data,
goto failed;
}

memcpy(hdev->short_name, mgmt_cp->short_name,
sizeof(hdev->short_name));

memcpy(hci_cp.name, mgmt_cp->name, sizeof(hci_cp.name));
err = hci_send_cmd(hdev, HCI_OP_WRITE_LOCAL_NAME, sizeof(hci_cp),
&hci_cp);
Expand Down

0 comments on commit f2df57a

Please sign in to comment.