linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: igor.mitsyanko.os@quantenna.com, linux-wireless@vger.kernel.org
Cc: btherthala@quantenna.com, hwang@quantenna.com,
	smaksimenko@quantenna.com, dlebed@quantenna.com,
	Sergey Matyukevich <smatyukevich@quantenna.com>,
	Kamlesh Rath <krath@quantenna.com>,
	Avinash Patil <avinashp@quantenna.com>
Subject: Re: [PATCH V3] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets
Date: Mon, 14 Nov 2016 10:52:00 +0100	[thread overview]
Message-ID: <1479117120.9766.8.camel@sipsolutions.net> (raw)
In-Reply-To: <1478700000-11624-2-git-send-email-igor.mitsyanko.os@quantenna.com>


> +++ b/drivers/net/wireless/quantenna/qtnfmac/Kconfig
> @@ -0,0 +1,23 @@
> +config QTNFMAC
> +	tristate "Quantenna WiFi FullMAC WLAN driver"
> +	default n

No need to state that default explicitly, but it also doesn't really
matter.

> +	  it as a module, it will be called qtnfmac_pearl_pcie.ko.


Where did the "pearl" come from? You didn't mention that in the commit
log.

Also, are you planning to add any other things to this soon? It seems
to me that perhaps the PCIe option should be the only one that's user-
visible, selecting the other one internally?

> +	struct qtnf_bus_ops *bus_ops;

You should make that const and actually make all instances const, it's
better for security :)

> +/* Supported crypto cipher suits to be advertised to cfg80211 */
> +static const u32 qtnf_cipher_suites[] = {
> +	WLAN_CIPHER_SUITE_TKIP,
> +	WLAN_CIPHER_SUITE_CCMP,
> +	WLAN_CIPHER_SUITE_AES_CMAC,
> +};

I'm surprised - no WEP? No CMAC and GCMP/GMAC?


> +static int
> +qtnf_change_virtual_intf(struct wiphy *wiphy,
> +			 struct net_device *dev,
> +			 enum nl80211_iftype type, u32 *flags,
> +			 struct vif_params *params)
> +{
> +	struct qtnf_vif *vif;
> +	u8 *mac_addr;
> +
> +	vif = qtnf_netdev_get_priv(dev);
> +
> +	if (params)
> +		mac_addr = params->macaddr;
> +	else
> +		mac_addr = NULL;
> +
> +	if (qtnf_cmd_send_change_intf_type(vif, type, mac_addr)) {
> +		pr_err("failed to change interface type\n");
> +		return -EFAULT;

Maybe -EIO would be better.

> +struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy,
> +					   const char *name,
> +					   unsigned char
> name_assign_type,
> +					   enum nl80211_iftype type,
> +					   u32 *flags,
> +					   struct vif_params
> *params)
> +{
> +	struct qtnf_wmac *mac;
> +	struct qtnf_vif *vif;
> +	u8 *mac_addr = NULL;
> +
> +	mac = wiphy_priv(wiphy);
> +
> +	if (!mac)
> +		return ERR_PTR(-EFAULT);
> +
> +	switch (type) {
> +	case NL80211_IFTYPE_STATION:
> +	case NL80211_IFTYPE_AP:
> +		vif = qtnf_get_free_vif(mac);
> +		if (!vif) {
> +			pr_err("could not get free private
> structure\n");
> +			return ERR_PTR(-EFAULT);
> +		}

This is probably fairly natural to do, and it's not the first driver to
do this (brcmfmac also does), but some users may assume that they can
add interfaces as much as they want, until they bring them up (netdev
open).

It's probably worth having a discussion about this behaviour difference
- not necessarily in the context of this driver submission though.

> +	if (qtnf_cmd_send_add_intf(vif, type, mac_addr)) {
> +		vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED;
> +		pr_err("failed to send add_intf command\n");
> +		return ERR_PTR(-EFAULT);

I can't really tell, does this leak "vif"?

OK I need to find another way to review this patch now, it's too big
for my email client to work responsively...

johannes

  reply	other threads:[~2016-11-14  9:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1478700000-11624-1-git-send-email-igor.mitsyanko.os@quantenna.com>
2016-11-09 14:00 ` [PATCH V3] qtnfmac: announcement of new FullMAC driver for Quantenna chipsets igor.mitsyanko.os
2016-11-14  9:52   ` Johannes Berg [this message]
     [not found]     ` <62102ba6-cae0-f00d-f989-3f2e9ea43d9b@quantenna.com>
2016-11-16 16:50       ` IgorMitsyanko
2016-11-17  8:51         ` Johannes Berg
2016-11-15  9:06   ` Johannes Berg
2016-11-16 16:47     ` IgorMitsyanko
2016-11-17  7:54       ` Johannes Berg
2016-11-09 15:56 ` [RFC] qtn: add FullMAC firmware for Quantenna QSR10G wifi device Johannes Berg
     [not found]   ` <2fcb5f28-808e-f296-7e91-e5185e7577c9@quantenna.com>
2016-11-09 21:05     ` Johannes Berg
2016-11-10 14:02       ` IgorMitsyanko
2016-11-11 11:35         ` Johannes Berg
2016-11-14  8:26           ` IgorMitsyanko
2016-11-14  9:40             ` Johannes Berg
2016-11-23 15:25             ` Kalle Valo
2016-11-23 16:45               ` igor.mitsyanko.os
2016-11-23 17:09               ` IgorMitsyanko
2016-11-24 11:59                 ` Kalle Valo
2016-11-25 10:16                   ` IgorMitsyanko
2016-12-23 15:12               ` igor.mitsyanko.os
2016-12-23 17:47                 ` Christian Lamparter
2016-11-22 14:44           ` IgorMitsyanko
2016-11-28 16:34             ` Kyle McMartin
2016-11-28 17:10               ` Oleksij Rempel
2016-11-28 17:33                 ` Oleksij Rempel
2016-11-28 19:01                   ` IgorMitsyanko
2016-11-29  3:49                     ` Oleksij Rempel
2016-11-29  9:10                       ` IgorMitsyanko
2016-11-29  9:34                         ` Arend Van Spriel
2016-11-29 10:22                           ` IgorMitsyanko
2016-11-28 22:07               ` IgorMitsyanko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479117120.9766.8.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=avinashp@quantenna.com \
    --cc=btherthala@quantenna.com \
    --cc=dlebed@quantenna.com \
    --cc=hwang@quantenna.com \
    --cc=igor.mitsyanko.os@quantenna.com \
    --cc=krath@quantenna.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=smaksimenko@quantenna.com \
    --cc=smatyukevich@quantenna.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).