* [PATCH 2/4] android/pan: Make NAP variables struc dev_struct independent
2015-01-13 14:30 [PATCH 1/4] android/pan: Minor style fix Grzegorz Kolodziejczyk
@ 2015-01-13 14:30 ` Grzegorz Kolodziejczyk
2015-01-13 14:30 ` [PATCH 3/4] android/pan: Change PAN record and name it as NAP record Grzegorz Kolodziejczyk
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-01-13 14:30 UTC (permalink / raw)
To: linux-bluetooth
There is no need to keep NAP sdp id, io, mode in structure. Remove nap
structure and take variables out.
---
android/pan.c | 39 ++++++++++++++++-----------------------
1 file changed, 16 insertions(+), 23 deletions(-)
diff --git a/android/pan.c b/android/pan.c
index 3ff8389..714e926 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -76,18 +76,11 @@ struct pan_device {
static bdaddr_t adapter_addr;
static GSList *devices = NULL;
static uint8_t local_role = HAL_PAN_ROLE_NONE;
+static uint32_t nap_rec_id = 0;
+static GIOChannel *nap_io = NULL;
+static bool nap_bridge_mode = false;
static struct ipc *hal_ipc = NULL;
-static struct {
- uint32_t record_id;
- GIOChannel *io;
- bool bridge;
-} nap_dev = {
- .record_id = 0,
- .io = NULL,
- .bridge = false,
-};
-
static int set_forward_delay(int sk)
{
unsigned long args[4] = { BRCTL_SET_BRIDGE_FORWARD_DELAY, 0 , 0, 0 };
@@ -112,7 +105,7 @@ static int nap_create_bridge(void)
DBG("%s", BNEP_BRIDGE);
- if (nap_dev.bridge)
+ if (nap_bridge_mode)
return 0;
sk = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
@@ -133,7 +126,7 @@ static int nap_create_bridge(void)
close(sk);
- nap_dev.bridge = err == 0;
+ nap_bridge_mode = err == 0;
return err;
}
@@ -169,7 +162,7 @@ static int nap_remove_bridge(void)
DBG("%s", BNEP_BRIDGE);
- if (!nap_dev.bridge)
+ if (!nap_bridge_mode)
return 0;
bridge_if_down();
@@ -187,7 +180,7 @@ static int nap_remove_bridge(void)
if (err < 0)
return err;
- nap_dev.bridge = false;
+ nap_bridge_mode = false;
return 0;
}
@@ -617,10 +610,10 @@ static void destroy_nap_device(void)
nap_remove_bridge();
- if (nap_dev.io) {
- g_io_channel_shutdown(nap_dev.io, FALSE, NULL);
- g_io_channel_unref(nap_dev.io);
- nap_dev.io = NULL;
+ if (nap_io) {
+ g_io_channel_shutdown(nap_io, FALSE, NULL);
+ g_io_channel_unref(nap_io);
+ nap_io = NULL;
}
}
@@ -630,7 +623,7 @@ static int register_nap_server(void)
DBG("");
- nap_dev.io = bt_io_listen(NULL, nap_confirm_cb, NULL, NULL, &gerr,
+ nap_io = bt_io_listen(NULL, nap_confirm_cb, NULL, NULL, &gerr,
BT_IO_OPT_SOURCE_BDADDR, &adapter_addr,
BT_IO_OPT_PSM, BNEP_PSM,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
@@ -638,7 +631,7 @@ static int register_nap_server(void)
BT_IO_OPT_IMTU, BNEP_MTU,
BT_IO_OPT_INVALID);
- if (!nap_dev.io) {
+ if (!nap_io) {
destroy_nap_device();
error("%s", gerr->message);
g_error_free(gerr);
@@ -828,7 +821,7 @@ bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
return false;
}
- nap_dev.record_id = rec->handle;
+ nap_rec_id = rec->handle;
hal_ipc = ipc;
ipc_register(hal_ipc, HAL_SERVICE_ID_PAN, cmd_handlers,
@@ -850,7 +843,7 @@ void bt_pan_unregister(void)
ipc_unregister(hal_ipc, HAL_SERVICE_ID_PAN);
hal_ipc = NULL;
- bt_adapter_remove_record(nap_dev.record_id);
- nap_dev.record_id = 0;
+ bt_adapter_remove_record(nap_rec_id);
+ nap_rec_id = 0;
destroy_nap_device();
}
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/4] android/pan: Change PAN record and name it as NAP record
2015-01-13 14:30 [PATCH 1/4] android/pan: Minor style fix Grzegorz Kolodziejczyk
2015-01-13 14:30 ` [PATCH 2/4] android/pan: Make NAP variables struc dev_struct independent Grzegorz Kolodziejczyk
@ 2015-01-13 14:30 ` Grzegorz Kolodziejczyk
2015-01-13 14:30 ` [PATCH 4/4] android/pan: Register PANU sdp record while registering PAN Grzegorz Kolodziejczyk
2015-01-22 12:18 ` [PATCH 1/4] android/pan: Minor style fix Szymon Janc
3 siblings, 0 replies; 6+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-01-13 14:30 UTC (permalink / raw)
To: linux-bluetooth
Current sdp record which is registering is NAP record it should be named
correctly.
---
android/pan.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/android/pan.c b/android/pan.c
index 714e926..e401001 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -710,10 +710,10 @@ static const struct ipc_handler cmd_handlers[] = {
{ bt_pan_disconnect, false, sizeof(struct hal_cmd_pan_disconnect) },
};
-static sdp_record_t *pan_record(void)
+static sdp_record_t *nap_record(void)
{
sdp_list_t *svclass, *pfseq, *apseq, *root, *aproto;
- uuid_t root_uuid, pan, l2cap, bnep;
+ uuid_t root_uuid, nap, l2cap, bnep;
sdp_profile_desc_t profile[1];
sdp_list_t *proto[2];
sdp_data_t *v, *p;
@@ -732,8 +732,8 @@ static sdp_record_t *pan_record(void)
record->attrlist = NULL;
record->pattern = NULL;
- sdp_uuid16_create(&pan, NAP_SVCLASS_ID);
- svclass = sdp_list_append(NULL, &pan);
+ sdp_uuid16_create(&nap, NAP_SVCLASS_ID);
+ svclass = sdp_list_append(NULL, &nap);
sdp_set_service_classes(record, svclass);
sdp_uuid16_create(&profile[0].uuid, NAP_PROFILE_ID);
@@ -787,41 +787,41 @@ static sdp_record_t *pan_record(void)
bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
{
- sdp_record_t *rec;
+ sdp_record_t *nap_rec;
int err;
DBG("");
bacpy(&adapter_addr, addr);
- rec = pan_record();
- if (!rec) {
+ nap_rec = nap_record();
+ if (!nap_rec) {
error("Failed to allocate PAN record");
return false;
}
- if (bt_adapter_add_record(rec, SVC_HINT_NETWORKING) < 0) {
+ if (bt_adapter_add_record(nap_rec, SVC_HINT_NETWORKING) < 0) {
error("Failed to register PAN record");
- sdp_record_free(rec);
+ sdp_record_free(nap_rec);
return false;
}
err = bnep_init();
if (err < 0) {
error("bnep init failed");
- bt_adapter_remove_record(rec->handle);
+ bt_adapter_remove_record(nap_rec->handle);
return false;
}
err = register_nap_server();
if (err < 0) {
error("Failed to register NAP");
- bt_adapter_remove_record(rec->handle);
+ bt_adapter_remove_record(nap_rec->handle);
bnep_cleanup();
return false;
}
- nap_rec_id = rec->handle;
+ nap_rec_id = nap_rec->handle;
hal_ipc = ipc;
ipc_register(hal_ipc, HAL_SERVICE_ID_PAN, cmd_handlers,
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 4/4] android/pan: Register PANU sdp record while registering PAN.
2015-01-13 14:30 [PATCH 1/4] android/pan: Minor style fix Grzegorz Kolodziejczyk
2015-01-13 14:30 ` [PATCH 2/4] android/pan: Make NAP variables struc dev_struct independent Grzegorz Kolodziejczyk
2015-01-13 14:30 ` [PATCH 3/4] android/pan: Change PAN record and name it as NAP record Grzegorz Kolodziejczyk
@ 2015-01-13 14:30 ` Grzegorz Kolodziejczyk
2015-01-22 12:26 ` Szymon Janc
2015-01-22 12:18 ` [PATCH 1/4] android/pan: Minor style fix Szymon Janc
3 siblings, 1 reply; 6+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-01-13 14:30 UTC (permalink / raw)
To: linux-bluetooth
This patch adds support for registering and unregistering PANU sdp
record.
It's related with PTS test case: TC_SDP_PANU_BV_01_C, which requires
PANU sdp record to be registered.
---
android/pan.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 88 insertions(+), 5 deletions(-)
diff --git a/android/pan.c b/android/pan.c
index e401001..181fbbf 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -77,6 +77,7 @@ static bdaddr_t adapter_addr;
static GSList *devices = NULL;
static uint8_t local_role = HAL_PAN_ROLE_NONE;
static uint32_t nap_rec_id = 0;
+static uint32_t panu_rec_id = 0;
static GIOChannel *nap_io = NULL;
static bool nap_bridge_mode = false;
static struct ipc *hal_ipc = NULL;
@@ -784,10 +785,84 @@ static sdp_record_t *nap_record(void)
return record;
}
+static sdp_record_t *panu_record(void)
+{
+ sdp_list_t *svclass, *pfseq, *apseq, *root, *aproto;
+ uuid_t root_uuid, panu, l2cap, bnep;
+ sdp_profile_desc_t profile[1];
+ sdp_list_t *proto[2];
+ sdp_data_t *v, *p;
+ uint16_t psm = BNEP_PSM, version = 0x0100;
+ uint16_t security = 0x0001, type = 0xfffe;
+ uint32_t rate = 0;
+ const char *desc = "PAN User", *name = "Network Service";
+ sdp_record_t *record;
+ uint16_t ptype[] = { 0x0800, /* IPv4 */ 0x0806, /* ARP */ };
+ sdp_data_t *head, *pseq, *data;
+
+ record = sdp_record_alloc();
+ if (!record)
+ return NULL;
+
+ record->attrlist = NULL;
+ record->pattern = NULL;
+
+ sdp_uuid16_create(&panu, PANU_SVCLASS_ID);
+ svclass = sdp_list_append(NULL, &panu);
+ sdp_set_service_classes(record, svclass);
+
+ sdp_uuid16_create(&profile[0].uuid, PANU_PROFILE_ID);
+ profile[0].version = 0x0100;
+ pfseq = sdp_list_append(NULL, &profile[0]);
+ sdp_set_profile_descs(record, pfseq);
+ sdp_set_info_attr(record, name, NULL, desc);
+ sdp_attr_add_new(record, SDP_ATTR_NET_ACCESS_TYPE, SDP_UINT16, &type);
+ sdp_attr_add_new(record, SDP_ATTR_MAX_NET_ACCESSRATE,
+ SDP_UINT32, &rate);
+
+ sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
+ root = sdp_list_append(NULL, &root_uuid);
+ sdp_set_browse_groups(record, root);
+
+ sdp_uuid16_create(&l2cap, L2CAP_UUID);
+ proto[0] = sdp_list_append(NULL, &l2cap);
+ p = sdp_data_alloc(SDP_UINT16, &psm);
+ proto[0] = sdp_list_append(proto[0], p);
+ apseq = sdp_list_append(NULL, proto[0]);
+
+ sdp_uuid16_create(&bnep, BNEP_UUID);
+ proto[1] = sdp_list_append(NULL, &bnep);
+ v = sdp_data_alloc(SDP_UINT16, &version);
+ proto[1] = sdp_list_append(proto[1], v);
+
+ head = sdp_data_alloc(SDP_UINT16, &ptype[0]);
+ data = sdp_data_alloc(SDP_UINT16, &ptype[1]);
+ sdp_seq_append(head, data);
+
+ pseq = sdp_data_alloc(SDP_SEQ16, head);
+ proto[1] = sdp_list_append(proto[1], pseq);
+ apseq = sdp_list_append(apseq, proto[1]);
+ aproto = sdp_list_append(NULL, apseq);
+ sdp_set_access_protos(record, aproto);
+ sdp_add_lang_attr(record);
+ sdp_attr_add_new(record, SDP_ATTR_SECURITY_DESC, SDP_UINT16, &security);
+
+ sdp_data_free(p);
+ sdp_data_free(v);
+ sdp_list_free(apseq, NULL);
+ sdp_list_free(root, NULL);
+ sdp_list_free(aproto, NULL);
+ sdp_list_free(proto[0], NULL);
+ sdp_list_free(proto[1], NULL);
+ sdp_list_free(svclass, NULL);
+ sdp_list_free(pfseq, NULL);
+
+ return record;
+}
bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
{
- sdp_record_t *nap_rec;
+ sdp_record_t *nap_rec, *panu_rec;
int err;
DBG("");
@@ -795,14 +870,17 @@ bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
bacpy(&adapter_addr, addr);
nap_rec = nap_record();
- if (!nap_rec) {
- error("Failed to allocate PAN record");
+ panu_rec = panu_record();
+ if (!nap_rec || !panu_rec) {
+ error("Failed to allocate PAN records");
return false;
}
- if (bt_adapter_add_record(nap_rec, SVC_HINT_NETWORKING) < 0) {
- error("Failed to register PAN record");
+ if (bt_adapter_add_record(nap_rec, SVC_HINT_NETWORKING) < 0 ||
+ bt_adapter_add_record(panu_rec, SVC_HINT_NETWORKING) < 0) {
+ error("Failed to register PAN records");
sdp_record_free(nap_rec);
+ sdp_record_free(panu_rec);
return false;
}
@@ -810,6 +888,7 @@ bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
if (err < 0) {
error("bnep init failed");
bt_adapter_remove_record(nap_rec->handle);
+ bt_adapter_remove_record(panu_rec->handle);
return false;
}
@@ -817,11 +896,13 @@ bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
if (err < 0) {
error("Failed to register NAP");
bt_adapter_remove_record(nap_rec->handle);
+ bt_adapter_remove_record(panu_rec->handle);
bnep_cleanup();
return false;
}
nap_rec_id = nap_rec->handle;
+ panu_rec_id = panu_rec->handle;
hal_ipc = ipc;
ipc_register(hal_ipc, HAL_SERVICE_ID_PAN, cmd_handlers,
@@ -844,6 +925,8 @@ void bt_pan_unregister(void)
hal_ipc = NULL;
bt_adapter_remove_record(nap_rec_id);
+ bt_adapter_remove_record(panu_rec_id);
nap_rec_id = 0;
+ panu_rec_id = 0;
destroy_nap_device();
}
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 4/4] android/pan: Register PANU sdp record while registering PAN.
2015-01-13 14:30 ` [PATCH 4/4] android/pan: Register PANU sdp record while registering PAN Grzegorz Kolodziejczyk
@ 2015-01-22 12:26 ` Szymon Janc
0 siblings, 0 replies; 6+ messages in thread
From: Szymon Janc @ 2015-01-22 12:26 UTC (permalink / raw)
To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth
Hi Grzegorz,
On Tuesday 13 of January 2015 15:30:53 Grzegorz Kolodziejczyk wrote:
> This patch adds support for registering and unregistering PANU sdp
> record.
> It's related with PTS test case: TC_SDP_PANU_BV_01_C, which requires
> PANU sdp record to be registered.
> ---
> android/pan.c | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 88 insertions(+), 5 deletions(-)
>
> diff --git a/android/pan.c b/android/pan.c
> index e401001..181fbbf 100644
> --- a/android/pan.c
> +++ b/android/pan.c
> @@ -77,6 +77,7 @@ static bdaddr_t adapter_addr;
> static GSList *devices = NULL;
> static uint8_t local_role = HAL_PAN_ROLE_NONE;
> static uint32_t nap_rec_id = 0;
> +static uint32_t panu_rec_id = 0;
> static GIOChannel *nap_io = NULL;
> static bool nap_bridge_mode = false;
> static struct ipc *hal_ipc = NULL;
> @@ -784,10 +785,84 @@ static sdp_record_t *nap_record(void)
>
> return record;
> }
> +static sdp_record_t *panu_record(void)
> +{
> + sdp_list_t *svclass, *pfseq, *apseq, *root, *aproto;
> + uuid_t root_uuid, panu, l2cap, bnep;
> + sdp_profile_desc_t profile[1];
> + sdp_list_t *proto[2];
> + sdp_data_t *v, *p;
> + uint16_t psm = BNEP_PSM, version = 0x0100;
> + uint16_t security = 0x0001, type = 0xfffe;
> + uint32_t rate = 0;
> + const char *desc = "PAN User", *name = "Network Service";
> + sdp_record_t *record;
> + uint16_t ptype[] = { 0x0800, /* IPv4 */ 0x0806, /* ARP */ };
> + sdp_data_t *head, *pseq, *data;
> +
> + record = sdp_record_alloc();
> + if (!record)
> + return NULL;
> +
> + record->attrlist = NULL;
> + record->pattern = NULL;
> +
> + sdp_uuid16_create(&panu, PANU_SVCLASS_ID);
> + svclass = sdp_list_append(NULL, &panu);
> + sdp_set_service_classes(record, svclass);
> +
> + sdp_uuid16_create(&profile[0].uuid, PANU_PROFILE_ID);
> + profile[0].version = 0x0100;
> + pfseq = sdp_list_append(NULL, &profile[0]);
> + sdp_set_profile_descs(record, pfseq);
> + sdp_set_info_attr(record, name, NULL, desc);
> + sdp_attr_add_new(record, SDP_ATTR_NET_ACCESS_TYPE, SDP_UINT16, &type);
> + sdp_attr_add_new(record, SDP_ATTR_MAX_NET_ACCESSRATE,
> + SDP_UINT32, &rate);
> +
> + sdp_uuid16_create(&root_uuid, PUBLIC_BROWSE_GROUP);
> + root = sdp_list_append(NULL, &root_uuid);
> + sdp_set_browse_groups(record, root);
> +
> + sdp_uuid16_create(&l2cap, L2CAP_UUID);
> + proto[0] = sdp_list_append(NULL, &l2cap);
> + p = sdp_data_alloc(SDP_UINT16, &psm);
> + proto[0] = sdp_list_append(proto[0], p);
> + apseq = sdp_list_append(NULL, proto[0]);
> +
> + sdp_uuid16_create(&bnep, BNEP_UUID);
> + proto[1] = sdp_list_append(NULL, &bnep);
> + v = sdp_data_alloc(SDP_UINT16, &version);
> + proto[1] = sdp_list_append(proto[1], v);
> +
> + head = sdp_data_alloc(SDP_UINT16, &ptype[0]);
> + data = sdp_data_alloc(SDP_UINT16, &ptype[1]);
> + sdp_seq_append(head, data);
> +
> + pseq = sdp_data_alloc(SDP_SEQ16, head);
> + proto[1] = sdp_list_append(proto[1], pseq);
> + apseq = sdp_list_append(apseq, proto[1]);
> + aproto = sdp_list_append(NULL, apseq);
> + sdp_set_access_protos(record, aproto);
> + sdp_add_lang_attr(record);
> + sdp_attr_add_new(record, SDP_ATTR_SECURITY_DESC, SDP_UINT16, &security);
> +
> + sdp_data_free(p);
> + sdp_data_free(v);
> + sdp_list_free(apseq, NULL);
> + sdp_list_free(root, NULL);
> + sdp_list_free(aproto, NULL);
> + sdp_list_free(proto[0], NULL);
> + sdp_list_free(proto[1], NULL);
> + sdp_list_free(svclass, NULL);
> + sdp_list_free(pfseq, NULL);
> +
> + return record;
> +}
>
> bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
> {
> - sdp_record_t *nap_rec;
> + sdp_record_t *nap_rec, *panu_rec;
> int err;
>
> DBG("");
> @@ -795,14 +870,17 @@ bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
> bacpy(&adapter_addr, addr);
>
> nap_rec = nap_record();
> - if (!nap_rec) {
> - error("Failed to allocate PAN record");
> + panu_rec = panu_record();
> + if (!nap_rec || !panu_rec) {
> + error("Failed to allocate PAN records");
> return false;
> }
Since you don't know which failed you may leak nap_rec here.
>
> - if (bt_adapter_add_record(nap_rec, SVC_HINT_NETWORKING) < 0) {
> - error("Failed to register PAN record");
> + if (bt_adapter_add_record(nap_rec, SVC_HINT_NETWORKING) < 0 ||
> + bt_adapter_add_record(panu_rec, SVC_HINT_NETWORKING) < 0) {
> + error("Failed to register PAN records");
> sdp_record_free(nap_rec);
> + sdp_record_free(panu_rec);
> return false;
> }
Same here, you could end up with nap_rec being left over.
Either do this in baby steps and cleanup after each failure or refactor this to
some 'goto error' path. Whatever fits you better.
>
> @@ -810,6 +888,7 @@ bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
> if (err < 0) {
> error("bnep init failed");
> bt_adapter_remove_record(nap_rec->handle);
> + bt_adapter_remove_record(panu_rec->handle);
> return false;
> }
>
> @@ -817,11 +896,13 @@ bool bt_pan_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
> if (err < 0) {
> error("Failed to register NAP");
> bt_adapter_remove_record(nap_rec->handle);
> + bt_adapter_remove_record(panu_rec->handle);
> bnep_cleanup();
> return false;
> }
>
> nap_rec_id = nap_rec->handle;
> + panu_rec_id = panu_rec->handle;
>
> hal_ipc = ipc;
> ipc_register(hal_ipc, HAL_SERVICE_ID_PAN, cmd_handlers,
> @@ -844,6 +925,8 @@ void bt_pan_unregister(void)
> hal_ipc = NULL;
>
> bt_adapter_remove_record(nap_rec_id);
> + bt_adapter_remove_record(panu_rec_id);
> nap_rec_id = 0;
> + panu_rec_id = 0;
I'd prefer if those were kept in pairs:
bt_adapter_remove_record(nap_rec_id);
nap_rec_id = 0;
bt_adapter_remove_record(panu_rec_id);
panu_rec_id = 0;
> destroy_nap_device();
> }
>
--
Best regards,
Szymon Janc
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] android/pan: Minor style fix
2015-01-13 14:30 [PATCH 1/4] android/pan: Minor style fix Grzegorz Kolodziejczyk
` (2 preceding siblings ...)
2015-01-13 14:30 ` [PATCH 4/4] android/pan: Register PANU sdp record while registering PAN Grzegorz Kolodziejczyk
@ 2015-01-22 12:18 ` Szymon Janc
3 siblings, 0 replies; 6+ messages in thread
From: Szymon Janc @ 2015-01-22 12:18 UTC (permalink / raw)
To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth
Hi Grzegorz,
On Tuesday 13 of January 2015 15:30:50 Grzegorz Kolodziejczyk wrote:
> Empty line added between function definitions. Tab indention added.
> Statics definitions should be placed after structures.
> ---
> android/pan.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/android/pan.c b/android/pan.c
> index 6131890..3ff8389 100644
> --- a/android/pan.c
> +++ b/android/pan.c
> @@ -63,11 +63,6 @@
> #define BNEP_PANU_INTERFACE "bt-pan"
> #define BNEP_NAP_INTERFACE "bt-pan%d"
>
> -static bdaddr_t adapter_addr;
> -static GSList *devices = NULL;
> -static uint8_t local_role = HAL_PAN_ROLE_NONE;
> -static struct ipc *hal_ipc = NULL;
> -
> struct pan_device {
> char iface[16];
> bdaddr_t dst;
> @@ -78,6 +73,11 @@ struct pan_device {
> guint watch;
> };
>
> +static bdaddr_t adapter_addr;
> +static GSList *devices = NULL;
> +static uint8_t local_role = HAL_PAN_ROLE_NONE;
> +static struct ipc *hal_ipc = NULL;
> +
> static struct {
> uint32_t record_id;
> GIOChannel *io;
> @@ -463,6 +463,7 @@ static gboolean nap_watchdog_cb(GIOChannel *chan, GIOCondition cond,
>
> return FALSE;
> }
> +
> static gboolean nap_setup_cb(GIOChannel *chan, GIOCondition cond,
> gpointer user_data)
> {
> @@ -488,7 +489,7 @@ static gboolean nap_setup_cb(GIOChannel *chan, GIOCondition cond,
>
> /* Highest known control command id BNEP_FILTER_MULT_ADDR_RSP 0x06 */
> if (req->type == BNEP_CONTROL &&
> - req->ctrl > BNEP_FILTER_MULT_ADDR_RSP) {
> + req->ctrl > BNEP_FILTER_MULT_ADDR_RSP) {
> error("cmd not understood");
> bnep_send_ctrl_rsp(sk, BNEP_CONTROL, BNEP_CMD_NOT_UNDERSTOOD,
> req->ctrl);
>
Patches 1-3 applied, thanks.
--
Best regards,
Szymon Janc
^ permalink raw reply [flat|nested] 6+ messages in thread