Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bcfcc27 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: new NL command to get driver capabilities"

parents 69ac10db 9b70f358
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ wil6210-y += wil_crash_dump.o
wil6210-y += p2p.o
wil6210-y += ftm.o
wil6210-$(CONFIG_WIL6210_IPA) += ipa.o
wil6210-y += config.o

# for tracing framework to find trace.h
CFLAGS_trace.o := -I$(src)
+51 −7
Original line number Diff line number Diff line
@@ -44,13 +44,14 @@ static struct wiphy_wowlan_support wil_wowlan_support = {
};
#endif

static bool country_specific_board_file;
bool country_specific_board_file;
module_param(country_specific_board_file, bool, 0444);
MODULE_PARM_DESC(country_specific_board_file, " switch board file upon regulatory domain change (Default: false)");

static bool ignore_reg_hints = true;
bool ignore_reg_hints = true;
module_param(ignore_reg_hints, bool, 0444);
MODULE_PARM_DESC(ignore_reg_hints, " Ignore OTA regulatory hints (Default: true)");
MODULE_PARM_DESC(ignore_reg_hints,
		 " Ignore OTA regulatory hints (Default: true)");

#define CHAN60G(_channel, _flags) {				\
	.band			= NL80211_BAND_60GHZ,		\
@@ -142,6 +143,7 @@ enum wil_nl_60g_debug_cmd {
	NL_60G_DBG_FORCE_WMI_SEND,
	NL_60G_GEN_RADAR_ALLOC_BUFFER,
	NL_60G_GEN_FW_RESET,
	NL_60G_GEN_GET_DRIVER_CAPA,
};

struct wil_nl_60g_send_receive_wmi {
@@ -152,6 +154,21 @@ struct wil_nl_60g_send_receive_wmi {
	u8 buf[0];
} __packed;

enum wil_nl_60g_driver_capa {
	NL_60G_DRIVER_CAPA_WMI_OVER_NL, /* NL command for WMI */
	NL_60G_DRIVER_CAPA_FW_STATE, /* notifications of FW state changes */
	/* ioctl to write to the device address space */
	NL_60G_DRIVER_CAPA_IOCTL_WRITE,
};

struct wil_nl_60g_driver_capabilities_reply {
	u32 drv_cap[0]; /* bit mask of wil_nl_60g_driver_capa */
} __packed;

enum qca_wlan_vendor_driver_capa {
	QCA_WLAN_VENDOR_ATTR_DRIVER_CAPA,
};

struct wil_nl_60g_event {
	u32 evt_type; /* wil_nl_60g_evt_type */
	u32 buf_len;
@@ -2948,8 +2965,10 @@ static const struct cfg80211_ops wil_cfg80211_ops = {
	.update_ft_ies = wil_cfg80211_update_ft_ies,
};

static void wil_wiphy_init(struct wiphy *wiphy)
void wil_wiphy_init(struct wil6210_priv *wil)
{
	struct wiphy *wiphy = wil_to_wiphy(wil);

	wiphy->max_scan_ssids = 1;
	wiphy->max_scan_ie_len = WMI_MAX_IE_LEN;
	wiphy->max_remain_on_channel_duration = WIL_MAX_ROC_DURATION_MS;
@@ -3088,13 +3107,11 @@ struct wil6210_priv *wil_cfg80211_init(struct device *dev)
		return ERR_PTR(-ENOMEM);

	set_wiphy_dev(wiphy, dev);
	wil_wiphy_init(wiphy);

	wil = wiphy_to_wil(wiphy);
	wil->wiphy = wiphy;

	/* default monitor channel */
	ch = wiphy->bands[NL80211_BAND_60GHZ]->channels;
	ch = wil_band_60ghz.channels;
	cfg80211_chandef_create(&wil->monitor_chandef, ch, NL80211_CHAN_NO_HT);

	return wil;
@@ -3772,6 +3789,33 @@ static int wil_nl_60g_handle_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
			mutex_unlock(&wil->mutex);

			break;

		case NL_60G_GEN_GET_DRIVER_CAPA:
		{
			struct sk_buff *skb;
			u32 capa;

			skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
								  sizeof(capa));
			if (!skb)
				return -ENOMEM;

			capa = BIT(NL_60G_DRIVER_CAPA_FW_STATE) |
#if defined(CONFIG_WIL6210_WRITE_IOCTL)
			       BIT(NL_60G_DRIVER_CAPA_IOCTL_WRITE) |
#endif
			       BIT(NL_60G_DRIVER_CAPA_WMI_OVER_NL);
			rc = nla_put_u32(skb,
					 QCA_WLAN_VENDOR_ATTR_DRIVER_CAPA,
					 capa);
			if (rc) {
				wil_err(wil,
					"Failed to return driver capa\n");
				kfree_skb(skb);
				return rc;
			}
			return cfg80211_vendor_cmd_reply(skb);
		}
		default:
			rc = -EINVAL;
			wil_err(wil, "invalid debug_cmd id %d",
+737 −0

File added.

Preview size limit exceeded, changes collapsed.

+72 −0

File added.

Preview size limit exceeded, changes collapsed.

+25 −9

File changed.

Preview size limit exceeded, changes collapsed.

Loading