Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314364
b: refs/heads/master
c: 9e2e0c8
h: refs/heads/master
v: v3
  • Loading branch information
Rajkumar Manoharan authored and John W. Linville committed Jun 13, 2012
1 parent cead9da commit 61f82b0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 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: 92a33298e9a329d4bed9f723811c5bedc7d92b9c
refs/heads/master: 9e2e0c84699ce7adeddb5cd5763956493ca7d331
48 changes: 24 additions & 24 deletions trunk/drivers/net/wireless/ath/ath9k/mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ ath_mci_find_profile(struct ath_mci_profile *mci,
{
struct ath_mci_profile_info *entry;

if (list_empty(&mci->info))
return NULL;

list_for_each_entry(entry, &mci->info, list) {
if (entry->conn_handle == info->conn_handle)
break;
return entry;
}
return entry;
return NULL;
}

static bool ath_mci_add_profile(struct ath_common *common,
Expand All @@ -49,31 +52,21 @@ static bool ath_mci_add_profile(struct ath_common *common,
(info->type != MCI_GPM_COEX_PROFILE_VOICE))
return false;

entry = ath_mci_find_profile(mci, info);

if (entry) {
memcpy(entry, info, 10);
} else {
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
return false;
entry = kzalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
return false;

memcpy(entry, info, 10);
INC_PROF(mci, info);
list_add_tail(&info->list, &mci->info);
}
memcpy(entry, info, 10);
INC_PROF(mci, info);
list_add_tail(&entry->list, &mci->info);

return true;
}

static void ath_mci_del_profile(struct ath_common *common,
struct ath_mci_profile *mci,
struct ath_mci_profile_info *info)
struct ath_mci_profile_info *entry)
{
struct ath_mci_profile_info *entry;

entry = ath_mci_find_profile(mci, info);

if (!entry)
return;

Expand All @@ -86,12 +79,16 @@ void ath_mci_flush_profile(struct ath_mci_profile *mci)
{
struct ath_mci_profile_info *info, *tinfo;

mci->aggr_limit = 0;

if (list_empty(&mci->info))
return;

list_for_each_entry_safe(info, tinfo, &mci->info, list) {
list_del(&info->list);
DEC_PROF(mci, info);
kfree(info);
}
mci->aggr_limit = 0;
}

static void ath_mci_adjust_aggr_limit(struct ath_btcoex *btcoex)
Expand Down Expand Up @@ -229,12 +226,17 @@ static void ath_mci_process_profile(struct ath_softc *sc,
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_btcoex *btcoex = &sc->btcoex;
struct ath_mci_profile *mci = &btcoex->mci;
struct ath_mci_profile_info *entry = NULL;

entry = ath_mci_find_profile(mci, info);
if (entry)
memcpy(entry, info, 10);

if (info->start) {
if (!ath_mci_add_profile(common, mci, info))
if (!entry && !ath_mci_add_profile(common, mci, info))
return;
} else
ath_mci_del_profile(common, mci, info);
ath_mci_del_profile(common, mci, entry);

btcoex->btcoex_period = ATH_MCI_DEF_BT_PERIOD;
mci->aggr_limit = mci->num_sco ? 6 : 0;
Expand Down Expand Up @@ -263,8 +265,6 @@ static void ath_mci_process_status(struct ath_softc *sc,
if (status->is_link)
return;

memset(&info, 0, sizeof(struct ath_mci_profile_info));

info.conn_handle = status->conn_handle;
if (ath_mci_find_profile(mci, &info))
return;
Expand Down

0 comments on commit 61f82b0

Please sign in to comment.