linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Xinming Hu <huxm@marvell.com>
Cc: Xinming Hu <huxinming820@gmail.com>,
	Linux Wireless <linux-wireless@vger.kernel.org>,
	Kalle Valo <kvalo@codeaurora.org>,
	Dmitry Torokhov <dtor@google.com>,
	"rajatja@google.com" <rajatja@google.com>,
	Zhiyuan Yang <yangzy@marvell.com>, Tim Song <songtao@marvell.com>,
	Cathy Luo <cluo@marvell.com>, Ganapathi Bhat <gbhat@marvell.com>,
	James Cao <jcao@marvell.com>
Subject: Re: Re: [PATCH 3/3] mwifiex: debugfs: trigger device dump for usb interface
Date: Thu, 30 Nov 2017 08:32:56 -0800	[thread overview]
Message-ID: <20171130163254.GA87129@google.com> (raw)
In-Reply-To: <a14a1d7b6c0a4c91a85be955a813ee14@SC-EXCH02.marvell.com>

Hi Simon,

On Wed, Nov 15, 2017 at 11:31:05AM +0000, Xinming Hu wrote:
> > -----Original Message-----
> > From: Brian Norris [mailto:briannorris@chromium.org]
> > 
> > On Mon, Aug 14, 2017 at 12:19:03PM +0000, Xinming Hu wrote:
> > > diff --git a/drivers/net/wireless/marvell/mwifiex/debugfs.c
> > > b/drivers/net/wireless/marvell/mwifiex/debugfs.c
> > > index 6f4239b..5d476de 100644
> > > --- a/drivers/net/wireless/marvell/mwifiex/debugfs.c
> > > +++ b/drivers/net/wireless/marvell/mwifiex/debugfs.c
> > > @@ -168,10 +168,11 @@
> > >  {
> > >  	struct mwifiex_private *priv = file->private_data;
> > >
> > > -	if (!priv->adapter->if_ops.device_dump)
> > > -		return -EIO;
> > > -
> > > -	priv->adapter->if_ops.device_dump(priv->adapter);
> > > +	if (priv->adapter->iface_type == MWIFIEX_USB)
> > > +		mwifiex_send_cmd(priv, HostCmd_CMD_FW_DUMP_EVENT,
> > > +				 HostCmd_ACT_GEN_SET, 0, NULL, true);
> > 
> > Why couldn't you just implement the device_dump() callback?
> 
> Currently mwifiex_send_cmd function is not exported to external modules, it is designed for module mwifiex internal use.

If you really don't want to export mwifiex_send_cmd(), you can export
some other wrapper which does the logic for you. The point is that
there's a well defined point for determining how to dump the firmware
based on which interface you're using. You should use it.

> If we export mwifiex_send_cmd, and call it in mwifiex_usb. There will be a loop,

So? There are all sorts of interdependencies between mwifiex.ko and
mwifiex_usb.ko (or in your words, "loops").

> .Device_dump (module mwifiex_usb)  -->  mwifiex_send_cmd(module mwifiex)  --> .host_to_card (module mwifiex_usb)
> 
> This seems not an elegant design, right?

No less elegant than scattering:

	if (!USB)
		driver->this();
	else
		that();

all over the place.

> Regards,
> Simon
> > 
> > > +	else
> > > +		priv->adapter->if_ops.device_dump(priv->adapter);
> > >
> > >  	return 0;
> > >  }

Brian

      reply	other threads:[~2017-11-30 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 11:31 Re: [PATCH 3/3] mwifiex: debugfs: trigger device dump for usb interface Xinming Hu
2017-11-30 16:32 ` Brian Norris [this message]

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=20171130163254.GA87129@google.com \
    --to=briannorris@chromium.org \
    --cc=cluo@marvell.com \
    --cc=dtor@google.com \
    --cc=gbhat@marvell.com \
    --cc=huxinming820@gmail.com \
    --cc=huxm@marvell.com \
    --cc=jcao@marvell.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rajatja@google.com \
    --cc=songtao@marvell.com \
    --cc=yangzy@marvell.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).