Re: [PATCH v6 3/6] Add support for Out of Band (OOB) association model in hciops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Szymon,

On Thu, Mar 24, 2011, Szymon Janc wrote:
> +static void remote_oob_data_request(int index, bdaddr_t *bdaddr)
>  {
>  	struct dev_info *dev = &devs[index];
> +	GSList *match;
>  
>  	DBG("hci%d", index);
>  
> -	hci_send_cmd(dev->sk, OGF_LINK_CTL,
> -				OCF_REMOTE_OOB_DATA_NEG_REPLY, 6, ptr);
> +	match = g_slist_find_custom(dev->oob_data, bdaddr, oob_bdaddr_cmp);
> +
> +	if (match) {
> +		struct oob_data *data;
> +		remote_oob_data_reply_cp cp;
> +
> +		data = match->data;
> +
> +		bacpy(&cp.bdaddr, &data->bdaddr);
> +		memcpy(cp.hash, data->hash, sizeof(cp.hash));
> +		memcpy(cp.randomizer, data->randomizer, sizeof(cp.randomizer));
> +
> +		dev->oob_data = g_slist_delete_link(dev->oob_data, match);
> +
> +		hci_send_cmd(dev->sk, OGF_LINK_CTL, OCF_REMOTE_OOB_DATA_REPLY,
> +				REMOTE_OOB_DATA_REPLY_CP_SIZE, &cp);
> +
> +	} else {
> +		hci_send_cmd(dev->sk, OGF_LINK_CTL,
> +				OCF_REMOTE_OOB_DATA_NEG_REPLY, 6, bdaddr);
> +	}
> +
>  }

Unnecessary empty line at the end of the function.

> +		data = g_new(struct oob_data, 1);
> +		bacpy(&data->bdaddr, bdaddr);
> +		dev->oob_data = g_slist_prepend(dev->oob_data, data);

Probably g_new0 would be better here (doesn't oob_data have more members
than just the bdaddr?

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux