Skip to content

Commit

Permalink
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kva…
Browse files Browse the repository at this point in the history
…lo/ath.git

ath.git patches for v5.18. Major changes:

ath6kl

* add device ID for WLU5150-D81
  • Loading branch information
Kalle Valo committed Mar 10, 2022
2 parents 3b03fc9 + 83fe43a commit 1922260
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 83 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath10k/snoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,11 +1551,11 @@ static int ath10k_setup_msa_resources(struct ath10k *ar, u32 msa_size)
node = of_parse_phandle(dev->of_node, "memory-region", 0);
if (node) {
ret = of_address_to_resource(node, 0, &r);
of_node_put(node);
if (ret) {
dev_err(dev, "failed to resolve msa fixed region\n");
return ret;
}
of_node_put(node);

ar->msa.paddr = r.start;
ar->msa.mem_size = resource_size(&r);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/ath/ath11k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,6 @@ EXPORT_SYMBOL(ath11k_core_deinit);

void ath11k_core_free(struct ath11k_base *ab)
{
flush_workqueue(ab->workqueue);
destroy_workqueue(ab->workqueue);

kfree(ab);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ath/ath6kl/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,7 @@ static int ath6kl_usb_pm_resume(struct usb_interface *interface)
static const struct usb_device_id ath6kl_usb_ids[] = {
{USB_DEVICE(0x0cf3, 0x9375)},
{USB_DEVICE(0x0cf3, 0x9374)},
{USB_DEVICE(0x04da, 0x390d)},
{ /* Terminating entry */ },
};

Expand Down
22 changes: 4 additions & 18 deletions drivers/net/wireless/ath/ath6kl/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,6 @@ static int ath6kl_wmi_snr_threshold_event_rx(struct wmi *wmi, u8 *datap,

static int ath6kl_wmi_aplist_event_rx(struct wmi *wmi, u8 *datap, int len)
{
u16 ap_info_entry_size;
struct wmi_aplist_event *ev = (struct wmi_aplist_event *) datap;
struct wmi_ap_info_v1 *ap_info_v1;
u8 index;
Expand All @@ -1759,14 +1758,12 @@ static int ath6kl_wmi_aplist_event_rx(struct wmi *wmi, u8 *datap, int len)
ev->ap_list_ver != APLIST_VER1)
return -EINVAL;

ap_info_entry_size = sizeof(struct wmi_ap_info_v1);
ap_info_v1 = (struct wmi_ap_info_v1 *) ev->ap_list;

ath6kl_dbg(ATH6KL_DBG_WMI,
"number of APs in aplist event: %d\n", ev->num_ap);

if (len < (int) (sizeof(struct wmi_aplist_event) +
(ev->num_ap - 1) * ap_info_entry_size))
if (len < struct_size(ev, ap_list, ev->num_ap))
return -EINVAL;

/* AP list version 1 contents */
Expand Down Expand Up @@ -1959,21 +1956,15 @@ static int ath6kl_wmi_startscan_cmd(struct wmi *wmi, u8 if_idx,
{
struct sk_buff *skb;
struct wmi_start_scan_cmd *sc;
s8 size;
int i, ret;

size = sizeof(struct wmi_start_scan_cmd);

if ((scan_type != WMI_LONG_SCAN) && (scan_type != WMI_SHORT_SCAN))
return -EINVAL;

if (num_chan > WMI_MAX_CHANNELS)
return -EINVAL;

if (num_chan)
size += sizeof(u16) * (num_chan - 1);

skb = ath6kl_wmi_get_new_buf(size);
skb = ath6kl_wmi_get_new_buf(struct_size(sc, ch_list, num_chan));
if (!skb)
return -ENOMEM;

Expand Down Expand Up @@ -2008,7 +1999,7 @@ int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
struct ieee80211_supported_band *sband;
struct sk_buff *skb;
struct wmi_begin_scan_cmd *sc;
s8 size, *supp_rates;
s8 *supp_rates;
int i, band, ret;
struct ath6kl *ar = wmi->parent_dev;
int num_rates;
Expand All @@ -2023,18 +2014,13 @@ int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx,
num_chan, ch_list);
}

size = sizeof(struct wmi_begin_scan_cmd);

if ((scan_type != WMI_LONG_SCAN) && (scan_type != WMI_SHORT_SCAN))
return -EINVAL;

if (num_chan > WMI_MAX_CHANNELS)
return -EINVAL;

if (num_chan)
size += sizeof(u16) * (num_chan - 1);

skb = ath6kl_wmi_get_new_buf(size);
skb = ath6kl_wmi_get_new_buf(struct_size(sc, ch_list, num_chan));
if (!skb)
return -ENOMEM;

Expand Down
12 changes: 6 additions & 6 deletions drivers/net/wireless/ath/ath6kl/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ struct wmi_begin_scan_cmd {
u8 num_ch;

/* channels in Mhz */
__le16 ch_list[1];
__le16 ch_list[];
} __packed;

/* wmi_start_scan_cmd is to be deprecated. Use
Expand All @@ -889,7 +889,7 @@ struct wmi_start_scan_cmd {
u8 num_ch;

/* channels in Mhz */
__le16 ch_list[1];
__le16 ch_list[];
} __packed;

/*
Expand Down Expand Up @@ -1373,7 +1373,7 @@ struct wmi_channel_list_reply {
u8 num_ch;

/* channel in Mhz */
__le16 ch_list[1];
__le16 ch_list[];
} __packed;

/* List of Events (target to host) */
Expand Down Expand Up @@ -1545,7 +1545,7 @@ struct wmi_connect_event {
u8 beacon_ie_len;
u8 assoc_req_len;
u8 assoc_resp_len;
u8 assoc_info[1];
u8 assoc_info[];
} __packed;

/* Disconnect Event */
Expand Down Expand Up @@ -1596,7 +1596,7 @@ struct wmi_disconnect_event {
u8 disconn_reason;

u8 assoc_resp_len;
u8 assoc_info[1];
u8 assoc_info[];
} __packed;

/*
Expand Down Expand Up @@ -1957,7 +1957,7 @@ union wmi_ap_info {
struct wmi_aplist_event {
u8 ap_list_ver;
u8 num_ap;
union wmi_ap_info ap_list[1];
union wmi_ap_info ap_list[];
} __packed;

/* Developer Commands */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static bool ath_mci_add_profile(struct ath_common *common,
struct ath_mci_profile_info *info)
{
struct ath_mci_profile_info *entry;
u8 voice_priority[] = { 110, 110, 110, 112, 110, 110, 114, 116, 118 };
static const u8 voice_priority[] = { 110, 110, 110, 112, 110, 110, 114, 116, 118 };

if ((mci->num_sco == ATH_MCI_MAX_SCO_PROFILE) &&
(info->type == MCI_GPM_COEX_PROFILE_VOICE))
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/ath/carl9170/carl9170.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ struct ar9170 {
# define CARL9170_HWRNG_CACHE_SIZE CARL9170_MAX_CMD_PAYLOAD_LEN
struct {
struct hwrng rng;
bool initialized;
char name[30 + 1];
u16 cache[CARL9170_HWRNG_CACHE_SIZE / sizeof(u16)];
unsigned int cache_idx;
Expand Down
59 changes: 9 additions & 50 deletions drivers/net/wireless/ath/carl9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ static int carl9170_op_ampdu_action(struct ieee80211_hw *hw,
return -EOPNOTSUPP;

tid_info = kzalloc(sizeof(struct carl9170_sta_tid),
GFP_ATOMIC);
GFP_KERNEL);
if (!tid_info)
return -ENOMEM;

Expand Down Expand Up @@ -1494,7 +1494,7 @@ static int carl9170_register_wps_button(struct ar9170 *ar)
if (!(ar->features & CARL9170_WPS_BUTTON))
return 0;

input = input_allocate_device();
input = devm_input_allocate_device(&ar->udev->dev);
if (!input)
return -ENOMEM;

Expand All @@ -1512,10 +1512,8 @@ static int carl9170_register_wps_button(struct ar9170 *ar)
input_set_capability(input, EV_KEY, KEY_WPS_BUTTON);

err = input_register_device(input);
if (err) {
input_free_device(input);
if (err)
return err;
}

ar->wps.pbc = input;
return 0;
Expand All @@ -1539,7 +1537,7 @@ static int carl9170_rng_get(struct ar9170 *ar)

BUILD_BUG_ON(RB > CARL9170_MAX_CMD_PAYLOAD_LEN);

if (!IS_ACCEPTING_CMD(ar) || !ar->rng.initialized)
if (!IS_ACCEPTING_CMD(ar))
return -EAGAIN;

count = ARRAY_SIZE(ar->rng.cache);
Expand Down Expand Up @@ -1585,14 +1583,6 @@ static int carl9170_rng_read(struct hwrng *rng, u32 *data)
return sizeof(u16);
}

static void carl9170_unregister_hwrng(struct ar9170 *ar)
{
if (ar->rng.initialized) {
hwrng_unregister(&ar->rng.rng);
ar->rng.initialized = false;
}
}

static int carl9170_register_hwrng(struct ar9170 *ar)
{
int err;
Expand All @@ -1603,25 +1593,14 @@ static int carl9170_register_hwrng(struct ar9170 *ar)
ar->rng.rng.data_read = carl9170_rng_read;
ar->rng.rng.priv = (unsigned long)ar;

if (WARN_ON(ar->rng.initialized))
return -EALREADY;

err = hwrng_register(&ar->rng.rng);
err = devm_hwrng_register(&ar->udev->dev, &ar->rng.rng);
if (err) {
dev_err(&ar->udev->dev, "Failed to register the random "
"number generator (%d)\n", err);
return err;
}

ar->rng.initialized = true;

err = carl9170_rng_get(ar);
if (err) {
carl9170_unregister_hwrng(ar);
return err;
}

return 0;
return carl9170_rng_get(ar);
}
#endif /* CONFIG_CARL9170_HWRNG */

Expand Down Expand Up @@ -1937,7 +1916,8 @@ static int carl9170_parse_eeprom(struct ar9170 *ar)
if (!bands)
return -EINVAL;

ar->survey = kcalloc(chans, sizeof(struct survey_info), GFP_KERNEL);
ar->survey = devm_kcalloc(&ar->udev->dev, chans,
sizeof(struct survey_info), GFP_KERNEL);
if (!ar->survey)
return -ENOMEM;
ar->num_channels = chans;
Expand All @@ -1964,11 +1944,7 @@ int carl9170_register(struct ar9170 *ar)
struct ath_regulatory *regulatory = &ar->common.regulatory;
int err = 0, i;

if (WARN_ON(ar->mem_bitmap))
return -EINVAL;

ar->mem_bitmap = bitmap_zalloc(ar->fw.mem_blocks, GFP_KERNEL);

ar->mem_bitmap = devm_bitmap_zalloc(&ar->udev->dev, ar->fw.mem_blocks, GFP_KERNEL);
if (!ar->mem_bitmap)
return -ENOMEM;

Expand Down Expand Up @@ -2057,17 +2033,6 @@ void carl9170_unregister(struct ar9170 *ar)
carl9170_debugfs_unregister(ar);
#endif /* CONFIG_CARL9170_DEBUGFS */

#ifdef CONFIG_CARL9170_WPC
if (ar->wps.pbc) {
input_unregister_device(ar->wps.pbc);
ar->wps.pbc = NULL;
}
#endif /* CONFIG_CARL9170_WPC */

#ifdef CONFIG_CARL9170_HWRNG
carl9170_unregister_hwrng(ar);
#endif /* CONFIG_CARL9170_HWRNG */

carl9170_cancel_worker(ar);
cancel_work_sync(&ar->restart_work);

Expand All @@ -2082,12 +2047,6 @@ void carl9170_free(struct ar9170 *ar)
kfree_skb(ar->rx_failover);
ar->rx_failover = NULL;

bitmap_free(ar->mem_bitmap);
ar->mem_bitmap = NULL;

kfree(ar->survey);
ar->survey = NULL;

mutex_destroy(&ar->mutex);

ieee80211_free_hw(ar->hw);
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/ath/regd.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,14 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,

/*
* Some users have reported their EEPROM programmed with
* 0x8000 or 0x0 set, this is not a supported regulatory
* domain but since we have more than one user with it we
* need a solution for them. We default to 0x64, which is
* the default Atheros world regulatory domain.
* 0x8000 set, this is not a supported regulatory domain
* but since we have more than one user with it we need
* a solution for them. We default to 0x64, which is the
* default Atheros world regulatory domain.
*/
static void ath_regd_sanitize(struct ath_regulatory *reg)
{
if (reg->current_rd != COUNTRY_ERD_FLAG && reg->current_rd != 0)
if (reg->current_rd != COUNTRY_ERD_FLAG)
return;
printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n");
reg->current_rd = 0x64;
Expand Down

0 comments on commit 1922260

Please sign in to comment.