mirror of https://gitee.com/openkylin/linux.git
Bluetooth: Convert pend_le_conn list to a generic action list
In preparation to store also HCI_AUTO_CONN_REPORT entries in a list it makes sense to convert the existing pend_le_conn list head of hci_conn_params into a more generically named "action". This makes sense because a parameter entry will never participate in more than one action list. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
97bf2e9993
commit
93450c7544
|
@ -439,7 +439,7 @@ struct hci_chan {
|
||||||
|
|
||||||
struct hci_conn_params {
|
struct hci_conn_params {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
struct list_head pend_le_conn;
|
struct list_head action;
|
||||||
|
|
||||||
bdaddr_t addr;
|
bdaddr_t addr;
|
||||||
u8 addr_type;
|
u8 addr_type;
|
||||||
|
|
|
@ -3440,7 +3440,7 @@ struct hci_conn_params *hci_pend_le_conn_lookup(struct hci_dev *hdev,
|
||||||
if (!hci_is_identity_address(addr, addr_type))
|
if (!hci_is_identity_address(addr, addr_type))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
list_for_each_entry(param, &hdev->pend_le_conns, pend_le_conn) {
|
list_for_each_entry(param, &hdev->pend_le_conns, action) {
|
||||||
if (bacmp(¶m->addr, addr) == 0 &&
|
if (bacmp(¶m->addr, addr) == 0 &&
|
||||||
param->addr_type == addr_type)
|
param->addr_type == addr_type)
|
||||||
return param;
|
return param;
|
||||||
|
@ -3452,8 +3452,8 @@ struct hci_conn_params *hci_pend_le_conn_lookup(struct hci_dev *hdev,
|
||||||
/* This function requires the caller holds hdev->lock */
|
/* This function requires the caller holds hdev->lock */
|
||||||
void hci_pend_le_conn_add(struct hci_dev *hdev, struct hci_conn_params *params)
|
void hci_pend_le_conn_add(struct hci_dev *hdev, struct hci_conn_params *params)
|
||||||
{
|
{
|
||||||
list_del_init(¶ms->pend_le_conn);
|
list_del_init(¶ms->action);
|
||||||
list_add(¶ms->pend_le_conn, &hdev->pend_le_conns);
|
list_add(¶ms->action, &hdev->pend_le_conns);
|
||||||
|
|
||||||
BT_DBG("addr %pMR (type %u)", ¶ms->addr, params->addr_type);
|
BT_DBG("addr %pMR (type %u)", ¶ms->addr, params->addr_type);
|
||||||
|
|
||||||
|
@ -3463,7 +3463,7 @@ void hci_pend_le_conn_add(struct hci_dev *hdev, struct hci_conn_params *params)
|
||||||
/* This function requires the caller holds hdev->lock */
|
/* This function requires the caller holds hdev->lock */
|
||||||
void hci_pend_le_conn_del(struct hci_dev *hdev, struct hci_conn_params *params)
|
void hci_pend_le_conn_del(struct hci_dev *hdev, struct hci_conn_params *params)
|
||||||
{
|
{
|
||||||
list_del_init(¶ms->pend_le_conn);
|
list_del_init(¶ms->action);
|
||||||
|
|
||||||
BT_DBG("addr %pMR (type %u)", ¶ms->addr, params->addr_type);
|
BT_DBG("addr %pMR (type %u)", ¶ms->addr, params->addr_type);
|
||||||
|
|
||||||
|
@ -3504,7 +3504,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
|
||||||
params->addr_type = addr_type;
|
params->addr_type = addr_type;
|
||||||
|
|
||||||
list_add(¶ms->list, &hdev->le_conn_params);
|
list_add(¶ms->list, &hdev->le_conn_params);
|
||||||
INIT_LIST_HEAD(¶ms->pend_le_conn);
|
INIT_LIST_HEAD(¶ms->action);
|
||||||
|
|
||||||
params->conn_min_interval = hdev->le_conn_min_interval;
|
params->conn_min_interval = hdev->le_conn_min_interval;
|
||||||
params->conn_max_interval = hdev->le_conn_max_interval;
|
params->conn_max_interval = hdev->le_conn_max_interval;
|
||||||
|
|
Loading…
Reference in New Issue