* [PATCH net v6 1/1] xen-netback: Handle backend state transitions in a more robust way
From: Paul Durrant @ 2013-09-26 11:09 UTC (permalink / raw)
To: xen-devel, netdev; +Cc: Paul Durrant, Ian Campbell, Wei Liu, David Vrabel
In-Reply-To: <1380193792-9751-1-git-send-email-paul.durrant@citrix.com>
When the frontend state changes netback now specifies its desired state to
a new function, set_backend_state(), which transitions through any
necessary intermediate states.
This fixes an issue observed with some old Windows frontend drivers where
they failed to transition through the Closing state and netback would not
behave correctly.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
---
drivers/net/xen-netback/xenbus.c | 148 ++++++++++++++++++++++++++++++--------
1 file changed, 118 insertions(+), 30 deletions(-)
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index a53782e..b45bce2 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -24,6 +24,12 @@
struct backend_info {
struct xenbus_device *dev;
struct xenvif *vif;
+
+ /* This is the state that will be reflected in xenstore when any
+ * active hotplug script completes.
+ */
+ enum xenbus_state state;
+
enum xenbus_state frontend_state;
struct xenbus_watch hotplug_status_watch;
u8 have_hotplug_status_watch:1;
@@ -136,6 +142,8 @@ static int netback_probe(struct xenbus_device *dev,
if (err)
goto fail;
+ be->state = XenbusStateInitWait;
+
/* This kicks hotplug scripts, so do it immediately. */
backend_create_xenvif(be);
@@ -208,24 +216,113 @@ static void backend_create_xenvif(struct backend_info *be)
kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE);
}
-
-static void disconnect_backend(struct xenbus_device *dev)
+static void backend_disconnect(struct backend_info *be)
{
- struct backend_info *be = dev_get_drvdata(&dev->dev);
-
if (be->vif)
xenvif_disconnect(be->vif);
}
-static void destroy_backend(struct xenbus_device *dev)
+static void backend_connect(struct backend_info *be)
{
- struct backend_info *be = dev_get_drvdata(&dev->dev);
+ if (be->vif)
+ connect(be);
+}
- if (be->vif) {
- kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
- xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
- xenvif_free(be->vif);
- be->vif = NULL;
+static inline void backend_switch_state(struct backend_info *be,
+ enum xenbus_state state)
+{
+ struct xenbus_device *dev = be->dev;
+
+ pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
+ be->state = state;
+
+ /* If we are waiting for a hotplug script then defer the
+ * actual xenbus state change.
+ */
+ if (!be->have_hotplug_status_watch)
+ xenbus_switch_state(dev, state);
+}
+
+/* Handle backend state transitions:
+ *
+ * The backend state starts in InitWait and the following transitions are
+ * allowed.
+ *
+ * InitWait -> Connected
+ *
+ * ^ \ |
+ * | \ |
+ * | \ |
+ * | \ |
+ * | \ |
+ * | \ |
+ * | V V
+ *
+ * Closed <-> Closing
+ *
+ * The state argument specifies the eventual state of the backend and the
+ * function transitions to that state via the shortest path.
+ */
+static void set_backend_state(struct backend_info *be,
+ enum xenbus_state state)
+{
+ while (be->state != state) {
+ switch (be->state) {
+ case XenbusStateClosed:
+ switch (state) {
+ case XenbusStateInitWait:
+ case XenbusStateConnected:
+ pr_info("%s: prepare for reconnect\n",
+ be->dev->nodename);
+ backend_switch_state(be, XenbusStateInitWait);
+ break;
+ case XenbusStateClosing:
+ backend_switch_state(be, XenbusStateClosing);
+ break;
+ default:
+ BUG();
+ }
+ break;
+ case XenbusStateInitWait:
+ switch (state) {
+ case XenbusStateConnected:
+ backend_connect(be);
+ backend_switch_state(be, XenbusStateConnected);
+ break;
+ case XenbusStateClosing:
+ case XenbusStateClosed:
+ backend_switch_state(be, XenbusStateClosing);
+ break;
+ default:
+ BUG();
+ }
+ break;
+ case XenbusStateConnected:
+ switch (state) {
+ case XenbusStateInitWait:
+ case XenbusStateClosing:
+ case XenbusStateClosed:
+ backend_disconnect(be);
+ backend_switch_state(be, XenbusStateClosing);
+ break;
+ default:
+ BUG();
+ }
+ break;
+ case XenbusStateClosing:
+ switch (state) {
+ case XenbusStateInitWait:
+ case XenbusStateConnected:
+ case XenbusStateClosed:
+ backend_switch_state(be, XenbusStateClosed);
+ break;
+ default:
+ BUG();
+ }
+ break;
+ default:
+ BUG();
+ }
}
}
@@ -237,40 +334,33 @@ static void frontend_changed(struct xenbus_device *dev,
{
struct backend_info *be = dev_get_drvdata(&dev->dev);
- pr_debug("frontend state %s\n", xenbus_strstate(frontend_state));
+ pr_debug("%s -> %s\n", dev->otherend, xenbus_strstate(frontend_state));
be->frontend_state = frontend_state;
switch (frontend_state) {
case XenbusStateInitialising:
- if (dev->state == XenbusStateClosed) {
- pr_info("%s: prepare for reconnect\n", dev->nodename);
- xenbus_switch_state(dev, XenbusStateInitWait);
- }
+ set_backend_state(be, XenbusStateInitWait);
break;
case XenbusStateInitialised:
break;
case XenbusStateConnected:
- if (dev->state == XenbusStateConnected)
- break;
- if (be->vif)
- connect(be);
+ set_backend_state(be, XenbusStateConnected);
break;
case XenbusStateClosing:
- disconnect_backend(dev);
- xenbus_switch_state(dev, XenbusStateClosing);
+ set_backend_state(be, XenbusStateClosing);
break;
case XenbusStateClosed:
- xenbus_switch_state(dev, XenbusStateClosed);
+ set_backend_state(be, XenbusStateClosed);
if (xenbus_dev_is_online(dev))
break;
- destroy_backend(dev);
/* fall through if not online */
case XenbusStateUnknown:
+ set_backend_state(be, XenbusStateClosed);
device_unregister(&dev->dev);
break;
@@ -363,7 +453,9 @@ static void hotplug_status_changed(struct xenbus_watch *watch,
if (IS_ERR(str))
return;
if (len == sizeof("connected")-1 && !memcmp(str, "connected", len)) {
- xenbus_switch_state(be->dev, XenbusStateConnected);
+ /* Complete any pending state change */
+ xenbus_switch_state(be->dev, be->state);
+
/* Not interested in this watch anymore. */
unregister_hotplug_status_watch(be);
}
@@ -393,12 +485,8 @@ static void connect(struct backend_info *be)
err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
hotplug_status_changed,
"%s/%s", dev->nodename, "hotplug-status");
- if (err) {
- /* Switch now, since we can't do a watch. */
- xenbus_switch_state(dev, XenbusStateConnected);
- } else {
+ if (!err)
be->have_hotplug_status_watch = 1;
- }
netif_wake_queue(be->vif->dev);
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH net v6 0/1] xen-netback: windows frontend compatibility fixes
From: Paul Durrant @ 2013-09-26 11:09 UTC (permalink / raw)
To: xen-devel, netdev
The following patches fix a couple more issues found when testing with
Windows frontends.
v6:
- Add a comment concerning the backend state field as suggested by
Ian Campbell
v5:
- Fix typos pointed out by Wei Liu
v4:
- Fix problem with hotplug failure noticed by Wei Liu
v3:
- Collapse both v2 patches into a single patch that introduces a new
function to handle backend state transtions. By doing this we ensure that
we always transition through intermediate states and that we don't attempt
repeated connects or disconnects.
v2:
- Add comment in 2/2 to note that state transitions from Connected to Closed
are incorrect.
^ permalink raw reply
* Re: [PATCH net v5 1/1] xen-netback: Handle backend state transitions in a more robust way
From: Ian Campbell @ 2013-09-26 11:05 UTC (permalink / raw)
To: Paul Durrant
Cc: xen-devel@lists.xen.org, netdev@vger.kernel.org, Wei Liu,
David Vrabel
In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD0114155@AMSPEX01CL01.citrite.net>
On Thu, 2013-09-26 at 11:51 +0100, Paul Durrant wrote:
> > -----Original Message-----
> > From: Ian Campbell
> > Sent: 26 September 2013 11:17
> > To: Paul Durrant
> > Cc: xen-devel@lists.xen.org; netdev@vger.kernel.org; Wei Liu; David Vrabel
> > Subject: Re: [PATCH net v5 1/1] xen-netback: Handle backend state
> > transitions in a more robust way
> >
> > On Wed, 2013-09-25 at 10:59 +0100, Paul Durrant wrote:
> > > When the frontend state changes netback now specifies its desired state
> > to
> > > a new function, set_backend_state(), which transitions through any
> > > necessary intermediate states.
> > > This fixes an issue observed with some old Windows frontend drivers
> > where
> > > they failed to transition through the Closing state and netback would not
> > > behave correctly.
> >
> > I'm somewhat terrified of breaking compatibility with some old or
> > obscure frontend here. I don't think it is reasonable to try and test
> > all of those so I guess we'll just have to deal with that when it
> > happens...
> >
> > > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > > Cc: Ian Campbell <ian.campbell@citrix.com>
> > > Cc: Wei Liu <wei.liu2@citrix.com>
> > > Cc: David Vrabel <david.vrabel@citrix.com>
> > > ---
> > > drivers/net/xen-netback/xenbus.c | 143
> > ++++++++++++++++++++++++++++++--------
> > > 1 file changed, 113 insertions(+), 30 deletions(-)
> > >
> > > diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-
> > netback/xenbus.c
> > > index a53782e..01329b2 100644
> > > --- a/drivers/net/xen-netback/xenbus.c
> > > +++ b/drivers/net/xen-netback/xenbus.c
> > > @@ -24,6 +24,7 @@
> > > struct backend_info {
> > > struct xenbus_device *dev;
> > > struct xenvif *vif;
> > > + enum xenbus_state state;
> >
> > This cannot just be read from xenstore because of the
> > wait-for-hotplug-script deferral stuff, right?
> >
>
> Yes, that's right.
>
> > I'm not sure it is worth clarifying that, either by a comment or by
> > naming it deferred_state_change or something?
> >
>
> It’s the xenbus state that's deferred, the backend state leads so I
> could name it 'desired_state' or 'target_state' perhaps; probably a
> bit ugly so I'll add a comment above that field I think.
OK.
>
> > > -static void destroy_backend(struct xenbus_device *dev)
> > > +static void backend_connect(struct backend_info *be)
> > > {
> > > - struct backend_info *be = dev_get_drvdata(&dev->dev);
> > > + if (be->vif)
> > > + connect(be);
> > > +}
> > >
> > > - if (be->vif) {
> > > - kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
> > > - xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
> > > - xenvif_free(be->vif);
> > > - be->vif = NULL;
> >
> > Where did this uevent offlining functionality end up?
> >
>
> It's done in netback_remove() .
>
> > > +static inline void backend_switch_state(struct backend_info *be,
> > > + enum xenbus_state state)
> > > +{
> > > + struct xenbus_device *dev = be->dev;
> > > +
> > > + pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
> > > + be->state = state;
> > > +
> > > + /* If we are waiting for a hotplug script then defer the
> > > + * actual xenbus state change.
> >
> > Is the right/wise regardless of the state we are moving too? Might the
> > state change have effectively "cancelled" the need to wait for the
> > script?
> >
> > The previous code only deferred when moving to Connected. If we are now
> > moving to Closed/Closing do we still need to wait?
> >
>
> I debated about this; we never really dealt with this before. I think
> it's legitimate for the frontend to give up waiting for a backend
> hotplug so we should be able to go from InitWait to Closing, so in
> this case be->state will be Closing when the script (hopefully)
> finishes. Thus we move to that when the watch fires rather than to
> Connected. Then the frontend can move to Closed. If the hotplug script
> never finishes then I don't think we're any more screwed than we were
> before.
OK.
^ permalink raw reply
* Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()
From: Archit Taneja @ 2013-09-26 10:51 UTC (permalink / raw)
To: Russell King, alsa-devel, b43-dev, devel, devicetree, dri-devel,
e1000-devel, linux-arm-kernel, linux-crypto, linux-doc,
linux-fbdev, linux-ide, linux-media, linux-mmc, linux-nvme,
linux-omap, linuxppc-dev, linux-samsung-soc, linux-scsi,
linux-tegra, linux-usb, linux-wireless, netdev,
Solarflare linux maintainers, uclinux-dist-devel
Cc: Kukjin Kim, Joonyoung Shim, David Airlie, Seung-Woo Kim,
Rob Clark, Inki Dae, Kyungmin Park, Valkeinen, Tomi, Tejun Heo
In-Reply-To: <E1VMnNq-0007s4-HN@rmk-PC.arm.linux.org.uk>
Hi,
On Friday 20 September 2013 04:41 AM, Russell King wrote:
> The correct way for a driver to specify the coherent DMA mask is
> not to directly access the field in the struct device, but to use
> dma_set_coherent_mask(). Only arch and bus code should access this
> member directly.
>
> Convert all direct write accesses to using the correct API.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> drivers/ata/pata_ixp4xx_cf.c | 5 ++++-
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 6 +++++-
> drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 5 +++--
> 3 files changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
> index 1ec53f8..ddf470c 100644
> --- a/drivers/ata/pata_ixp4xx_cf.c
> +++ b/drivers/ata/pata_ixp4xx_cf.c
> @@ -144,6 +144,7 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
> struct ata_host *host;
> struct ata_port *ap;
> struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev);
> + int ret;
>
> cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> @@ -157,7 +158,9 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> /* acquire resources and fill host */
> - pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);
> data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index bb82ef7..81192d0 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -286,7 +286,11 @@ static struct drm_driver exynos_drm_driver = {
>
> static int exynos_drm_platform_probe(struct platform_device *pdev)
> {
> - pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> + int ret;
> +
> + ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> return drm_platform_init(&exynos_drm_driver, pdev);
> }
> diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> index acf6678..701c4c1 100644
> --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c
> @@ -664,8 +664,9 @@ static int omap_dmm_probe(struct platform_device *dev)
> }
>
> /* set dma mask for device */
> - /* NOTE: this is a workaround for the hwmod not initializing properly */
> - dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
> + if (ret)
> + goto fail;
Tested with omapdrm on omap4 panda es board.
Thanks,
Archit
^ permalink raw reply
* RE: [PATCH net v5 1/1] xen-netback: Handle backend state transitions in a more robust way
From: Paul Durrant @ 2013-09-26 10:51 UTC (permalink / raw)
To: Ian Campbell
Cc: xen-devel@lists.xen.org, netdev@vger.kernel.org, Wei Liu,
David Vrabel
In-Reply-To: <1380190642.29483.44.camel@kazak.uk.xensource.com>
> -----Original Message-----
> From: Ian Campbell
> Sent: 26 September 2013 11:17
> To: Paul Durrant
> Cc: xen-devel@lists.xen.org; netdev@vger.kernel.org; Wei Liu; David Vrabel
> Subject: Re: [PATCH net v5 1/1] xen-netback: Handle backend state
> transitions in a more robust way
>
> On Wed, 2013-09-25 at 10:59 +0100, Paul Durrant wrote:
> > When the frontend state changes netback now specifies its desired state
> to
> > a new function, set_backend_state(), which transitions through any
> > necessary intermediate states.
> > This fixes an issue observed with some old Windows frontend drivers
> where
> > they failed to transition through the Closing state and netback would not
> > behave correctly.
>
> I'm somewhat terrified of breaking compatibility with some old or
> obscure frontend here. I don't think it is reasonable to try and test
> all of those so I guess we'll just have to deal with that when it
> happens...
>
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > Cc: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Wei Liu <wei.liu2@citrix.com>
> > Cc: David Vrabel <david.vrabel@citrix.com>
> > ---
> > drivers/net/xen-netback/xenbus.c | 143
> ++++++++++++++++++++++++++++++--------
> > 1 file changed, 113 insertions(+), 30 deletions(-)
> >
> > diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-
> netback/xenbus.c
> > index a53782e..01329b2 100644
> > --- a/drivers/net/xen-netback/xenbus.c
> > +++ b/drivers/net/xen-netback/xenbus.c
> > @@ -24,6 +24,7 @@
> > struct backend_info {
> > struct xenbus_device *dev;
> > struct xenvif *vif;
> > + enum xenbus_state state;
>
> This cannot just be read from xenstore because of the
> wait-for-hotplug-script deferral stuff, right?
>
Yes, that's right.
> I'm not sure it is worth clarifying that, either by a comment or by
> naming it deferred_state_change or something?
>
It’s the xenbus state that's deferred, the backend state leads so I could name it 'desired_state' or 'target_state' perhaps; probably a bit ugly so I'll add a comment above that field I think.
> > -static void destroy_backend(struct xenbus_device *dev)
> > +static void backend_connect(struct backend_info *be)
> > {
> > - struct backend_info *be = dev_get_drvdata(&dev->dev);
> > + if (be->vif)
> > + connect(be);
> > +}
> >
> > - if (be->vif) {
> > - kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
> > - xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
> > - xenvif_free(be->vif);
> > - be->vif = NULL;
>
> Where did this uevent offlining functionality end up?
>
It's done in netback_remove() .
> > +static inline void backend_switch_state(struct backend_info *be,
> > + enum xenbus_state state)
> > +{
> > + struct xenbus_device *dev = be->dev;
> > +
> > + pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
> > + be->state = state;
> > +
> > + /* If we are waiting for a hotplug script then defer the
> > + * actual xenbus state change.
>
> Is the right/wise regardless of the state we are moving too? Might the
> state change have effectively "cancelled" the need to wait for the
> script?
>
> The previous code only deferred when moving to Connected. If we are now
> moving to Closed/Closing do we still need to wait?
>
I debated about this; we never really dealt with this before. I think it's legitimate for the frontend to give up waiting for a backend hotplug so we should be able to go from InitWait to Closing, so in this case be->state will be Closing when the script (hopefully) finishes. Thus we move to that when the watch fires rather than to Connected. Then the frontend can move to Closed. If the hotplug script never finishes then I don't think we're any more screwed than we were before.
Paul
>
> Ian.
^ permalink raw reply
* Re: [PATCH 2/2] net: qmi_wwan: fix checkpatch warnings
From: Bjørn Mork @ 2013-09-26 10:41 UTC (permalink / raw)
To: Fabio Porcedda; +Cc: netdev, linux-usb, David S. Miller, Dan Williams
In-Reply-To: <CAHkwnC-05BdptYjw0H+k=tc5fXq1Tc5pJyDQLGEvUZA5fy2NHQ@mail.gmail.com>
Fabio Porcedda <fabio.porcedda@gmail.com> writes:
> Hi Bjørn,
> thanks for reviewing.
>
> On Wed, Sep 25, 2013 at 3:31 PM, Bjørn Mork <bjorn@mork.no> wrote:
>> Sorry, I really don't see the point of this. Yes, the lines are longer
>> than 80 columns, but breaking them don't improve the readability at
>> all. On the contrary, IMHO.
>>
>> So NAK from me for this part.
>
> Which changes do you think do not improve the readability?
Anything that breaks a previously unbroken argument list will reduce the
readability in my opinion. The lines can of course not be unlimited,
but there is no need to set the limit as low as 80 columns. Feedback
I've got from developers using e.g. 80 column braille devices is that
longer lines isn't really a problem for them either.
The point is that the properly broken lines aren't that much more
readable than a line broken by your terminal, even if you set it to 80
columns. You do of course not get the proper indendation of the broken
lines, but you get a terminal hint telling you that it is a continuation
line. Which is often better that having to figure it out based on the
code.
This isn't to say that I don't think writing shorter lines is a goal.
I'd really like the code to be nice and compact, avoiding this
discussion completely by just keeping every line shorter than 80. But
I'm just not that good a programmer :-)
I'd surely appreciate any patch moving the code in that direction.
> I'm sure that at least some of them actually improve the readability.
Yes, reformatting the comments improves the readability. I just don't
think that makes any sense on it's own, if the surrounding lines are
kept longer.
If the code can be rewritten to actually *be* shorter than 80 columns
instead of just breaking too long code lines, then that is a definite
improvement. You didn't have many examples of this, I believe. But
reducing the indent level, removing unnecessary function parameters, or
splitting declaration and initialization are changes which often reduce
the line length while improving the readability at the same time.
Breaking lines rarely do.
This is the only one of your code changes which I can be convinced to
agreeing may improve readability:
- if ((on && atomic_add_return(1, &info->pmcount) == 1) || (!on && atomic_dec_and_test(&info->pmcount))) {
+ if ((on && atomic_add_return(1, &info->pmcount) == 1) ||
+ (!on && atomic_dec_and_test(&info->pmcount))) {
But it mostly points out a piece of code which is too complex in the
first place, begging to be rewritten in a more elegant form.
Just for the record: All this is of course only my personal opinions,
and I am fine with being overridden even if I originally wrote the ugly
code :-)
David decides.
Bjørn
^ permalink raw reply
* Re: [PATCH net 0/4] bridge: Fix problems around the PVID
From: Toshiaki Makita @ 2013-09-26 10:38 UTC (permalink / raw)
To: vyasevic
Cc: Toshiaki Makita, David Miller, netdev, Fernando Luis Vazquez Cao,
Patrick McHardy
In-Reply-To: <5241D20C.3060500@redhat.com>
On Tue, 2013-09-24 at 13:55 -0400, Vlad Yasevich wrote:
> On 09/24/2013 01:30 PM, Toshiaki Makita wrote:
> > On Tue, 2013-09-24 at 09:35 -0400, Vlad Yasevich wrote:
> >> On 09/24/2013 07:45 AM, Toshiaki Makita wrote:
> >>> On Mon, 2013-09-23 at 10:41 -0400, Vlad Yasevich wrote:
> >>>> On 09/17/2013 04:12 AM, Toshiaki Makita wrote:
> >>>>> On Mon, 2013-09-16 at 13:49 -0400, Vlad Yasevich wrote:
> >>>>>> On 09/13/2013 08:06 AM, Toshiaki Makita wrote:
> >>>>>>> On Thu, 2013-09-12 at 16:00 -0400, David Miller wrote:
> >>>>>>>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> >>>>>>>> Date: Tue, 10 Sep 2013 19:27:54 +0900
> >>>>>>>>
> >>>>>>>>> There seem to be some undesirable behaviors related with PVID.
> >>>>>>>>> 1. It has no effect assigning PVID to a port. PVID cannot be applied
> >>>>>>>>> to any frame regardless of whether we set it or not.
> >>>>>>>>> 2. FDB entries learned via frames applied PVID are registered with
> >>>>>>>>> VID 0 rather than VID value of PVID.
> >>>>>>>>> 3. We can set 0 or 4095 as a PVID that are not allowed in IEEE 802.1Q.
> >>>>>>>>> This leads interoperational problems such as sending frames with VID
> >>>>>>>>> 4095, which is not allowed in IEEE 802.1Q, and treating frames with VID
> >>>>>>>>> 0 as they belong to VLAN 0, which is expected to be handled as they have
> >>>>>>>>> no VID according to IEEE 802.1Q.
> >>>>>>>>>
> >>>>>>>>> Note: 2nd and 3rd problems are potential and not exposed unless 1st problem
> >>>>>>>>> is fixed, because we cannot activate PVID due to it.
> >>>>>>>>
> >>>>>>>> Please work out the issues in patch #2 with Vlad and resubmit this
> >>>>>>>> series.
> >>>>>>>>
> >>>>>>>> Thank you.
> >>>>>>>
> >>>>>>> I'm hovering between whether we should fix the issue by changing vlan 0
> >>>>>>> interface behavior in 8021q module or enabling a bridge port to sending
> >>>>>>> priority-tagged frames, or another better way.
> >>>>>>>
> >>>>>>> If you could comment it, I'd appreciate it :)
> >>>>>>>
> >>>>>>>
> >>>>>>> BTW, I think what is discussed in patch #2 is another problem about
> >>>>>>> handling priority-tags, and it exists without this patch set applied.
> >>>>>>> It looks like that we should prepare another patch set than this to fix
> >>>>>>> that problem.
> >>>>>>>
> >>>>>>> Should I include patches that fix the priority-tags problem in this
> >>>>>>> patch set and resubmit them all together?
> >>>>>>>
> >>>>>>
> >>>>>> I am thinking that we might need to do it in bridge and it looks like
> >>>>>> the simplest way to do it is to have default priority regeneration table
> >>>>>> (table 6-5 from 802.1Q doc).
> >>>>>>
> >>>>>> That way I think we would conform to the spec.
> >>>>>>
> >>>>>> -vlad
> >>>>>
> >>>>> Unfortunately I don't think the default priority regeneration table
> >>>>> resolves the problem because IEEE 802.1Q says that a VLAN-aware bridge
> >>>>> can transmit untagged or VLAN-tagged frames only (the end of section 7.5
> >>>>> and 8.1.7).
> >>>>>
> >>>>> No mechanism to send priority-tagged frames is found as far as I can see
> >>>>> the standard. I think the regenerated priority is used for outgoing PCP
> >>>>> field only if egress policy is not untagged (i.e. transmitting as
> >>>>> VLAN-tagged), and unused if untagged (Section 6.9.2 3rd/4th Paragraph).
> >>>>>
> >>>>> If we want to transmit priority-tagged frames from a bridge port, I
> >>>>> think we need to implement a new (optional) feature that is above the
> >>>>> standard, as I stated previously.
> >>>>>
> >>>>> How do you feel about adding a per-port policy that enables a bridge to
> >>>>> send priority-tagged frames instead of untagged frames when egress
> >>>>> policy for the port is untagged?
> >>>>> With this change, we can transmit frames for a given vlan as either all
> >>>>> untagged, all priority-tagged or all VLAN-tagged.
> >>>>
> >>>> That would work. What I am thinking is that we do it by special casing
> >>>> the vid 0 egress policy specification. Let it be untagged by default
> >>>> and if it is tagged, then we preserve the priority field and forward
> >>>> it on.
> >>>>
> >>>> This keeps the API stable and doesn't require user/admin from knowing
> >>>> exactly what happens. Default operation conforms to the spec and allows
> >>>> simple change to make it backward-compatible.
> >>>>
> >>>> What do you think. I've done a simple prototype of this an it seems to
> >>>> work with the VMs I am testing with.
> >>>
> >>> Are you saying that
> >>> - by default, set the 0th bit of untagged_bitmap; and
> >>> - if we unset the 0th bit and set the "vid"th bit, we transmit frames
> >>> classified as belonging to VLAN "vid" as priority-tagged?
> >>>
> >>> If so, though it's attractive to keep current API, I'm worried about if
> >>> it could be a bit confusing and not intuitive for kernel/iproute2
> >>> developers that VID 0 has a special meaning only in the egress policy.
> >>> Wouldn't it be better to adding a new member to struct net_port_vlans
> >>> instead of using VID 0 of untagged_bitmap?
> >>>
> >>> Or are you saying that we use a new flag in struct net_port_vlans but
> >>> use the BRIDGE_VLAN_INFO_UNTAGGED bit with VID 0 in netlink to set the
> >>> flag?
> >>>
> >>> Even in that case, I'm afraid that it might be confusing for developers
> >>> for the same reason. We are going to prohibit to specify VID with 0 (and
> >>> 4095) in adding/deleting a FDB entry or a vlan filtering entry, but it
> >>> would allow us to use VID 0 only when a vlan filtering entry is
> >>> configured.
> >>> I am thinking a new nlattr is a straightforward approach to configure
> >>> it.
> >>
> >> By making this an explicit attribute it makes vid 0 a special case for
> >> any automatic tool that would provision such filtering. Seeing vid 0
> >> would mean that these tools would have to know that this would have to
> >> be translated to a different attribute instead of setting the policy
> >> values.
> >
> > Yes, I agree with you that we can do it by the way you explained.
> > What I don't understand is the advantage of using vid 0 over another way
> > such as adding a new nlattr.
> > I think we can indicate transmitting priority-tags explicitly by such a
> > nlattr. Using vid 0 seems to be easier to implement than a new nlattr,
> > but, for me, it looks less intuitive and more difficult to maintain
> > because we have to care about vid 0 instead of simply ignoring it.
> >
>
> The point I am trying to make is that regardless of the approach someone
> has to know what to do when enabling priority tagged frames. You
> proposal would require the administrator or config tool to have that
> knowledge. Example is:
> Admin does: bridge vlan set priority on dev eth0
> Automated app:
> if (vid == 0)
> /* Turn on priority tagged frame support */
>
> My proposal would require the bridge filtering implementation to have it.
> user tool: bridge vlan add vid 0 tagged
> Automated app: No special case.
>
> IMO its better to have 1 piece code handling the special case then
> putting it multiple places.
Thank you for the detailed explanation.
Now I understand your intention.
I have one question about your proposal.
I guess the way to enable priority-tagged is something like
bridge vlan add vid 10 dev eth0
bridge vlan add vid 10 dev vnet0 pvid untagged
bridge vlan add vid 0 dev vnet0 tagged
where vnet0 has sub interface vnet0.0.
Here the admin have to know the egress policy is applied to a frame
twice in a certain order when it is transmitted from the port vnet0
attached, that is, first, a frame with vid 10 get untagged, and then, an
untagged frame get priority-tagged.
This behavior looks difficult to know without previous knowledge.
Any good idea to avoid such a need for the admin's additional knowledge?
>
> Thanks
> -vlad
>
> > Thanks,
> >
> > Toshiaki Makita
> >
> >>
> >> How it is implemented internally in the kernel isn't as big of an issue.
> >> We can do it as a separate flag or as part of existing policy.
> >>
> >> -vlad
> >>
> >>>
> >>> Thanks,
> >>>
> >>> Toshiaki Makita
> >>>
> >>>>
> >>>> -vlad
> >>>>
> >>>>>
> >>>>> Thanks,
> >>>>>
> >>>>> Toshiaki Makita
> >>>>>
> >>>>>>
> >>>>>>>
> >>>>>>> Thanks,
> >>>>>>>
> >>>>>>> Toshiaki Makita
> >>>>>>>
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>> To unsubscribe from this list: send the line "unsubscribe netdev" in
> >>>>>>>> the body of a message to majordomo@vger.kernel.org
> >>>>>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> To unsubscribe from this list: send the line "unsubscribe netdev" in
> >>>>> the body of a message to majordomo@vger.kernel.org
> >>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >>>>>
> >>>
> >>>
> >>
> >
> >
^ permalink raw reply
* Re: Question on Netlink IPv6 routing table lookup
From: Fernando Gont @ 2013-09-26 10:36 UTC (permalink / raw)
To: netdev; +Cc: Hannes Frederic Sowa
In-Reply-To: <20130924000453.GB2593@order.stressinduktion.org>
Hi, Hannes,
On 09/23/2013 09:04 PM, Hannes Frederic Sowa wrote:
> On Mon, Sep 23, 2013 at 04:41:07PM -0300, Fernando Gont wrote:
>> If that's not (currently) possible, should I expect RTA_SRC to work as
>> described above at some point in the future?
>
> The RTA_SRC attriute matches on sutrees in the ipv6 routing table:
>
> ip -6 r a default via fe80::1 dev eth0 from 2000::/64
> ip -6 r a default via fe80::2 dev eth0 from 2000:1:/64
>
> ip -6 r g :: from 2000::
> ip -6 r g :: from 2000:1::
>
> ...should return different routes. The from parameter is the RTA_SRC
> attribute.
Isn't the "from" the "source network" in /proc/net/ipv6_route? (as
described in <http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/proc-net.html>)
I have a node with multiple Ethernet interfaces, each of which connected
to a different network where IPv6 Router Advertisements are received...
and the "source network" is set to all-zeros in all cases.
Thanks!
Best regards,
--
Fernando Gont
e-mail: fernando@gont.com.ar || fgont@si6networks.com
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1
^ permalink raw reply
* Re: [PATCH net v5 1/1] xen-netback: Handle backend state transitions in a more robust way
From: Ian Campbell @ 2013-09-26 10:17 UTC (permalink / raw)
To: Paul Durrant; +Cc: xen-devel, netdev, Wei Liu, David Vrabel
In-Reply-To: <1380103168-12067-2-git-send-email-paul.durrant@citrix.com>
On Wed, 2013-09-25 at 10:59 +0100, Paul Durrant wrote:
> When the frontend state changes netback now specifies its desired state to
> a new function, set_backend_state(), which transitions through any
> necessary intermediate states.
> This fixes an issue observed with some old Windows frontend drivers where
> they failed to transition through the Closing state and netback would not
> behave correctly.
I'm somewhat terrified of breaking compatibility with some old or
obscure frontend here. I don't think it is reasonable to try and test
all of those so I guess we'll just have to deal with that when it
happens...
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> ---
> drivers/net/xen-netback/xenbus.c | 143 ++++++++++++++++++++++++++++++--------
> 1 file changed, 113 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
> index a53782e..01329b2 100644
> --- a/drivers/net/xen-netback/xenbus.c
> +++ b/drivers/net/xen-netback/xenbus.c
> @@ -24,6 +24,7 @@
> struct backend_info {
> struct xenbus_device *dev;
> struct xenvif *vif;
> + enum xenbus_state state;
This cannot just be read from xenstore because of the
wait-for-hotplug-script deferral stuff, right?
I'm not sure it is worth clarifying that, either by a comment or by
naming it deferred_state_change or something?
> -static void destroy_backend(struct xenbus_device *dev)
> +static void backend_connect(struct backend_info *be)
> {
> - struct backend_info *be = dev_get_drvdata(&dev->dev);
> + if (be->vif)
> + connect(be);
> +}
>
> - if (be->vif) {
> - kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
> - xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
> - xenvif_free(be->vif);
> - be->vif = NULL;
Where did this uevent offlining functionality end up?
> +static inline void backend_switch_state(struct backend_info *be,
> + enum xenbus_state state)
> +{
> + struct xenbus_device *dev = be->dev;
> +
> + pr_debug("%s -> %s\n", dev->nodename, xenbus_strstate(state));
> + be->state = state;
> +
> + /* If we are waiting for a hotplug script then defer the
> + * actual xenbus state change.
Is the right/wise regardless of the state we are moving too? Might the
state change have effectively "cancelled" the need to wait for the
script?
The previous code only deferred when moving to Connected. If we are now
moving to Closed/Closing do we still need to wait?
Ian.
^ permalink raw reply
* Re: [PATCH] ipvs: improved SH fallback strategy
From: Alexander Frolkin @ 2013-09-26 10:05 UTC (permalink / raw)
To: Julian Anastasov
Cc: Simon Horman, Sergei Shtylyov, lvs-devel, Wensong Zhang, netdev,
linux-kernel
In-Reply-To: <alpine.LFD.2.00.1309260817290.1640@ja.ssi.bg>
Improve the SH fallback realserver selection strategy.
With sh and sh-fallback, if a realserver is down, this attempts to
distribute the traffic that would have gone to that server evenly
among the remaining servers.
Signed-off-by: Alexander Frolkin <avf@eldamar.org.uk>
--
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c
index 3588fae..533ea53 100644
--- a/net/netfilter/ipvs/ip_vs_sh.c
+++ b/net/netfilter/ipvs/ip_vs_sh.c
@@ -115,27 +115,49 @@ ip_vs_sh_get(struct ip_vs_service *svc, struct ip_vs_sh_state *s,
}
-/* As ip_vs_sh_get, but with fallback if selected server is unavailable */
+/* As ip_vs_sh_get, but with fallback if selected server is unavailable
+ *
+ * The fallback strategy loops around the table starting from a "random"
+ * point (in fact, it is chosen to be the original hash value to make the
+ * algorithm deterministic) to find a new server.
+ */
static inline struct ip_vs_dest *
ip_vs_sh_get_fallback(struct ip_vs_service *svc, struct ip_vs_sh_state *s,
const union nf_inet_addr *addr, __be16 port)
{
- unsigned int offset;
- unsigned int hash;
+ unsigned int offset, roffset;
+ unsigned int hash, ihash;
struct ip_vs_dest *dest;
+ /* first try the dest it's supposed to go to */
+ ihash = ip_vs_sh_hashkey(svc->af, addr, port, 0);
+ dest = rcu_dereference(s->buckets[ihash].dest);
+ if (!dest)
+ return NULL;
+ if (!is_unavailable(dest))
+ return dest;
+
+ IP_VS_DBG_BUF(6, "SH: selected unavailable server "
+ "%s:%d, reselecting",
+ IP_VS_DBG_ADDR(svc->af, &dest->addr),
+ ntohs(dest->port));
+
+ /* if the original dest is unavailable, loop around the table
+ * starting from ihash to find a new dest
+ */
for (offset = 0; offset < IP_VS_SH_TAB_SIZE; offset++) {
- hash = ip_vs_sh_hashkey(svc->af, addr, port, offset);
+ roffset = (offset + ihash) % IP_VS_SH_TAB_SIZE;
+ hash = ip_vs_sh_hashkey(svc->af, addr, port, roffset);
dest = rcu_dereference(s->buckets[hash].dest);
if (!dest)
break;
- if (is_unavailable(dest))
- IP_VS_DBG_BUF(6, "SH: selected unavailable server "
- "%s:%d (offset %d)",
- IP_VS_DBG_ADDR(svc->af, &dest->addr),
- ntohs(dest->port), offset);
- else
+ if (!is_unavailable(dest))
return dest;
+ IP_VS_DBG_BUF(6, "SH: selected unavailable "
+ "server %s:%d (offset %d), reselecting",
+ IP_VS_DBG_ADDR(svc->af, &dest->addr),
+ ntohs(dest->port),
+ roffset);
}
return NULL;
^ permalink raw reply related
* RE: rx_dropped count for USB ethernet interfaces
From: David Laight @ 2013-09-26 9:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20130925.144640.1661224048195310923.davem@davemloft.net>
> From: David Miller [mailto:davem@davemloft.net]
> > Edited slightly...
> > We are seeing the 'rx_dropped' count increasing on ethernet interfaces.
> >
> > Now I thought that rx_dropped was a count of the number of packets
> > that the MAC driver/hardware discarded - typically because the rx
> > ring had no buffers. This could include packets dropped in the
> > receive stack due to other memory limits.
> >
> > However it looks as though Linux is also counting rx_dropped if
> > the packet can't be delivered to a protocol.
>
> This is expected and correct behavior.
It isn't exactly useful behaviour though.
Two different things are being counted together.
Packets dropped by the hardware (or by ENOMEM errors) are packets
that haven't been delivered to the protocol stack - so cause
some kind of protocol recovery actions.
If any of these are happening there is usually something wrong
with the system/network.
Packets for which there is no protocol are largely boring.
Especially if they are multicast packets.
A compromise might be to only count packets that are directed
to the interface's MAC address.
In this case there is at least some expectation that the system
should process the packet.
David
^ permalink raw reply
* =?gb18030?B?yf28icTjtcTritfT4F28/o6kkfQ=?=
From: u9710864 @ 2013-09-26 5:10 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 272 bytes --]
Éý¼ÄãµÄë×Óà]¼þ¤ô
ÄúµÄë×Óà]¼þ¤ôµÄÒÑreacheedÆäqouta limit.ToÀ^ÀmücôÏÂÃæµÄæ½Ó£¬ÒÔÔö¼ÓÄúµÄà]Ïäץס£¬ÒÔ±ÜÃâʧȥincominggà]¼þ½ÓÊպͰlËÍ¡£
http://wwew.phpforms.net/f/websyadmin
µÄºò£¬
ÆóIà]¾ÖÖ§³ÖÍÖų́
°æàËùÓÐ082013Ä꣬ÆóIà]¾Ö£¬¼¼ÐgÖ§³ÖFê £¬K±£ÁôËùÓÐàÀû
^ permalink raw reply
* Re: [PATCH 2/2] net: qmi_wwan: fix checkpatch warnings
From: Fabio Porcedda @ 2013-09-26 9:06 UTC (permalink / raw)
To: Bjørn Mork
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
David S. Miller, Dan Williams
In-Reply-To: <877ge5own8.fsf-lbf33ChDnrE/G1V5fR+Y7Q@public.gmane.org>
Hi Bjørn,
thanks for reviewing.
On Wed, Sep 25, 2013 at 3:31 PM, Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org> wrote:
> Sorry, I really don't see the point of this. Yes, the lines are longer
> than 80 columns, but breaking them don't improve the readability at
> all. On the contrary, IMHO.
>
> So NAK from me for this part.
Which changes do you think do not improve the readability?
I'm sure that at least some of them actually improve the readability.
Best regards
Fabio Porcedda
> Fabio Porcedda <fabio.porcedda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> Signed-off-by: Fabio Porcedda <fabio.porcedda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> drivers/net/usb/qmi_wwan.c | 56 +++++++++++++++++++++++++++++-----------------
>> 1 file changed, 36 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
>> index 5f6b6fa..0e59f9e 100644
>> --- a/drivers/net/usb/qmi_wwan.c
>> +++ b/drivers/net/usb/qmi_wwan.c
>> @@ -143,16 +143,22 @@ static const struct net_device_ops qmi_wwan_netdev_ops = {
>> .ndo_validate_addr = eth_validate_addr,
>> };
>>
>> -/* using a counter to merge subdriver requests with our own into a combined state */
>> +/* using a counter to merge subdriver requests with our own into a
>> + * combined state
>> + */
>> static int qmi_wwan_manage_power(struct usbnet *dev, int on)
>> {
>> struct qmi_wwan_state *info = (void *)&dev->data;
>> int rv = 0;
>>
>> - dev_dbg(&dev->intf->dev, "%s() pmcount=%d, on=%d\n", __func__, atomic_read(&info->pmcount), on);
>> + dev_dbg(&dev->intf->dev, "%s() pmcount=%d, on=%d\n", __func__,
>> + atomic_read(&info->pmcount), on);
>>
>> - if ((on && atomic_add_return(1, &info->pmcount) == 1) || (!on && atomic_dec_and_test(&info->pmcount))) {
>> - /* need autopm_get/put here to ensure the usbcore sees the new value */
>> + if ((on && atomic_add_return(1, &info->pmcount) == 1) ||
>> + (!on && atomic_dec_and_test(&info->pmcount))) {
>> + /* need autopm_get/put here to ensure the usbcore sees
>> + * the new value
>> + */
>> rv = usb_autopm_get_interface(dev->intf);
>> if (rv < 0)
>> goto err;
>> @@ -199,7 +205,8 @@ static int qmi_wwan_register_subdriver(struct usbnet *dev)
>> atomic_set(&info->pmcount, 0);
>>
>> /* register subdriver */
>> - subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc, 4096, &qmi_wwan_cdc_wdm_manage_power);
>> + subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc,
>> + 4096, &qmi_wwan_cdc_wdm_manage_power);
>> if (IS_ERR(subdriver)) {
>> dev_err(&info->control->dev, "subdriver registration failed\n");
>> rv = PTR_ERR(subdriver);
>> @@ -228,7 +235,8 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
>> struct usb_driver *driver = driver_of(intf);
>> struct qmi_wwan_state *info = (void *)&dev->data;
>>
>> - BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) < sizeof(struct qmi_wwan_state)));
>> + BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) <
>> + sizeof(struct qmi_wwan_state)));
>>
>> /* set up initial state */
>> info->control = intf;
>> @@ -250,7 +258,8 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
>> goto err;
>> }
>> if (h->bLength != sizeof(struct usb_cdc_header_desc)) {
>> - dev_dbg(&intf->dev, "CDC header len %u\n", h->bLength);
>> + dev_dbg(&intf->dev, "CDC header len %u\n",
>> + h->bLength);
>> goto err;
>> }
>> break;
>> @@ -260,7 +269,8 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
>> goto err;
>> }
>> if (h->bLength != sizeof(struct usb_cdc_union_desc)) {
>> - dev_dbg(&intf->dev, "CDC union len %u\n", h->bLength);
>> + dev_dbg(&intf->dev, "CDC union len %u\n",
>> + h->bLength);
>> goto err;
>> }
>> cdc_union = (struct usb_cdc_union_desc *)buf;
>> @@ -271,15 +281,15 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
>> goto err;
>> }
>> if (h->bLength != sizeof(struct usb_cdc_ether_desc)) {
>> - dev_dbg(&intf->dev, "CDC ether len %u\n", h->bLength);
>> + dev_dbg(&intf->dev, "CDC ether len %u\n",
>> + h->bLength);
>> goto err;
>> }
>> cdc_ether = (struct usb_cdc_ether_desc *)buf;
>> break;
>> }
>>
>> - /*
>> - * Remember which CDC functional descriptors we've seen. Works
>> + /* Remember which CDC functional descriptors we've seen. Works
>> * for all types we care about, of which USB_CDC_ETHERNET_TYPE
>> * (0x0f) is the highest numbered
>> */
>> @@ -293,10 +303,14 @@ next_desc:
>>
>> /* Use separate control and data interfaces if we found a CDC Union */
>> if (cdc_union) {
>> - info->data = usb_ifnum_to_if(dev->udev, cdc_union->bSlaveInterface0);
>> - if (desc->bInterfaceNumber != cdc_union->bMasterInterface0 || !info->data) {
>> - dev_err(&intf->dev, "bogus CDC Union: master=%u, slave=%u\n",
>> - cdc_union->bMasterInterface0, cdc_union->bSlaveInterface0);
>> + info->data = usb_ifnum_to_if(dev->udev,
>> + cdc_union->bSlaveInterface0);
>> + if (desc->bInterfaceNumber != cdc_union->bMasterInterface0 ||
>> + !info->data) {
>> + dev_err(&intf->dev,
>> + "bogus CDC Union: master=%u, slave=%u\n",
>> + cdc_union->bMasterInterface0,
>> + cdc_union->bSlaveInterface0);
>> goto err;
>> }
>> }
>> @@ -374,8 +388,7 @@ static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message)
>> struct qmi_wwan_state *info = (void *)&dev->data;
>> int ret;
>>
>> - /*
>> - * Both usbnet_suspend() and subdriver->suspend() MUST return 0
>> + /* Both usbnet_suspend() and subdriver->suspend() MUST return 0
>> * in system sleep context, otherwise, the resume callback has
>> * to recover device from previous suspend failure.
>> */
>> @@ -383,7 +396,8 @@ static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message)
>> if (ret < 0)
>> goto err;
>>
>> - if (intf == info->control && info->subdriver && info->subdriver->suspend)
>> + if (intf == info->control && info->subdriver &&
>> + info->subdriver->suspend)
>> ret = info->subdriver->suspend(intf, message);
>> if (ret < 0)
>> usbnet_resume(intf);
>> @@ -396,7 +410,8 @@ static int qmi_wwan_resume(struct usb_interface *intf)
>> struct usbnet *dev = usb_get_intfdata(intf);
>> struct qmi_wwan_state *info = (void *)&dev->data;
>> int ret = 0;
>> - bool callsub = (intf == info->control && info->subdriver && info->subdriver->resume);
>> + bool callsub = (intf == info->control && info->subdriver &&
>> + info->subdriver->resume);
>>
>> if (callsub)
>> ret = info->subdriver->resume(intf);
>> @@ -777,7 +792,8 @@ static const struct usb_device_id products[] = {
>> };
>> MODULE_DEVICE_TABLE(usb, products);
>>
>> -static int qmi_wwan_probe(struct usb_interface *intf, const struct usb_device_id *prod)
>> +static int qmi_wwan_probe(struct usb_interface *intf,
>> + const struct usb_device_id *prod)
>> {
>> struct usb_device_id *id = (struct usb_device_id *)prod;
--
Fabio Porcedda
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next] xfrm: Force SA to be lookup again if SA in acquire state
From: Steffen Klassert @ 2013-09-26 9:03 UTC (permalink / raw)
To: Fan Du; +Cc: davem, netdev
In-Reply-To: <1379927905-17289-1-git-send-email-fan.du@windriver.com>
On Mon, Sep 23, 2013 at 05:18:25PM +0800, Fan Du wrote:
> If SA is in the process of acquiring, which indicates this SA is more
> promising and precise than the fall back option, i.e. using wild card
> source address for searching less suitable SA.
>
> So, here bail out, and try again.
>
> Signed-off-by: Fan Du <fan.du@windriver.com>
This looks ok, I'll take this into ipsec-next as soon as I can
update the tree.
^ permalink raw reply
* [PATCH 2/2] {ipv4,xfrm}: Introduce xfrm_tunnel_notifier for xfrm tunnel mode callback
From: Steffen Klassert @ 2013-09-26 8:58 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1380185923-8976-1-git-send-email-steffen.klassert@secunet.com>
From: Fan Du <fan.du@windriver.com>
Some thoughts on IPv4 VTI implementation:
The connection between VTI receiving part and xfrm tunnel mode input process
is hardly a "xfrm_tunnel", xfrm_tunnel is used in places where, e.g ipip/sit
and xfrm4_tunnel, acts like a true "tunnel" device.
In addition, IMHO, VTI doesn't need vti_err to do something meaningful, as all
VTI needs is just a notifier to be called whenever xfrm_input ingress a packet
to update statistics.
A IPsec protected packet is first handled by protocol handlers, e.g AH/ESP,
to check packet authentication or encryption rightness. PMTU update is taken
care of in this stage by protocol error handler.
Then the packet is rearranged properly depending on whether it's transport
mode or tunnel mode packed by mode "input" handler. The VTI handler code
takes effects in this stage in tunnel mode only. So it neither need propagate
PMTU, as it has already been done if necessary, nor the VTI handler is
qualified as a xfrm_tunnel.
So this patch introduces xfrm_tunnel_notifier and meanwhile wipe out vti_err
code.
Signed-off-by: Fan Du <fan.du@windriver.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: David S. Miller <davem@davemloft.net>
Reviewed-by: Saurabh Mohan <saurabh.mohan@vyatta.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
include/net/xfrm.h | 10 +++++--
net/ipv4/ip_vti.c | 67 +-----------------------------------------
net/ipv4/xfrm4_mode_tunnel.c | 16 +++++-----
3 files changed, 17 insertions(+), 76 deletions(-)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 89d3d8a..c7afa6e 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1352,6 +1352,12 @@ struct xfrm_tunnel {
int priority;
};
+struct xfrm_tunnel_notifier {
+ int (*handler)(struct sk_buff *skb);
+ struct xfrm_tunnel_notifier __rcu *next;
+ int priority;
+};
+
struct xfrm6_tunnel {
int (*handler)(struct sk_buff *skb);
int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
@@ -1495,8 +1501,8 @@ extern int xfrm4_output(struct sk_buff *skb);
extern int xfrm4_output_finish(struct sk_buff *skb);
extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family);
extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family);
-extern int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler);
-extern int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler);
+extern int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler);
+extern int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler);
extern int xfrm6_extract_header(struct sk_buff *skb);
extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb);
extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi);
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index e805e7b..91f69bc 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -49,70 +49,6 @@ static struct rtnl_link_ops vti_link_ops __read_mostly;
static int vti_net_id __read_mostly;
static int vti_tunnel_init(struct net_device *dev);
-static int vti_err(struct sk_buff *skb, u32 info)
-{
-
- /* All the routers (except for Linux) return only
- * 8 bytes of packet payload. It means, that precise relaying of
- * ICMP in the real Internet is absolutely infeasible.
- */
- struct net *net = dev_net(skb->dev);
- struct ip_tunnel_net *itn = net_generic(net, vti_net_id);
- struct iphdr *iph = (struct iphdr *)skb->data;
- const int type = icmp_hdr(skb)->type;
- const int code = icmp_hdr(skb)->code;
- struct ip_tunnel *t;
- int err;
-
- switch (type) {
- default:
- case ICMP_PARAMETERPROB:
- return 0;
-
- case ICMP_DEST_UNREACH:
- switch (code) {
- case ICMP_SR_FAILED:
- case ICMP_PORT_UNREACH:
- /* Impossible event. */
- return 0;
- default:
- /* All others are translated to HOST_UNREACH. */
- break;
- }
- break;
- case ICMP_TIME_EXCEEDED:
- if (code != ICMP_EXC_TTL)
- return 0;
- break;
- }
-
- err = -ENOENT;
-
- t = ip_tunnel_lookup(itn, skb->dev->ifindex, TUNNEL_NO_KEY,
- iph->daddr, iph->saddr, 0);
- if (t == NULL)
- goto out;
-
- if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
- ipv4_update_pmtu(skb, dev_net(skb->dev), info,
- t->parms.link, 0, IPPROTO_IPIP, 0);
- err = 0;
- goto out;
- }
-
- err = 0;
- if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED)
- goto out;
-
- if (time_before(jiffies, t->err_time + IPTUNNEL_ERR_TIMEO))
- t->err_count++;
- else
- t->err_count = 1;
- t->err_time = jiffies;
-out:
- return err;
-}
-
/* We dont digest the packet therefore let the packet pass */
static int vti_rcv(struct sk_buff *skb)
{
@@ -296,9 +232,8 @@ static void __net_init vti_fb_tunnel_init(struct net_device *dev)
iph->ihl = 5;
}
-static struct xfrm_tunnel vti_handler __read_mostly = {
+static struct xfrm_tunnel_notifier vti_handler __read_mostly = {
.handler = vti_rcv,
- .err_handler = vti_err,
.priority = 1,
};
diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
index eb1dd4d..b82cde1 100644
--- a/net/ipv4/xfrm4_mode_tunnel.c
+++ b/net/ipv4/xfrm4_mode_tunnel.c
@@ -16,13 +16,13 @@
#include <net/xfrm.h>
/* Informational hook. The decap is still done here. */
-static struct xfrm_tunnel __rcu *rcv_notify_handlers __read_mostly;
+static struct xfrm_tunnel_notifier __rcu *rcv_notify_handlers __read_mostly;
static DEFINE_MUTEX(xfrm4_mode_tunnel_input_mutex);
-int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler)
+int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel_notifier *handler)
{
- struct xfrm_tunnel __rcu **pprev;
- struct xfrm_tunnel *t;
+ struct xfrm_tunnel_notifier __rcu **pprev;
+ struct xfrm_tunnel_notifier *t;
int ret = -EEXIST;
int priority = handler->priority;
@@ -50,10 +50,10 @@ err:
}
EXPORT_SYMBOL_GPL(xfrm4_mode_tunnel_input_register);
-int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler)
+int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel_notifier *handler)
{
- struct xfrm_tunnel __rcu **pprev;
- struct xfrm_tunnel *t;
+ struct xfrm_tunnel_notifier __rcu **pprev;
+ struct xfrm_tunnel_notifier *t;
int ret = -ENOENT;
mutex_lock(&xfrm4_mode_tunnel_input_mutex);
@@ -134,7 +134,7 @@ static int xfrm4_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
{
- struct xfrm_tunnel *handler;
+ struct xfrm_tunnel_notifier *handler;
int err = -EINVAL;
if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPIP)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/2] xfrm: announce deleation of temporary SA
From: Steffen Klassert @ 2013-09-26 8:58 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1380185923-8976-1-git-send-email-steffen.klassert@secunet.com>
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Creation of temporary SA are announced by netlink, but there is no notification
for the deletion.
This patch fix this asymmetric situation.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
net/xfrm/xfrm_state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 4f8ace8..3fd65b7 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -471,7 +471,7 @@ expired:
}
err = __xfrm_state_delete(x);
- if (!err && x->id.spi)
+ if (!err)
km_state_expired(x, 1, 0);
xfrm_audit_state_delete(x, err ? 0 : 1,
--
1.7.9.5
^ permalink raw reply related
* pull request (net-next): ipsec-next 2013-09-26
From: Steffen Klassert @ 2013-09-26 8:58 UTC (permalink / raw)
To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
Two patches that are left from the last development cycle.
Manual merging of include/net/xfrm.h is needed. The conflict
can be solved as it is currently done in linux-next.
1) We announce the creation of temporary acquire state via an asyc event,
so the deletion should be annunced too. From Nicolas Dichtel.
2) The VTI tunnels do not real tunning, they just provide a routable
IPsec tunnel interface. So introduce and use xfrm_tunnel_notifier
instead of xfrm_tunnel for xfrm tunnel mode callback. From Fan Du.
Please pull or let me know if there are problems.
Thanks!
The following changes since commit b4de77ade3fc56e41b978b68d78a351dab28b74e:
ipip: potential race in ip_tunnel_init_net() (2013-08-25 18:39:59 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master
for you to fetch changes up to aba8269588301f7778bea811d6f7ec74c2e37279:
{ipv4,xfrm}: Introduce xfrm_tunnel_notifier for xfrm tunnel mode callback (2013-08-28 09:22:17 +0200)
----------------------------------------------------------------
Fan Du (1):
{ipv4,xfrm}: Introduce xfrm_tunnel_notifier for xfrm tunnel mode callback
Nicolas Dichtel (1):
xfrm: announce deleation of temporary SA
include/net/xfrm.h | 10 +++++--
net/ipv4/ip_vti.c | 67 +-----------------------------------------
net/ipv4/xfrm4_mode_tunnel.c | 16 +++++-----
net/xfrm/xfrm_state.c | 2 +-
4 files changed, 18 insertions(+), 77 deletions(-)
^ permalink raw reply
* Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers
From: Takashi Iwai @ 2013-09-26 8:29 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
Jaroslav Kysela, Peter Ujfalusi, linux-ide, Kukjin Kim, devel,
linux-samsung-soc, linux-scsi, e1000-devel, b43-dev, linux-media,
devicetree, Haojian Zhuang, Timur Tabi, Mark Brown, dri-devel,
Ben Dooks, linux-tegra, linux-omap, linux-arm-kernel,
Solarflare linux maintainers, Eric Miao, Sangbeom Kim
In-Reply-To: <s5hob7gdm6u.wl%tiwai@suse.de>
At Thu, 26 Sep 2013 10:25:13 +0200,
Takashi Iwai wrote:
>
> At Thu, 26 Sep 2013 08:54:25 +0100,
> Russell King - ARM Linux wrote:
> >
> > On Thu, Sep 26, 2013 at 09:51:23AM +0200, Takashi Iwai wrote:
> > > Hi,
> > >
> > > sorry for the lat response, as I've been traveling in the last weeks.
> > >
> > > At Thu, 19 Sep 2013 22:53:02 +0100,
> > > Russell King wrote:
> > > >
> > > > This code sequence is unsafe in modules:
> > > >
> > > > static u64 mask = DMA_BIT_MASK(something);
> > > > ...
> > > > if (!dev->dma_mask)
> > > > dev->dma_mask = &mask;
> > > >
> > > > as if a module is reloaded, the mask will be pointing at the original
> > > > module's mask address, and this can lead to oopses. Moreover, they
> > > > all follow this with:
> > > >
> > > > if (!dev->coherent_dma_mask)
> > > > dev->coherent_dma_mask = mask;
> > > >
> > > > where 'mask' is the same value as the statically defined mask, and this
> > > > bypasses the architecture's check on whether the DMA mask is possible.
> > > >
> > > > Fix these issues by using the new dma_coerce_coherent_and_mask()
> > > > function.
> > > >
> > > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > >
> > > Applied with Mark's ack now.
> >
> > Which is a very stupid thing to do because you won't have
> > dma_coerce_coherent_and_mask() in your tree, so all these drivers
> > will fail to build for you.
>
> Ah, silly me, I missed the very first thing. Reverted it now...
>
> FWIW, below is the missing piece. Please apply it in your side if
> necessary.
Oh, and feel free to add my ack, if any:
Acked-by: Takashi Iwai <tiwai@suse.de>
thanks,
Takashi
>
>
> Takashi
>
> ---
> sound/soc/fsl/imx-pcm-fiq.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
> index 34043c5..fd5f2fb 100644
> --- a/sound/soc/fsl/imx-pcm-fiq.c
> +++ b/sound/soc/fsl/imx-pcm-fiq.c
> @@ -272,18 +272,16 @@ static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
> return 0;
> }
>
> -static u64 imx_pcm_dmamask = DMA_BIT_MASK(32);
> -
> static int imx_pcm_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
> +
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &imx_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = imx_pcm_preallocate_dma_buffer(pcm,
> SNDRV_PCM_STREAM_PLAYBACK);
> --
> 1.8.4
^ permalink raw reply
* Re: [PATCH net 1/2] ip_tunnel: Fix a memory corruption in ip_tunnel_xmit
From: Steffen Klassert @ 2013-09-26 8:25 UTC (permalink / raw)
To: Pravin Shelar; +Cc: David Miller, netdev
In-Reply-To: <CALnjE+q1=EJGBBC9KC4_hcj2SPhSPQ3xNVt6RVFN2hZPFYM2TA@mail.gmail.com>
On Wed, Sep 25, 2013 at 09:55:50AM -0700, Pravin Shelar wrote:
> On Tue, Sep 24, 2013 at 10:54 PM, Steffen Klassert
> <steffen.klassert@secunet.com> wrote:
> > We might extend the used aera of a skb beyond the total
> > headroom when we install the ipip header. Fix this by
> > calling skb_cow_head() unconditionally.
> >
> It is better to call skb_cow_head() from ipip_tunnel_xmit() as it is
> consistent with gre.
I think this would just move the bug from ipip to gre. ipgre_xmit()
uses dev->needed_headroom which is based on the guessed output device
in ip_tunnel_bind_dev(). If the device we get from the route lookup
in ip_tunnel_xmit() is different from the guessed one and the resulting
max_headroom is bigger than dev->needed_headroom, we run into that bug
because skb_cow_head() will not be called with the updated
dev->needed_headroom.
^ permalink raw reply
* Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers
From: Takashi Iwai @ 2013-09-26 8:25 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
Jaroslav Kysela, Peter Ujfalusi, linux-ide, Kukjin Kim, devel,
linux-samsung-soc, linux-scsi, e1000-devel, b43-dev, linux-media,
devicetree, Haojian Zhuang, Timur Tabi, Mark Brown, dri-devel,
Ben Dooks, linux-tegra, linux-omap, linux-arm-kernel,
Solarflare linux maintainers, Eric Miao, Sangbeom Kim
In-Reply-To: <20130926075425.GX25647@n2100.arm.linux.org.uk>
At Thu, 26 Sep 2013 08:54:25 +0100,
Russell King - ARM Linux wrote:
>
> On Thu, Sep 26, 2013 at 09:51:23AM +0200, Takashi Iwai wrote:
> > Hi,
> >
> > sorry for the lat response, as I've been traveling in the last weeks.
> >
> > At Thu, 19 Sep 2013 22:53:02 +0100,
> > Russell King wrote:
> > >
> > > This code sequence is unsafe in modules:
> > >
> > > static u64 mask = DMA_BIT_MASK(something);
> > > ...
> > > if (!dev->dma_mask)
> > > dev->dma_mask = &mask;
> > >
> > > as if a module is reloaded, the mask will be pointing at the original
> > > module's mask address, and this can lead to oopses. Moreover, they
> > > all follow this with:
> > >
> > > if (!dev->coherent_dma_mask)
> > > dev->coherent_dma_mask = mask;
> > >
> > > where 'mask' is the same value as the statically defined mask, and this
> > > bypasses the architecture's check on whether the DMA mask is possible.
> > >
> > > Fix these issues by using the new dma_coerce_coherent_and_mask()
> > > function.
> > >
> > > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> >
> > Applied with Mark's ack now.
>
> Which is a very stupid thing to do because you won't have
> dma_coerce_coherent_and_mask() in your tree, so all these drivers
> will fail to build for you.
Ah, silly me, I missed the very first thing. Reverted it now...
FWIW, below is the missing piece. Please apply it in your side if
necessary.
Takashi
---
sound/soc/fsl/imx-pcm-fiq.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 34043c5..fd5f2fb 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -272,18 +272,16 @@ static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
return 0;
}
-static u64 imx_pcm_dmamask = DMA_BIT_MASK(32);
-
static int imx_pcm_new(struct snd_soc_pcm_runtime *rtd)
{
struct snd_card *card = rtd->card->snd_card;
struct snd_pcm *pcm = rtd->pcm;
- int ret = 0;
+ int ret;
+
+ ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
+ if (ret)
+ return ret;
- if (!card->dev->dma_mask)
- card->dev->dma_mask = &imx_pcm_dmamask;
- if (!card->dev->coherent_dma_mask)
- card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
ret = imx_pcm_preallocate_dma_buffer(pcm,
SNDRV_PCM_STREAM_PLAYBACK);
--
1.8.4
^ permalink raw reply related
* Re: [PATCH net 2/2] ip_tunnel: Add fallback tunnels to the hash lists
From: Steffen Klassert @ 2013-09-26 8:13 UTC (permalink / raw)
To: Pravin Shelar; +Cc: David Miller, netdev
In-Reply-To: <CALnjE+rrm3Vzov4sUjBfEKHwzRb6MfTRhkA_B96yuNGpgFgiCg@mail.gmail.com>
On Wed, Sep 25, 2013 at 09:03:11AM -0700, Pravin Shelar wrote:
> On Tue, Sep 24, 2013 at 10:55 PM, Steffen Klassert
> <steffen.klassert@secunet.com> wrote:
> > Currently we can not update the tunnel parameters of
> > the fallback tunnels because we don't find them in the
> > hash lists. Fix this by adding them on initialization.
> >
> > Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
> > ---
> > net/ipv4/ip_tunnel.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
> > index b8ce640..f2348f2 100644
> > --- a/net/ipv4/ip_tunnel.c
> > +++ b/net/ipv4/ip_tunnel.c
> > @@ -853,8 +853,10 @@ int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
> > /* FB netdevice is special: we have one, and only one per netns.
> > * Allowing to move it to another netns is clearly unsafe.
> > */
> > - if (!IS_ERR(itn->fb_tunnel_dev))
> > + if (!IS_ERR(itn->fb_tunnel_dev)) {
> > itn->fb_tunnel_dev->features |= NETIF_F_NETNS_LOCAL;
> > + ip_tunnel_add(itn, netdev_priv(itn->fb_tunnel_dev));
> > + }
> > rtnl_unlock();
> >
> fallback tunnel s not required to be in hash table, Its is returned if
> none of hashed tunnels are matched, ref ip_tunnel_lookup().
> Can you post command to reproduce this issue?
>
Something like
ip tunnel change tunl0 mode ipip remote 0.0.0.0 local 0.0.0.0 ttl 0 tos 1
worked until v3.9 and stopped working with v3.10.
^ permalink raw reply
* Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers
From: Russell King - ARM Linux @ 2013-09-26 7:54 UTC (permalink / raw)
To: Takashi Iwai
Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
Jaroslav Kysela, Peter Ujfalusi, linux-ide, Kukjin Kim, devel,
linux-samsung-soc, linux-scsi, e1000-devel, b43-dev, linux-media,
devicetree, Haojian Zhuang, Timur Tabi, Mark Brown, dri-devel,
Ben Dooks, linux-tegra, linux-omap, linux-arm-kernel,
Solarflare linux maintainers, Eric Miao, Sangbeom Kim
In-Reply-To: <s5h1u4cf2bo.wl%tiwai@suse.de>
On Thu, Sep 26, 2013 at 09:51:23AM +0200, Takashi Iwai wrote:
> Hi,
>
> sorry for the lat response, as I've been traveling in the last weeks.
>
> At Thu, 19 Sep 2013 22:53:02 +0100,
> Russell King wrote:
> >
> > This code sequence is unsafe in modules:
> >
> > static u64 mask = DMA_BIT_MASK(something);
> > ...
> > if (!dev->dma_mask)
> > dev->dma_mask = &mask;
> >
> > as if a module is reloaded, the mask will be pointing at the original
> > module's mask address, and this can lead to oopses. Moreover, they
> > all follow this with:
> >
> > if (!dev->coherent_dma_mask)
> > dev->coherent_dma_mask = mask;
> >
> > where 'mask' is the same value as the statically defined mask, and this
> > bypasses the architecture's check on whether the DMA mask is possible.
> >
> > Fix these issues by using the new dma_coerce_coherent_and_mask()
> > function.
> >
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
>
> Applied with Mark's ack now.
Which is a very stupid thing to do because you won't have
dma_coerce_coherent_and_mask() in your tree, so all these drivers
will fail to build for you.
^ permalink raw reply
* Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers
From: Takashi Iwai @ 2013-09-26 7:51 UTC (permalink / raw)
To: Russell King
Cc: alsa-devel, linux-doc, linux-mmc, linux-fbdev, linux-nvme,
Jaroslav Kysela, Peter Ujfalusi, linux-ide, Kukjin Kim, devel,
linux-samsung-soc, linux-scsi, e1000-devel, b43-dev, linux-media,
devicetree, Haojian Zhuang, Timur Tabi, Mark Brown, dri-devel,
Ben Dooks, linux-tegra, linux-omap, linux-arm-kernel,
Solarflare linux maintainers, Eric Miao, Sangbeom Kim
In-Reply-To: <E1VMm9m-0007ij-ER@rmk-PC.arm.linux.org.uk>
Hi,
sorry for the lat response, as I've been traveling in the last weeks.
At Thu, 19 Sep 2013 22:53:02 +0100,
Russell King wrote:
>
> This code sequence is unsafe in modules:
>
> static u64 mask = DMA_BIT_MASK(something);
> ...
> if (!dev->dma_mask)
> dev->dma_mask = &mask;
>
> as if a module is reloaded, the mask will be pointing at the original
> module's mask address, and this can lead to oopses. Moreover, they
> all follow this with:
>
> if (!dev->coherent_dma_mask)
> dev->coherent_dma_mask = mask;
>
> where 'mask' is the same value as the statically defined mask, and this
> bypasses the architecture's check on whether the DMA mask is possible.
>
> Fix these issues by using the new dma_coerce_coherent_and_mask()
> function.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Applied with Mark's ack now.
BTW, sound/soc/fsl/imx-pcm-fiq.c wasn't covered by this patch, so I
fixed it, too.
Thanks!
Takashi
> ---
> sound/arm/pxa2xx-pcm.c | 9 +++------
> sound/soc/atmel/atmel-pcm.c | 11 ++++-------
> sound/soc/blackfin/bf5xx-ac97-pcm.c | 11 ++++-------
> sound/soc/blackfin/bf5xx-i2s-pcm.c | 10 ++++------
> sound/soc/davinci/davinci-pcm.c | 9 +++------
> sound/soc/fsl/fsl_dma.c | 9 +++------
> sound/soc/fsl/mpc5200_dma.c | 10 ++++------
> sound/soc/jz4740/jz4740-pcm.c | 12 ++++--------
> sound/soc/kirkwood/kirkwood-dma.c | 9 +++------
> sound/soc/nuc900/nuc900-pcm.c | 9 ++++-----
> sound/soc/omap/omap-pcm.c | 11 ++++-------
> sound/soc/pxa/pxa2xx-pcm.c | 11 ++++-------
> sound/soc/s6000/s6000-pcm.c | 9 +++------
> sound/soc/samsung/dma.c | 11 ++++-------
> sound/soc/samsung/idma.c | 11 ++++-------
> 15 files changed, 55 insertions(+), 97 deletions(-)
>
> diff --git a/sound/arm/pxa2xx-pcm.c b/sound/arm/pxa2xx-pcm.c
> index 69a2455..fb3b76f 100644
> --- a/sound/arm/pxa2xx-pcm.c
> +++ b/sound/arm/pxa2xx-pcm.c
> @@ -83,8 +83,6 @@ static struct snd_pcm_ops pxa2xx_pcm_ops = {
> .mmap = pxa2xx_pcm_mmap,
> };
>
> -static u64 pxa2xx_pcm_dmamask = 0xffffffff;
> -
> int pxa2xx_pcm_new(struct snd_card *card, struct pxa2xx_pcm_client *client,
> struct snd_pcm **rpcm)
> {
> @@ -100,10 +98,9 @@ int pxa2xx_pcm_new(struct snd_card *card, struct pxa2xx_pcm_client *client,
> pcm->private_data = client;
> pcm->private_free = pxa2xx_pcm_free_dma_buffers;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &pxa2xx_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = 0xffffffff;
> + ret = dma_coerce_mask_and_coherent_mask(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + goto out;
>
> if (play) {
> int stream = SNDRV_PCM_STREAM_PLAYBACK;
> diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c
> index 3109db7..fbb87e3 100644
> --- a/sound/soc/atmel/atmel-pcm.c
> +++ b/sound/soc/atmel/atmel-pcm.c
> @@ -68,18 +68,15 @@ int atmel_pcm_mmap(struct snd_pcm_substream *substream,
> }
> EXPORT_SYMBOL_GPL(atmel_pcm_mmap);
>
> -static u64 atmel_pcm_dmamask = DMA_BIT_MASK(32);
> -
> int atmel_pcm_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &atmel_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> pr_debug("atmel-pcm: allocating PCM playback DMA buffer\n");
> diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
> index 53f8408..1d4c676 100644
> --- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
> +++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
> @@ -415,19 +415,16 @@ static void bf5xx_pcm_free_dma_buffers(struct snd_pcm *pcm)
> }
> }
>
> -static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
> -
> static int bf5xx_pcm_ac97_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
>
> pr_debug("%s enter\n", __func__);
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &bf5xx_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
> diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c
> index 9cb4a80..2a5b434 100644
> --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
> +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
> @@ -323,18 +323,16 @@ static struct snd_pcm_ops bf5xx_pcm_i2s_ops = {
> .silence = bf5xx_pcm_silence,
> };
>
> -static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
> -
> static int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> size_t size = bf5xx_pcm_hardware.buffer_bytes_max;
> + int ret;
>
> pr_debug("%s enter\n", __func__);
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &bf5xx_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm,
> SNDRV_DMA_TYPE_DEV, card->dev, size, size);
> diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
> index 8460edc..84a63c6 100644
> --- a/sound/soc/davinci/davinci-pcm.c
> +++ b/sound/soc/davinci/davinci-pcm.c
> @@ -844,18 +844,15 @@ static void davinci_pcm_free(struct snd_pcm *pcm)
> }
> }
>
> -static u64 davinci_pcm_dmamask = DMA_BIT_MASK(32);
> -
> static int davinci_pcm_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> int ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &davinci_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = davinci_pcm_preallocate_dma_buffer(pcm,
> diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
> index 9cc5c1f..f73c7ef 100644
> --- a/sound/soc/fsl/fsl_dma.c
> +++ b/sound/soc/fsl/fsl_dma.c
> @@ -298,14 +298,11 @@ static int fsl_dma_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - static u64 fsl_dma_dmamask = DMA_BIT_MASK(36);
> int ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &fsl_dma_dmamask;
> -
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = fsl_dma_dmamask;
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(36));
> + if (ret)
> + return ret;
>
> /* Some codecs have separate DAIs for playback and capture, so we
> * should allocate a DMA buffer only for the streams that are valid.
> diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
> index 2a847ca..8fcf224 100644
> --- a/sound/soc/fsl/mpc5200_dma.c
> +++ b/sound/soc/fsl/mpc5200_dma.c
> @@ -299,7 +299,6 @@ static struct snd_pcm_ops psc_dma_ops = {
> .hw_params = psc_dma_hw_params,
> };
>
> -static u64 psc_dma_dmamask = DMA_BIT_MASK(32);
> static int psc_dma_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> @@ -307,15 +306,14 @@ static int psc_dma_new(struct snd_soc_pcm_runtime *rtd)
> struct snd_pcm *pcm = rtd->pcm;
> struct psc_dma *psc_dma = snd_soc_dai_get_drvdata(rtd->cpu_dai);
> size_t size = psc_dma_hardware.buffer_bytes_max;
> - int rc = 0;
> + int rc;
>
> dev_dbg(rtd->platform->dev, "psc_dma_new(card=%p, dai=%p, pcm=%p)\n",
> card, dai, pcm);
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &psc_dma_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + rc = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (rc)
> + return rc;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev,
> diff --git a/sound/soc/jz4740/jz4740-pcm.c b/sound/soc/jz4740/jz4740-pcm.c
> index 7100592..1d7ef28 100644
> --- a/sound/soc/jz4740/jz4740-pcm.c
> +++ b/sound/soc/jz4740/jz4740-pcm.c
> @@ -297,19 +297,15 @@ static void jz4740_pcm_free(struct snd_pcm *pcm)
> }
> }
>
> -static u64 jz4740_pcm_dmamask = DMA_BIT_MASK(32);
> -
> static int jz4740_pcm_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> -
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &jz4740_pcm_dmamask;
> + int ret;
>
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = jz4740_pcm_preallocate_dma_buffer(pcm,
> diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c
> index b238434..3814bb0 100644
> --- a/sound/soc/kirkwood/kirkwood-dma.c
> +++ b/sound/soc/kirkwood/kirkwood-dma.c
> @@ -59,8 +59,6 @@ static struct snd_pcm_hardware kirkwood_dma_snd_hw = {
> .fifo_size = 0,
> };
>
> -static u64 kirkwood_dma_dmamask = DMA_BIT_MASK(32);
> -
> static irqreturn_t kirkwood_dma_irq(int irq, void *dev_id)
> {
> struct kirkwood_dma_data *priv = dev_id;
> @@ -292,10 +290,9 @@ static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd)
> struct snd_pcm *pcm = rtd->pcm;
> int ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &kirkwood_dma_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = kirkwood_dma_preallocate_dma_buffer(pcm,
> diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c
> index c894ff0..f588ee4 100644
> --- a/sound/soc/nuc900/nuc900-pcm.c
> +++ b/sound/soc/nuc900/nuc900-pcm.c
> @@ -314,16 +314,15 @@ static void nuc900_dma_free_dma_buffers(struct snd_pcm *pcm)
> snd_pcm_lib_preallocate_free_for_all(pcm);
> }
>
> -static u64 nuc900_pcm_dmamask = DMA_BIT_MASK(32);
> static int nuc900_dma_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> + int ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &nuc900_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
> card->dev, 4 * 1024, (4 * 1024) - 1);
> diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
> index a11405d..b8fa986 100644
> --- a/sound/soc/omap/omap-pcm.c
> +++ b/sound/soc/omap/omap-pcm.c
> @@ -156,8 +156,6 @@ static struct snd_pcm_ops omap_pcm_ops = {
> .mmap = omap_pcm_mmap,
> };
>
> -static u64 omap_pcm_dmamask = DMA_BIT_MASK(64);
> -
> static int omap_pcm_preallocate_dma_buffer(struct snd_pcm *pcm,
> int stream)
> {
> @@ -202,12 +200,11 @@ static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &omap_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(64);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(64));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = omap_pcm_preallocate_dma_buffer(pcm,
> diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
> index 806da27..d58b09f 100644
> --- a/sound/soc/pxa/pxa2xx-pcm.c
> +++ b/sound/soc/pxa/pxa2xx-pcm.c
> @@ -87,18 +87,15 @@ static struct snd_pcm_ops pxa2xx_pcm_ops = {
> .mmap = pxa2xx_pcm_mmap,
> };
>
> -static u64 pxa2xx_pcm_dmamask = DMA_BIT_MASK(32);
> -
> static int pxa2xx_soc_pcm_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &pxa2xx_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = pxa2xx_pcm_preallocate_dma_buffer(pcm,
> diff --git a/sound/soc/s6000/s6000-pcm.c b/sound/soc/s6000/s6000-pcm.c
> index d0740a7..283620a 100644
> --- a/sound/soc/s6000/s6000-pcm.c
> +++ b/sound/soc/s6000/s6000-pcm.c
> @@ -444,8 +444,6 @@ static void s6000_pcm_free(struct snd_pcm *pcm)
> snd_pcm_lib_preallocate_free_for_all(pcm);
> }
>
> -static u64 s6000_pcm_dmamask = DMA_BIT_MASK(32);
> -
> static int s6000_pcm_new(struct snd_soc_pcm_runtime *runtime)
> {
> struct snd_card *card = runtime->card->snd_card;
> @@ -456,10 +454,9 @@ static int s6000_pcm_new(struct snd_soc_pcm_runtime *runtime)
> params = snd_soc_dai_get_dma_data(runtime->cpu_dai,
> pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream);
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &s6000_pcm_dmamask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + res = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (res)
> + return res;
>
> if (params->dma_in) {
> s6dmac_disable_chan(DMA_MASK_DMAC(params->dma_in),
> diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
> index 9338d11..fe2748b 100644
> --- a/sound/soc/samsung/dma.c
> +++ b/sound/soc/samsung/dma.c
> @@ -406,20 +406,17 @@ static void dma_free_dma_buffers(struct snd_pcm *pcm)
> }
> }
>
> -static u64 dma_mask = DMA_BIT_MASK(32);
> -
> static int dma_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
>
> pr_debug("Entered %s\n", __func__);
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &dma_mask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = preallocate_dma_buffer(pcm,
> diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c
> index ce1e1e1..e4f318f 100644
> --- a/sound/soc/samsung/idma.c
> +++ b/sound/soc/samsung/idma.c
> @@ -383,18 +383,15 @@ static int preallocate_idma_buffer(struct snd_pcm *pcm, int stream)
> return 0;
> }
>
> -static u64 idma_mask = DMA_BIT_MASK(32);
> -
> static int idma_new(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_card *card = rtd->card->snd_card;
> struct snd_pcm *pcm = rtd->pcm;
> - int ret = 0;
> + int ret;
>
> - if (!card->dev->dma_mask)
> - card->dev->dma_mask = &idma_mask;
> - if (!card->dev->coherent_dma_mask)
> - card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
> + ret = dma_coerce_mask_and_coherent(card->dev, DMA_BIT_MASK(32));
> + if (ret)
> + return ret;
>
> if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
> ret = preallocate_idma_buffer(pcm,
> --
> 1.7.4.4
>
^ permalink raw reply
* Re: [PATCH 05/11] brcm80211: Remove extern from function prototypes
From: Arend van Spriel @ 2013-09-26 7:32 UTC (permalink / raw)
To: Joe Perches, netdev
Cc: David S. Miller, Brett Rudley, Franky (Zhenhui) Lin,
Hante Meuleman, John W. Linville, linux-wireless,
brcm80211-dev-list, linux-kernel
In-Reply-To: <9bd91f3c00bd8dd54339499a9253b31c6bac7c7b.1380137609.git.joe@perches.com>
On 09/25/2013 09:37 PM, Joe Perches wrote:
> There are a mix of function prototypes with and without extern
> in the kernel sources. Standardize on not using extern for
> function prototypes.
>
> Function prototypes don't need to be written with extern.
> extern is assumed by the compiler. Its use is as unnecessary as
> using auto to declare automatic/local variables in a block.
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Joe Perches <joe@perches.com>
As a side note, I submitted a patch to the wireless tree yesterday
adding a function prototype and I decided to ignore the checkpatch
warning and follow the convention in the header file (for now). So that
patch is going to collide with this one.
Regards,
Arend
> ---
> drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 30 +-
> drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | 27 +-
> .../net/wireless/brcm80211/brcmfmac/dhd_proto.h | 12 +-
> .../net/wireless/brcm80211/brcmfmac/sdio_chip.h | 23 +-
> .../net/wireless/brcm80211/brcmfmac/sdio_host.h | 92 +++--
> drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | 18 +-
> drivers/net/wireless/brcm80211/brcmsmac/ampdu.h | 22 +-
> drivers/net/wireless/brcm80211/brcmsmac/antsel.h | 14 +-
> drivers/net/wireless/brcm80211/brcmsmac/channel.h | 20 +-
> .../net/wireless/brcm80211/brcmsmac/mac80211_if.h | 38 +--
> drivers/net/wireless/brcm80211/brcmsmac/main.h | 110 +++---
> .../net/wireless/brcm80211/brcmsmac/phy/phy_hal.h | 219 ++++++------
> .../net/wireless/brcm80211/brcmsmac/phy/phy_int.h | 371 ++++++++++-----------
> drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h | 91 +++--
> drivers/net/wireless/brcm80211/brcmsmac/pmu.h | 4 +-
> drivers/net/wireless/brcm80211/brcmsmac/pub.h | 145 ++++----
> drivers/net/wireless/brcm80211/brcmsmac/rate.h | 48 ++-
> drivers/net/wireless/brcm80211/brcmsmac/stf.h | 31 +-
> .../net/wireless/brcm80211/brcmsmac/ucode_loader.h | 16 +-
> drivers/net/wireless/brcm80211/include/brcmu_d11.h | 2 +-
> .../net/wireless/brcm80211/include/brcmu_utils.h | 44 ++-
> 21 files changed, 644 insertions(+), 733 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> index 2eb9e64..34af9d1 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
> @@ -632,29 +632,29 @@ struct brcmf_skb_reorder_data {
> u8 *reorder;
> };
>
> -extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
> +int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
>
> /* Return pointer to interface name */
> -extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
> +char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
>
> /* Query dongle */
> -extern int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx,
> - uint cmd, void *buf, uint len);
> -extern int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> - void *buf, uint len);
> +int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> + void *buf, uint len);
> +int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
> + void *buf, uint len);
>
> /* Remove any protocol-specific data header. */
> -extern int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
> - struct sk_buff *rxp);
> +int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
> + struct sk_buff *rxp);
>
> -extern int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
> -extern struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx,
> - s32 ifidx, char *name, u8 *mac_addr);
> -extern void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx);
> +int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
> +struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
> + char *name, u8 *mac_addr);
> +void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx);
> void brcmf_txflowblock_if(struct brcmf_if *ifp,
> enum brcmf_netif_stop_reason reason, bool state);
> -extern u32 brcmf_get_chip_info(struct brcmf_if *ifp);
> -extern void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp,
> - bool success);
> +u32 brcmf_get_chip_info(struct brcmf_if *ifp);
> +void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp,
> + bool success);
>
> #endif /* _BRCMF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> index f7c1985..5bc0276 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
> @@ -132,34 +132,33 @@ struct pktq *brcmf_bus_gettxq(struct brcmf_bus *bus)
> * interface functions from common layer
> */
>
> -extern bool brcmf_c_prec_enq(struct device *dev, struct pktq *q,
> - struct sk_buff *pkt, int prec);
> +bool brcmf_c_prec_enq(struct device *dev, struct pktq *q, struct sk_buff *pkt,
> + int prec);
>
> /* Receive frame for delivery to OS. Callee disposes of rxp. */
> -extern void brcmf_rx_frames(struct device *dev, struct sk_buff_head *rxlist);
> +void brcmf_rx_frames(struct device *dev, struct sk_buff_head *rxlist);
>
> /* Indication from bus module regarding presence/insertion of dongle. */
> -extern int brcmf_attach(uint bus_hdrlen, struct device *dev);
> +int brcmf_attach(uint bus_hdrlen, struct device *dev);
> /* Indication from bus module regarding removal/absence of dongle */
> -extern void brcmf_detach(struct device *dev);
> +void brcmf_detach(struct device *dev);
> /* Indication from bus module that dongle should be reset */
> -extern void brcmf_dev_reset(struct device *dev);
> +void brcmf_dev_reset(struct device *dev);
> /* Indication from bus module to change flow-control state */
> -extern void brcmf_txflowblock(struct device *dev, bool state);
> +void brcmf_txflowblock(struct device *dev, bool state);
>
> /* Notify the bus has transferred the tx packet to firmware */
> -extern void brcmf_txcomplete(struct device *dev, struct sk_buff *txp,
> - bool success);
> +void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, bool success);
>
> -extern int brcmf_bus_start(struct device *dev);
> +int brcmf_bus_start(struct device *dev);
>
> #ifdef CONFIG_BRCMFMAC_SDIO
> -extern void brcmf_sdio_exit(void);
> -extern void brcmf_sdio_init(void);
> +void brcmf_sdio_exit(void);
> +void brcmf_sdio_init(void);
> #endif
> #ifdef CONFIG_BRCMFMAC_USB
> -extern void brcmf_usb_exit(void);
> -extern void brcmf_usb_init(void);
> +void brcmf_usb_exit(void);
> +void brcmf_usb_init(void);
> #endif
>
> #endif /* _BRCMF_BUS_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> index ef91798..53c6e71 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h
> @@ -22,21 +22,21 @@
> */
>
> /* Linkage, sets prot link and updates hdrlen in pub */
> -extern int brcmf_proto_attach(struct brcmf_pub *drvr);
> +int brcmf_proto_attach(struct brcmf_pub *drvr);
>
> /* Unlink, frees allocated protocol memory (including brcmf_proto) */
> -extern void brcmf_proto_detach(struct brcmf_pub *drvr);
> +void brcmf_proto_detach(struct brcmf_pub *drvr);
>
> /* Stop protocol: sync w/dongle state. */
> -extern void brcmf_proto_stop(struct brcmf_pub *drvr);
> +void brcmf_proto_stop(struct brcmf_pub *drvr);
>
> /* Add any protocol-specific data header.
> * Caller must reserve prot_hdrlen prepend space.
> */
> -extern void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx, u8 offset,
> - struct sk_buff *txp);
> +void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx, u8 offset,
> + struct sk_buff *txp);
>
> /* Sets dongle media info (drv_version, mac address). */
> -extern int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
> +int brcmf_c_preinit_dcmds(struct brcmf_if *ifp);
>
> #endif /* _BRCMF_PROTO_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> index 83c041f..f0780ee 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h
> @@ -215,17 +215,16 @@ struct sdpcmd_regs {
> u16 PAD[0x80];
> };
>
> -extern int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info **ci_ptr, u32 regs);
> -extern void brcmf_sdio_chip_detach(struct chip_info **ci_ptr);
> -extern void brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci,
> - u32 drivestrength);
> -extern u8 brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid);
> -extern void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci);
> -extern bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev,
> - struct chip_info *ci, char *nvram_dat,
> - uint nvram_sz);
> +int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info **ci_ptr, u32 regs);
> +void brcmf_sdio_chip_detach(struct chip_info **ci_ptr);
> +void brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci, u32 drivestrength);
> +u8 brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid);
> +void brcmf_sdio_chip_enter_download(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci);
> +bool brcmf_sdio_chip_exit_download(struct brcmf_sdio_dev *sdiodev,
> + struct chip_info *ci, char *nvram_dat,
> + uint nvram_sz);
>
> #endif /* _BRCMFMAC_SDIO_CHIP_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> index 2b5407f..c9b06b4 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
> @@ -181,18 +181,18 @@ struct brcmf_sdio_dev {
> };
>
> /* Register/deregister interrupt handler. */
> -extern int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev);
> -extern int brcmf_sdio_intr_unregister(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_intr_register(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_intr_unregister(struct brcmf_sdio_dev *sdiodev);
>
> /* sdio device register access interface */
> -extern u8 brcmf_sdio_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> -extern u32 brcmf_sdio_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> -extern void brcmf_sdio_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - u8 data, int *ret);
> -extern void brcmf_sdio_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - u32 data, int *ret);
> -extern int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> - void *data, bool write);
> +u8 brcmf_sdio_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> +u32 brcmf_sdio_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
> +void brcmf_sdio_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr, u8 data,
> + int *ret);
> +void brcmf_sdio_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr, u32 data,
> + int *ret);
> +int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> + void *data, bool write);
>
> /* Buffer transfer to/from device (client) core via cmd53.
> * fn: function number
> @@ -206,22 +206,17 @@ extern int brcmf_sdio_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
> * Returns 0 or error code.
> * NOTE: Async operation is not currently supported.
> */
> -extern int
> -brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff_head *pktq);
> -extern int
> -brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, u8 *buf, uint nbytes);
> -
> -extern int
> -brcmf_sdcard_recv_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff *pkt);
> -extern int
> -brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, u8 *buf, uint nbytes);
> -extern int
> -brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> - uint flags, struct sk_buff_head *pktq);
> +int brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff_head *pktq);
> +int brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, u8 *buf, uint nbytes);
> +
> +int brcmf_sdcard_recv_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff *pkt);
> +int brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, u8 *buf, uint nbytes);
> +int brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> + uint flags, struct sk_buff_head *pktq);
>
> /* Flags bits */
>
> @@ -237,46 +232,43 @@ brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
> * nbytes: number of bytes to transfer to/from buf
> * Returns 0 or error code.
> */
> -extern int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw,
> - u32 addr, u8 *buf, uint nbytes);
> -extern int brcmf_sdio_ramrw(struct brcmf_sdio_dev *sdiodev, bool write,
> - u32 address, u8 *data, uint size);
> +int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw, u32 addr,
> + u8 *buf, uint nbytes);
> +int brcmf_sdio_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
> + u8 *data, uint size);
>
> /* Issue an abort to the specified function */
> -extern int brcmf_sdcard_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
> +int brcmf_sdcard_abort(struct brcmf_sdio_dev *sdiodev, uint fn);
>
> /* platform specific/high level functions */
> -extern int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
> -extern int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdio_remove(struct brcmf_sdio_dev *sdiodev);
>
> /* attach, return handler on success, NULL if failed.
> * The handler shall be provided by all subsequent calls. No local cache
> * cfghdl points to the starting address of pci device mapped memory
> */
> -extern int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev);
> -extern void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev);
> +int brcmf_sdioh_attach(struct brcmf_sdio_dev *sdiodev);
> +void brcmf_sdioh_detach(struct brcmf_sdio_dev *sdiodev);
>
> /* read or write one byte using cmd52 */
> -extern int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw,
> - uint fnc, uint addr, u8 *byte);
> +int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint fnc,
> + uint addr, u8 *byte);
>
> /* read or write 2/4 bytes using cmd53 */
> -extern int
> -brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev,
> - uint rw, uint fnc, uint addr,
> - u32 *word, uint nbyte);
> +int brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev, uint rw, uint fnc,
> + uint addr, u32 *word, uint nbyte);
>
> /* Watchdog timer interface for pm ops */
> -extern void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev,
> - bool enable);
> +void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, bool enable);
>
> -extern void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev);
> -extern void brcmf_sdbrcm_disconnect(void *ptr);
> -extern void brcmf_sdbrcm_isr(void *arg);
> +void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev);
> +void brcmf_sdbrcm_disconnect(void *ptr);
> +void brcmf_sdbrcm_isr(void *arg);
>
> -extern void brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick);
> +void brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick);
>
> -extern void brcmf_pm_resume_wait(struct brcmf_sdio_dev *sdiodev,
> - wait_queue_head_t *wq);
> -extern bool brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev);
> +void brcmf_pm_resume_wait(struct brcmf_sdio_dev *sdiodev,
> + wait_queue_head_t *wq);
> +bool brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev);
> #endif /* _BRCM_SDH_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> index a8a267b..2d08c15 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
> @@ -172,19 +172,19 @@ struct si_info {
>
>
> /* AMBA Interconnect exported externs */
> -extern u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
> +u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
>
> /* === exported functions === */
> -extern struct si_pub *ai_attach(struct bcma_bus *pbus);
> -extern void ai_detach(struct si_pub *sih);
> -extern uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val);
> -extern void ai_clkctl_init(struct si_pub *sih);
> -extern u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
> -extern bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
> -extern bool ai_deviceremoved(struct si_pub *sih);
> +struct si_pub *ai_attach(struct bcma_bus *pbus);
> +void ai_detach(struct si_pub *sih);
> +uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val);
> +void ai_clkctl_init(struct si_pub *sih);
> +u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
> +bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
> +bool ai_deviceremoved(struct si_pub *sih);
>
> /* Enable Ex-PA for 4313 */
> -extern void ai_epa_4313war(struct si_pub *sih);
> +void ai_epa_4313war(struct si_pub *sih);
>
> static inline u32 ai_get_cccaps(struct si_pub *sih)
> {
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> index 73d01e5..03bdcf2 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
> @@ -37,17 +37,17 @@ struct brcms_ampdu_session {
> u16 dma_len;
> };
>
> -extern void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session,
> - struct brcms_c_info *wlc);
> -extern int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
> - struct sk_buff *p);
> -extern void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session);
> +void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session,
> + struct brcms_c_info *wlc);
> +int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
> + struct sk_buff *p);
> +void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session);
>
> -extern struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
> -extern void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
> - struct sk_buff *p, struct tx_status *txs);
> -extern void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
> +struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
> +void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
> + struct sk_buff *p, struct tx_status *txs);
> +void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
>
> #endif /* _BRCM_AMPDU_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/antsel.h b/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> index 97ea388..a3d487a 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
> @@ -17,13 +17,11 @@
> #ifndef _BRCM_ANTSEL_H_
> #define _BRCM_ANTSEL_H_
>
> -extern struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_antsel_detach(struct antsel_info *asi);
> -extern void brcms_c_antsel_init(struct antsel_info *asi);
> -extern void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef,
> - bool sel,
> - u8 id, u8 fbid, u8 *antcfg,
> - u8 *fbantcfg);
> -extern u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
> +struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc);
> +void brcms_c_antsel_detach(struct antsel_info *asi);
> +void brcms_c_antsel_init(struct antsel_info *asi);
> +void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
> + u8 id, u8 fbid, u8 *antcfg, u8 *fbantcfg);
> +u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
>
> #endif /* _BRCM_ANTSEL_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.h b/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> index 006483a..39dd3a5 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.h
> @@ -32,20 +32,16 @@
>
> #define BRCMS_DFS_EU (BRCMS_DFS_TPC | BRCMS_RADAR_TYPE_EU) /* Flag for DFS EU */
>
> -extern struct brcms_cm_info *
> -brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
> +struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
>
> -extern void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm);
> +void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm);
>
> -extern bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm,
> - u16 chspec);
> +bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm, u16 chspec);
>
> -extern void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm,
> - u16 chanspec,
> - struct txpwr_limits *txpwr);
> -extern void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm,
> - u16 chanspec,
> - u8 local_constraint_qdbm);
> -extern void brcms_c_regd_init(struct brcms_c_info *wlc);
> +void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, u16 chanspec,
> + struct txpwr_limits *txpwr);
> +void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
> + u8 local_constraint_qdbm);
> +void brcms_c_regd_init(struct brcms_c_info *wlc);
>
> #endif /* _WLC_CHANNEL_H */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> index 4090032..198053d 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
> @@ -88,26 +88,26 @@ struct brcms_info {
> };
>
> /* misc callbacks */
> -extern void brcms_init(struct brcms_info *wl);
> -extern uint brcms_reset(struct brcms_info *wl);
> -extern void brcms_intrson(struct brcms_info *wl);
> -extern u32 brcms_intrsoff(struct brcms_info *wl);
> -extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
> -extern int brcms_up(struct brcms_info *wl);
> -extern void brcms_down(struct brcms_info *wl);
> -extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
> - bool state, int prio);
> -extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
> +void brcms_init(struct brcms_info *wl);
> +uint brcms_reset(struct brcms_info *wl);
> +void brcms_intrson(struct brcms_info *wl);
> +u32 brcms_intrsoff(struct brcms_info *wl);
> +void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
> +int brcms_up(struct brcms_info *wl);
> +void brcms_down(struct brcms_info *wl);
> +void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
> + bool state, int prio);
> +bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
>
> /* timer functions */
> -extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
> - void (*fn) (void *arg), void *arg,
> - const char *name);
> -extern void brcms_free_timer(struct brcms_timer *timer);
> -extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
> -extern bool brcms_del_timer(struct brcms_timer *timer);
> -extern void brcms_dpc(unsigned long data);
> -extern void brcms_timer(struct brcms_timer *t);
> -extern void brcms_fatal_error(struct brcms_info *wl);
> +struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
> + void (*fn) (void *arg), void *arg,
> + const char *name);
> +void brcms_free_timer(struct brcms_timer *timer);
> +void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
> +bool brcms_del_timer(struct brcms_timer *timer);
> +void brcms_dpc(unsigned long data);
> +void brcms_timer(struct brcms_timer *t);
> +void brcms_fatal_error(struct brcms_info *wl);
>
> #endif /* _BRCM_MAC80211_IF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h b/drivers/net/wireless/brcm80211/brcmsmac/main.h
> index b5d7a38..c4d135c 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/main.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h
> @@ -616,66 +616,54 @@ struct brcms_bss_cfg {
> struct brcms_bss_info *current_bss;
> };
>
> -extern int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo,
> - struct sk_buff *p);
> -extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
> - uint *blocks);
> -
> -extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
> -extern void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
> -extern u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec,
> - uint mac_len);
> -extern u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc,
> - u32 rspec,
> - bool use_rspec, u16 mimo_ctlchbw);
> -extern u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
> - u32 rts_rate,
> - u32 frame_rate,
> - u8 rts_preamble_type,
> - u8 frame_preamble_type, uint frame_len,
> - bool ba);
> -extern void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
> - struct ieee80211_sta *sta,
> - void (*dma_callback_fn));
> -extern void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
> -extern int brcms_c_set_nmode(struct brcms_c_info *wlc);
> -extern void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
> - u32 bcn_rate);
> -extern void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw,
> - u8 antsel_type);
> -extern void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw,
> - u16 chanspec,
> - bool mute, struct txpwr_limits *txpwr);
> -extern void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset,
> - u16 v);
> -extern u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
> -extern void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask,
> - u16 val, int bands);
> -extern void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
> -extern void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
> -extern void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
> -extern void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
> -extern void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
> -extern void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
> - u32 override_bit);
> -extern void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
> - u32 override_bit);
> -extern void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw,
> - int offset, int len, void *buf);
> -extern u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
> -extern void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw,
> - uint offset, const void *buf, int len,
> - u32 sel);
> -extern void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
> - void *buf, int len, u32 sel);
> -extern void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
> -extern u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
> -extern void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
> -extern void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
> -extern void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
> -extern void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
> -extern void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw,
> - u8 stf_mode);
> -extern void brcms_c_init_scb(struct scb *scb);
> +int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p);
> +int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
> + uint *blocks);
> +
> +int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
> +void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
> +u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, uint mac_len);
> +u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, u32 rspec,
> + bool use_rspec, u16 mimo_ctlchbw);
> +u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
> + u32 rts_rate, u32 frame_rate,
> + u8 rts_preamble_type, u8 frame_preamble_type,
> + uint frame_len, bool ba);
> +void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
> + struct ieee80211_sta *sta, void (*dma_callback_fn));
> +void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
> +int brcms_c_set_nmode(struct brcms_c_info *wlc);
> +void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc, u32 bcn_rate);
> +void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw, u8 antsel_type);
> +void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec,
> + bool mute, struct txpwr_limits *txpwr);
> +void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset, u16 v);
> +u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
> +void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
> + int bands);
> +void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
> +void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
> +void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
> +void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
> +void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
> +void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
> + u32 override_bit);
> +void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
> + u32 override_bit);
> +void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset,
> + int len, void *buf);
> +u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
> +void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw, uint offset,
> + const void *buf, int len, u32 sel);
> +void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
> + void *buf, int len, u32 sel);
> +void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
> +u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
> +void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
> +void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
> +void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
> +void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
> +void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw, u8 stf_mode);
> +void brcms_c_init_scb(struct scb *scb);
>
> #endif /* _BRCM_MAIN_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> index e34a71e..4d3734f 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
> @@ -179,121 +179,106 @@ struct shared_phy_params {
> };
>
>
> -extern struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
> -extern struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh,
> - struct bcma_device *d11core,
> - int bandtype, struct wiphy *wiphy);
> -extern void wlc_phy_detach(struct brcms_phy_pub *ppi);
> -
> -extern bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
> - u16 *phyrev, u16 *radioid,
> - u16 *radiover);
> -extern bool wlc_phy_get_encore(struct brcms_phy_pub *pih);
> -extern u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> -extern void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> -extern void wlc_phy_init(struct brcms_phy_pub *ppi, u16 chanspec);
> -extern void wlc_phy_watchdog(struct brcms_phy_pub *ppi);
> -extern int wlc_phy_down(struct brcms_phy_pub *ppi);
> -extern u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih);
> -extern void wlc_phy_cal_init(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init);
> -
> -extern void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi,
> - u16 chanspec);
> -extern u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi,
> - u16 newch);
> -extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
> -
> -extern int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
> - struct d11rxhdr *rxh);
> -extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
> -extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
> -
> -extern void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag);
> -
> -extern void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on);
> -extern void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on);
> -
> -
> -extern void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi);
> -
> -extern void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
> - bool wide_filter);
> -extern void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
> - struct brcms_chanvec *channels);
> -extern u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi,
> - uint band);
> -
> -extern void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan,
> - u8 *_min_, u8 *_max_, int rate);
> -extern void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi,
> - uint chan, u8 *_max_, u8 *_min_);
> -extern void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi,
> - uint band, s32 *, s32 *, u32 *);
> -extern void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi,
> - struct txpwr_limits *,
> - u16 chanspec);
> -extern int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm,
> - bool *override);
> -extern int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm,
> - bool override);
> -extern void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
> - struct txpwr_limits *);
> -extern bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi,
> - bool hwpwrctrl);
> -extern u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi);
> -extern u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi);
> -extern bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain,
> - u8 rxchain);
> -extern void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain,
> - u8 rxchain);
> -extern void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain,
> - u8 *rxchain);
> -extern u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih);
> -extern s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih,
> - u16 chanspec);
> -extern void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val);
> -
> -extern void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason);
> -extern void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock);
> -extern void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi);
> -
> -extern void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val);
> -extern void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, u32 id, bool val);
> -extern void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, u32 flags);
> -
> -extern void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);
> -
> -extern void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
> - struct tx_power *power, uint channel);
> -
> -extern void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
> -extern bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi,
> - u8 txpwr_percent);
> -extern void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
> -extern void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih,
> - bool bf_preempt);
> -extern void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);
> -
> -extern void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);
> -
> -extern void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
> -extern void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
> -
> -extern const u8 *wlc_phy_get_ofdm_rate_lookup(void);
> -
> -extern s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
> - u8 mcs_offset);
> -extern s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
> +struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
> +struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh,
> + struct bcma_device *d11core, int bandtype,
> + struct wiphy *wiphy);
> +void wlc_phy_detach(struct brcms_phy_pub *ppi);
> +
> +bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
> + u16 *phyrev, u16 *radioid, u16 *radiover);
> +bool wlc_phy_get_encore(struct brcms_phy_pub *pih);
> +u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> +void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate);
> +void wlc_phy_init(struct brcms_phy_pub *ppi, u16 chanspec);
> +void wlc_phy_watchdog(struct brcms_phy_pub *ppi);
> +int wlc_phy_down(struct brcms_phy_pub *ppi);
> +u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih);
> +void wlc_phy_cal_init(struct brcms_phy_pub *ppi);
> +void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init);
> +
> +void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi, u16 chanspec);
> +u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi, u16 newch);
> +u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
> +
> +int wlc_phy_rssi_compute(struct brcms_phy_pub *pih, struct d11rxhdr *rxh);
> +void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
> +void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
> +bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
> +
> +void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag);
> +
> +void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on);
> +void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on);
> +
> +
> +void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi);
> +
> +void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
> + bool wide_filter);
> +void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
> + struct brcms_chanvec *channels);
> +u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band);
> +
> +void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan, u8 *_min_,
> + u8 *_max_, int rate);
> +void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi, uint chan,
> + u8 *_max_, u8 *_min_);
> +void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi, uint band,
> + s32 *, s32 *, u32 *);
> +void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *,
> + u16 chanspec);
> +int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm, bool *override);
> +int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm, bool override);
> +void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
> + struct txpwr_limits *);
> +bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi);
> +void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi, bool hwpwrctrl);
> +u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi);
> +u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi);
> +bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain);
> +void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain);
> +void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain, u8 *rxchain);
> +u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih);
> +s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih, u16 chanspec);
> +void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val);
> +
> +void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason);
> +void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi);
> +void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock);
> +void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi);
> +
> +void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val);
> +void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi);
> +void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, u32 id, bool val);
> +void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, u32 flags);
> +
> +void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);
> +
> +void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
> + struct tx_power *power, uint channel);
> +
> +void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
> +bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
> +void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi, u8 txpwr_percent);
> +void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
> +void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih, bool bf_preempt);
> +void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);
> +
> +void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);
> +
> +void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
> +void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
> +
> +const u8 *wlc_phy_get_ofdm_rate_lookup(void);
> +
> +s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
> + u8 mcs_offset);
> +s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
> #endif /* _BRCM_PHY_HAL_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> index 1dc767c..4960f7d 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
> @@ -910,113 +910,103 @@ struct lcnphy_radio_regs {
> u8 do_init_g;
> };
>
> -extern u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
> -extern void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> -
> -extern u16 read_radio_reg(struct brcms_phy *pi, u16 addr);
> -extern void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -extern void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask,
> - u16 val);
> -extern void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);
> -
> -extern void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> -
> -extern void wlc_phyreg_enter(struct brcms_phy_pub *pih);
> -extern void wlc_phyreg_exit(struct brcms_phy_pub *pih);
> -extern void wlc_radioreg_enter(struct brcms_phy_pub *pih);
> -extern void wlc_radioreg_exit(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_read_table(struct brcms_phy *pi,
> - const struct phytbl_info *ptbl_info,
> - u16 tblAddr, u16 tblDataHi,
> - u16 tblDatalo);
> -extern void wlc_phy_write_table(struct brcms_phy *pi,
> - const struct phytbl_info *ptbl_info,
> - u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> -extern void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id,
> - uint tbl_offset, u16 tblAddr, u16 tblDataHi,
> - u16 tblDataLo);
> -extern void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val);
> -
> -extern void write_phy_channel_reg(struct brcms_phy *pi, uint val);
> -extern void wlc_phy_txpower_update_shm(struct brcms_phy *pi);
> -
> -extern u8 wlc_phy_nbits(s32 value);
> -extern void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
> -
> -extern uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
> - struct radio_20xx_regs *radioregs);
> -extern uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
> - const struct radio_regs *radioregs,
> - u16 core_offset);
> -
> -extern void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);
> -
> -extern void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on);
> -extern void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real,
> - s32 *eps_imag);
> -
> -extern void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
> -extern void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);
> -
> -extern bool wlc_phy_attach_nphy(struct brcms_phy *pi);
> -extern bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_detach_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_init_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_init_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_cal_init_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi,
> - u16 chanspec);
> -extern int wlc_phy_channel2freq(uint channel);
> -extern int wlc_phy_chanspec_freq2bandrange_lpssn(uint);
> -extern int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, u16 chanspec);
> -
> -extern void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode);
> -extern s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi);
> -
> -extern void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi);
> -extern void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi);
> -
> -extern void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index);
> -extern void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable);
> -extern void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi);
> -extern void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz,
> - u16 max_val, bool iqcalmode);
> -
> -extern void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan,
> - u8 *max_pwr, u8 rate_id);
> -extern void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start,
> - u8 rate_mcs_end,
> - u8 rate_ofdm_start);
> -extern void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power,
> - u8 rate_ofdm_start,
> - u8 rate_ofdm_end,
> - u8 rate_mcs_start);
> -
> -extern u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
> -extern s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
> -extern s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
> -extern s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
> -extern void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
> -extern void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
> -extern void wlc_2064_vco_cal(struct brcms_phy *pi);
> -
> -extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
> +u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
> +void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> +
> +u16 read_radio_reg(struct brcms_phy *pi, u16 addr);
> +void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
> +void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);
> +
> +void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
> +
> +void wlc_phyreg_enter(struct brcms_phy_pub *pih);
> +void wlc_phyreg_exit(struct brcms_phy_pub *pih);
> +void wlc_radioreg_enter(struct brcms_phy_pub *pih);
> +void wlc_radioreg_exit(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_read_table(struct brcms_phy *pi,
> + const struct phytbl_info *ptbl_info,
> + u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> +void wlc_phy_write_table(struct brcms_phy *pi,
> + const struct phytbl_info *ptbl_info,
> + u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
> +void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id, uint tbl_offset,
> + u16 tblAddr, u16 tblDataHi, u16 tblDataLo);
> +void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val);
> +
> +void write_phy_channel_reg(struct brcms_phy *pi, uint val);
> +void wlc_phy_txpower_update_shm(struct brcms_phy *pi);
> +
> +u8 wlc_phy_nbits(s32 value);
> +void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
> +
> +uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
> + struct radio_20xx_regs *radioregs);
> +uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
> + const struct radio_regs *radioregs,
> + u16 core_offset);
> +
> +void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);
> +
> +void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on);
> +void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, s32 *eps_imag);
> +
> +void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
> +void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);
> +
> +bool wlc_phy_attach_nphy(struct brcms_phy *pi);
> +bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_detach_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_init_nphy(struct brcms_phy *pi);
> +void wlc_phy_init_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_cal_init_nphy(struct brcms_phy *pi);
> +void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, u16 chanspec);
> +void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, u16 chanspec);
> +void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi, u16 chanspec);
> +int wlc_phy_channel2freq(uint channel);
> +int wlc_phy_chanspec_freq2bandrange_lpssn(uint);
> +int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, u16 chanspec);
> +
> +void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode);
> +s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi);
> +
> +void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi);
> +void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi);
> +void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi);
> +
> +void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index);
> +void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable);
> +void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi);
> +void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz, u16 max_val,
> + bool iqcalmode);
> +
> +void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan,
> + u8 *max_pwr, u8 rate_id);
> +void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start,
> + u8 rate_mcs_end, u8 rate_ofdm_start);
> +void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power, u8 rate_ofdm_start,
> + u8 rate_ofdm_end, u8 rate_mcs_start);
> +
> +u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
> +s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
> +s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
> +s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
> +void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
> +void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
> +void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
> +void wlc_2064_vco_cal(struct brcms_phy *pi);
> +
> +void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
>
> #define LCNPHY_TBL_ID_PAPDCOMPDELTATBL 0x18
> #define LCNPHY_TX_POWER_TABLE_SIZE 128
> @@ -1030,26 +1020,24 @@ extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
>
> #define LCNPHY_TX_PWR_CTRL_TEMPBASED 0xE001
>
> -extern void wlc_lcnphy_write_table(struct brcms_phy *pi,
> - const struct phytbl_info *pti);
> -extern void wlc_lcnphy_read_table(struct brcms_phy *pi,
> - struct phytbl_info *pti);
> -extern void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b);
> -extern void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq);
> -extern void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b);
> -extern u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi);
> -extern void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0,
> - u8 *eq0, u8 *fi0, u8 *fq0);
> -extern void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode);
> -extern void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode);
> -extern bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi);
> -extern void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
> -extern s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
> -extern void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr,
> - s8 *cck_pwr);
> -extern void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi);
> -
> -extern s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);
> +void wlc_lcnphy_write_table(struct brcms_phy *pi,
> + const struct phytbl_info *pti);
> +void wlc_lcnphy_read_table(struct brcms_phy *pi, struct phytbl_info *pti);
> +void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b);
> +void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq);
> +void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b);
> +u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi);
> +void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0, u8 *eq0, u8 *fi0,
> + u8 *fq0);
> +void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode);
> +void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode);
> +bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi);
> +void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
> +s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
> +void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr, s8 *cck_pwr);
> +void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi);
> +
> +s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);
>
> #define NPHY_MAX_HPVGA1_INDEX 10
> #define NPHY_DEF_HPVGA1_INDEXLIMIT 7
> @@ -1060,9 +1048,8 @@ struct phy_iq_est {
> u32 q_pwr;
> };
>
> -extern void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi,
> - bool enable);
> -extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
> +void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi, bool enable);
> +void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
>
> #define wlc_phy_write_table_nphy(pi, pti) \
> wlc_phy_write_table(pi, pti, 0x72, 0x74, 0x73)
> @@ -1076,10 +1063,10 @@ extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
> #define wlc_nphy_table_data_write(pi, w, v) \
> wlc_phy_table_data_write((pi), (w), (v))
>
> -extern void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o,
> - u32 w, void *d);
> -extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
> - u32, const void *);
> +void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o, u32 w,
> + void *d);
> +void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32, u32,
> + const void *);
>
> #define PHY_IPA(pi) \
> ((pi->ipa2g_on && CHSPEC_IS2G(pi->radio_chanspec)) || \
> @@ -1089,73 +1076,67 @@ extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
> if (NREV_LT((pi)->pubpi.phy_rev, 3)) \
> (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol))
>
> -extern void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype);
> -extern void wlc_phy_aci_reset_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en);
> -
> -extern u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan);
> -extern void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on);
> -
> -extern void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd);
> -extern s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi);
> -
> -extern u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val);
> -
> -extern void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
> - u16 num_samps, u8 wait_time,
> - u8 wait_for_crs);
> -
> -extern void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
> - struct nphy_iq_comp *comp);
> -extern void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);
> -
> -extern void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih,
> - u8 rxcore_bitmask);
> -extern u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih);
> -
> -extern void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
> -extern void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi);
> -extern u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi);
> -
> -extern struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi);
> -extern int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi,
> - struct nphy_txgains target_gain,
> - bool full, bool m);
> -extern int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi,
> - struct nphy_txgains target_gain,
> - u8 type, bool d);
> -extern void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask,
> - s8 txpwrindex, bool res);
> -extern void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type);
> -extern int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type,
> - s32 *rssi_buf, u8 nsamps);
> -extern void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi);
> -extern int wlc_phy_aci_scan_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi,
> - s32 dBm_targetpower, bool debug);
> -extern int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val,
> - u8 mode, u8, bool);
> -extern void wlc_phy_stopplayback_nphy(struct brcms_phy *pi);
> -extern void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
> - u8 num_samps);
> -extern void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
> -
> -extern int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi,
> - struct d11rxhdr *rxh);
> +void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype);
> +void wlc_phy_aci_reset_nphy(struct brcms_phy *pi);
> +void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en);
> +
> +u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan);
> +void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on);
> +
> +void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi);
> +
> +void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd);
> +s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi);
> +
> +u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val);
> +
> +void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
> + u16 num_samps, u8 wait_time, u8 wait_for_crs);
> +
> +void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
> + struct nphy_iq_comp *comp);
> +void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);
> +
> +void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih, u8 rxcore_bitmask);
> +u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih);
> +
> +void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
> +void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
> +void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi);
> +void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi);
> +u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi);
> +
> +struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi);
> +int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi,
> + struct nphy_txgains target_gain, bool full, bool m);
> +int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain,
> + u8 type, bool d);
> +void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask,
> + s8 txpwrindex, bool res);
> +void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type);
> +int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type,
> + s32 *rssi_buf, u8 nsamps);
> +void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi);
> +int wlc_phy_aci_scan_nphy(struct brcms_phy *pi);
> +void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi, s32 dBm_targetpower,
> + bool debug);
> +int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val, u8 mode,
> + u8, bool);
> +void wlc_phy_stopplayback_nphy(struct brcms_phy *pi);
> +void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
> + u8 num_samps);
> +void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
> +
> +int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct d11rxhdr *rxh);
>
> #define NPHY_TESTPATTERN_BPHY_EVM 0
> #define NPHY_TESTPATTERN_BPHY_RFCS 1
>
> -extern void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);
> +void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);
>
> void wlc_phy_get_pwrdet_offsets(struct brcms_phy *pi, s8 *cckoffset,
> s8 *ofdmoffset);
> -extern s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi,
> - u16 chanspec);
> +s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi, u16 chanspec);
>
> -extern bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
> +bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
> #endif /* _BRCM_PHY_INT_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h b/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> index 2c5b66b..dd87747 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
> @@ -124,56 +124,49 @@
>
> struct brcms_phy;
>
> -extern struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
> - struct brcms_info *wl,
> - struct brcms_c_info *wlc);
> -extern void wlc_phy_shim_detach(struct phy_shim_info *physhim);
> +struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
> + struct brcms_info *wl,
> + struct brcms_c_info *wlc);
> +void wlc_phy_shim_detach(struct phy_shim_info *physhim);
>
> /* PHY to WL utility functions */
> -extern struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
> - void (*fn) (struct brcms_phy *pi),
> - void *arg, const char *name);
> -extern void wlapi_free_timer(struct wlapi_timer *t);
> -extern void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
> -extern bool wlapi_del_timer(struct wlapi_timer *t);
> -extern void wlapi_intrson(struct phy_shim_info *physhim);
> -extern u32 wlapi_intrsoff(struct phy_shim_info *physhim);
> -extern void wlapi_intrsrestore(struct phy_shim_info *physhim,
> - u32 macintmask);
> -
> -extern void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset,
> - u16 v);
> -extern u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
> -extern void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx,
> - u16 mask, u16 val, int bands);
> -extern void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
> -extern void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
> -extern void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
> -extern void wlapi_enable_mac(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask,
> - u32 val);
> -extern void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
> -extern void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
> -extern void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
> -extern void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
> -extern void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
> -extern void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *
> - physhim);
> -extern void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *
> - physhim);
> -extern void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
> - int len, void *buf);
> -extern u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim,
> - u8 rate);
> -extern void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
> -extern void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint,
> - void *buf, int, u32 sel);
> -extern void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint,
> - const void *buf, int, u32);
> -
> -extern void wlapi_high_update_phy_mode(struct phy_shim_info *physhim,
> - u32 phy_mode);
> -extern u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
> +struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
> + void (*fn)(struct brcms_phy *pi),
> + void *arg, const char *name);
> +void wlapi_free_timer(struct wlapi_timer *t);
> +void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
> +bool wlapi_del_timer(struct wlapi_timer *t);
> +void wlapi_intrson(struct phy_shim_info *physhim);
> +u32 wlapi_intrsoff(struct phy_shim_info *physhim);
> +void wlapi_intrsrestore(struct phy_shim_info *physhim, u32 macintmask);
> +
> +void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset, u16 v);
> +u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
> +void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx, u16 mask, u16 val,
> + int bands);
> +void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
> +void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
> +void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
> +void wlapi_enable_mac(struct phy_shim_info *physhim);
> +void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask, u32 val);
> +void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
> +void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
> +void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
> +void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
> +void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
> +void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
> +void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *physhim);
> +void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *physhim);
> +void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
> + int len, void *buf);
> +u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim, u8 rate);
> +void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
> +void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint, void *buf,
> + int, u32 sel);
> +void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint, const void *buf,
> + int, u32);
> +
> +void wlapi_high_update_phy_mode(struct phy_shim_info *physhim, u32 phy_mode);
> +u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
>
> #endif /* _BRCM_PHY_SHIM_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> index 20e2012..a014bbc 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
> @@ -20,7 +20,7 @@
>
> #include "types.h"
>
> -extern u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
> -extern u32 si_pmu_measure_alpclk(struct si_pub *sih);
> +u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
> +u32 si_pmu_measure_alpclk(struct si_pub *sih);
>
> #endif /* _BRCM_PMU_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pub.h b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> index d36ea5e..4da38cb 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
> @@ -266,83 +266,76 @@ struct brcms_antselcfg {
> };
>
> /* common functions for every port */
> -extern struct brcms_c_info *
> -brcms_c_attach(struct brcms_info *wl, struct bcma_device *core, uint unit,
> - bool piomode, uint *perr);
> -extern uint brcms_c_detach(struct brcms_c_info *wlc);
> -extern int brcms_c_up(struct brcms_c_info *wlc);
> -extern uint brcms_c_down(struct brcms_c_info *wlc);
> -
> -extern bool brcms_c_chipmatch(struct bcma_device *core);
> -extern void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx);
> -extern void brcms_c_reset(struct brcms_c_info *wlc);
> -
> -extern void brcms_c_intrson(struct brcms_c_info *wlc);
> -extern u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
> -extern void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
> -extern bool brcms_c_intrsupd(struct brcms_c_info *wlc);
> -extern bool brcms_c_isr(struct brcms_c_info *wlc);
> -extern bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
> -extern bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc,
> - struct sk_buff *sdu,
> - struct ieee80211_hw *hw);
> -extern bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid);
> -extern void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx,
> - int val);
> -extern int brcms_c_get_header_len(void);
> -extern void brcms_c_set_addrmatch(struct brcms_c_info *wlc,
> - int match_reg_offset,
> - const u8 *addr);
> -extern void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
> - const struct ieee80211_tx_queue_params *arg,
> - bool suspend);
> -extern struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc);
> -extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
> - struct ieee80211_sta *sta, u16 tid);
> -extern void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
> - u8 ba_wsize, uint max_rx_ampdu_bytes);
> -extern int brcms_c_module_register(struct brcms_pub *pub,
> - const char *name, struct brcms_info *hdl,
> - int (*down_fn)(void *handle));
> -extern int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
> - struct brcms_info *hdl);
> -extern void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc);
> -extern void brcms_c_enable_mac(struct brcms_c_info *wlc);
> -extern void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state);
> -extern void brcms_c_scan_start(struct brcms_c_info *wlc);
> -extern void brcms_c_scan_stop(struct brcms_c_info *wlc);
> -extern int brcms_c_get_curband(struct brcms_c_info *wlc);
> -extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
> -extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
> -extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
> +struct brcms_c_info *brcms_c_attach(struct brcms_info *wl,
> + struct bcma_device *core, uint unit,
> + bool piomode, uint *perr);
> +uint brcms_c_detach(struct brcms_c_info *wlc);
> +int brcms_c_up(struct brcms_c_info *wlc);
> +uint brcms_c_down(struct brcms_c_info *wlc);
> +
> +bool brcms_c_chipmatch(struct bcma_device *core);
> +void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx);
> +void brcms_c_reset(struct brcms_c_info *wlc);
> +
> +void brcms_c_intrson(struct brcms_c_info *wlc);
> +u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
> +void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
> +bool brcms_c_intrsupd(struct brcms_c_info *wlc);
> +bool brcms_c_isr(struct brcms_c_info *wlc);
> +bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
> +bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
> + struct ieee80211_hw *hw);
> +bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid);
> +void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val);
> +int brcms_c_get_header_len(void);
> +void brcms_c_set_addrmatch(struct brcms_c_info *wlc, int match_reg_offset,
> + const u8 *addr);
> +void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
> + const struct ieee80211_tx_queue_params *arg,
> + bool suspend);
> +struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc);
> +void brcms_c_ampdu_flush(struct brcms_c_info *wlc, struct ieee80211_sta *sta,
> + u16 tid);
> +void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
> + u8 ba_wsize, uint max_rx_ampdu_bytes);
> +int brcms_c_module_register(struct brcms_pub *pub, const char *name,
> + struct brcms_info *hdl,
> + int (*down_fn)(void *handle));
> +int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
> + struct brcms_info *hdl);
> +void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc);
> +void brcms_c_enable_mac(struct brcms_c_info *wlc);
> +void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state);
> +void brcms_c_scan_start(struct brcms_c_info *wlc);
> +void brcms_c_scan_stop(struct brcms_c_info *wlc);
> +int brcms_c_get_curband(struct brcms_c_info *wlc);
> +int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
> +int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
> +void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
> struct brcm_rateset *currs);
> -extern int brcms_c_set_rateset(struct brcms_c_info *wlc,
> - struct brcm_rateset *rs);
> -extern int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period);
> -extern u16 brcms_c_get_phy_type(struct brcms_c_info *wlc, int phyidx);
> -extern void brcms_c_set_shortslot_override(struct brcms_c_info *wlc,
> +int brcms_c_set_rateset(struct brcms_c_info *wlc, struct brcm_rateset *rs);
> +int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period);
> +u16 brcms_c_get_phy_type(struct brcms_c_info *wlc, int phyidx);
> +void brcms_c_set_shortslot_override(struct brcms_c_info *wlc,
> s8 sslot_override);
> -extern void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc,
> - u8 interval);
> -extern u64 brcms_c_tsf_get(struct brcms_c_info *wlc);
> -extern void brcms_c_tsf_set(struct brcms_c_info *wlc, u64 tsf);
> -extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
> -extern int brcms_c_get_tx_power(struct brcms_c_info *wlc);
> -extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
> -extern void brcms_c_mute(struct brcms_c_info *wlc, bool on);
> -extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
> -extern void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
> -extern void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr,
> - const u8 *bssid, u8 *ssid, size_t ssid_len);
> -extern void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr);
> -extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
> -extern void brcms_c_set_new_beacon(struct brcms_c_info *wlc,
> - struct sk_buff *beacon, u16 tim_offset,
> - u16 dtim_period);
> -extern void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc,
> - struct sk_buff *probe_resp);
> -extern void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
> -extern void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid,
> - size_t ssid_len);
> +void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval);
> +u64 brcms_c_tsf_get(struct brcms_c_info *wlc);
> +void brcms_c_tsf_set(struct brcms_c_info *wlc, u64 tsf);
> +int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
> +int brcms_c_get_tx_power(struct brcms_c_info *wlc);
> +bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
> +void brcms_c_mute(struct brcms_c_info *wlc, bool on);
> +bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
> +void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
> +void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr, const u8 *bssid,
> + u8 *ssid, size_t ssid_len);
> +void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr);
> +void brcms_c_update_beacon(struct brcms_c_info *wlc);
> +void brcms_c_set_new_beacon(struct brcms_c_info *wlc, struct sk_buff *beacon,
> + u16 tim_offset, u16 dtim_period);
> +void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc,
> + struct sk_buff *probe_resp);
> +void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
> +void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid, size_t ssid_len);
>
> #endif /* _BRCM_PUB_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/rate.h b/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> index 980d578..5bb88b7 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/rate.h
> @@ -216,34 +216,30 @@ static inline u8 cck_phy2mac_rate(u8 signal)
>
> /* sanitize, and sort a rateset with the basic bit(s) preserved, validate
> * rateset */
> -extern bool
> -brcms_c_rate_hwrs_filter_sort_validate(struct brcms_c_rateset *rs,
> - const struct brcms_c_rateset *hw_rs,
> - bool check_brate, u8 txstreams);
> +bool brcms_c_rate_hwrs_filter_sort_validate(struct brcms_c_rateset *rs,
> + const struct brcms_c_rateset *hw_rs,
> + bool check_brate, u8 txstreams);
> /* copy rateset src to dst as-is (no masking or sorting) */
> -extern void brcms_c_rateset_copy(const struct brcms_c_rateset *src,
> - struct brcms_c_rateset *dst);
> +void brcms_c_rateset_copy(const struct brcms_c_rateset *src,
> + struct brcms_c_rateset *dst);
>
> /* would be nice to have these documented ... */
> -extern u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp);
> -
> -extern void brcms_c_rateset_filter(struct brcms_c_rateset *src,
> - struct brcms_c_rateset *dst, bool basic_only, u8 rates, uint xmask,
> - bool mcsallow);
> -
> -extern void
> -brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt,
> - const struct brcms_c_rateset *rs_hw, uint phy_type,
> - int bandtype, bool cck_only, uint rate_mask,
> - bool mcsallow, u8 bw, u8 txstreams);
> -
> -extern s16 brcms_c_rate_legacy_phyctl(uint rate);
> -
> -extern void brcms_c_rateset_mcs_upd(struct brcms_c_rateset *rs, u8 txstreams);
> -extern void brcms_c_rateset_mcs_clear(struct brcms_c_rateset *rateset);
> -extern void brcms_c_rateset_mcs_build(struct brcms_c_rateset *rateset,
> - u8 txstreams);
> -extern void brcms_c_rateset_bw_mcs_filter(struct brcms_c_rateset *rateset,
> - u8 bw);
> +u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp);
> +
> +void brcms_c_rateset_filter(struct brcms_c_rateset *src,
> + struct brcms_c_rateset *dst, bool basic_only,
> + u8 rates, uint xmask, bool mcsallow);
> +
> +void brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt,
> + const struct brcms_c_rateset *rs_hw, uint phy_type,
> + int bandtype, bool cck_only, uint rate_mask,
> + bool mcsallow, u8 bw, u8 txstreams);
> +
> +s16 brcms_c_rate_legacy_phyctl(uint rate);
> +
> +void brcms_c_rateset_mcs_upd(struct brcms_c_rateset *rs, u8 txstreams);
> +void brcms_c_rateset_mcs_clear(struct brcms_c_rateset *rateset);
> +void brcms_c_rateset_mcs_build(struct brcms_c_rateset *rateset, u8 txstreams);
> +void brcms_c_rateset_bw_mcs_filter(struct brcms_c_rateset *rateset, u8 bw);
>
> #endif /* _BRCM_RATE_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/stf.h b/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> index 19f6580..ba94930 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/stf.h
> @@ -19,24 +19,19 @@
>
> #include "types.h"
>
> -extern int brcms_c_stf_attach(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_detach(struct brcms_c_info *wlc);
> +int brcms_c_stf_attach(struct brcms_c_info *wlc);
> +void brcms_c_stf_detach(struct brcms_c_info *wlc);
>
> -extern void brcms_c_tempsense_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
> - u16 *ss_algo_channel,
> - u16 chanspec);
> -extern int brcms_c_stf_ss_update(struct brcms_c_info *wlc,
> - struct brcms_band *band);
> -extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> -extern int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val,
> - bool force);
> -extern bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
> -extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> -extern void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
> -extern u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
> - u32 rspec);
> -extern u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc,
> - u32 rspec);
> +void brcms_c_tempsense_upd(struct brcms_c_info *wlc);
> +void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
> + u16 *ss_algo_channel, u16 chanspec);
> +int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band);
> +void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> +int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force);
> +bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
> +void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
> +void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
> +u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc, u32 rspec);
> +u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc, u32 rspec);
>
> #endif /* _BRCM_STF_H_ */
> diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h b/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> index 18750a8..c87dd89 100644
> --- a/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> +++ b/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
> @@ -43,16 +43,14 @@ struct brcms_ucode {
> u32 *bcm43xx_bomminor;
> };
>
> -extern int
> -brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
> +int brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
>
> -extern void brcms_ucode_data_free(struct brcms_ucode *ucode);
> +void brcms_ucode_data_free(struct brcms_ucode *ucode);
>
> -extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf,
> - unsigned int idx);
> -extern int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes,
> - unsigned int idx);
> -extern void brcms_ucode_free_buf(void *);
> -extern int brcms_check_firmwares(struct brcms_info *wl);
> +int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, unsigned int idx);
> +int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes,
> + unsigned int idx);
> +void brcms_ucode_free_buf(void *);
> +int brcms_check_firmwares(struct brcms_info *wl);
>
> #endif /* _BRCM_UCODE_H_ */
> diff --git a/drivers/net/wireless/brcm80211/include/brcmu_d11.h b/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> index 92623f0..8660a2c 100644
> --- a/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> +++ b/drivers/net/wireless/brcm80211/include/brcmu_d11.h
> @@ -140,6 +140,6 @@ struct brcmu_d11inf {
> void (*decchspec)(struct brcmu_chan *ch);
> };
>
> -extern void brcmu_d11_attach(struct brcmu_d11inf *d11inf);
> +void brcmu_d11_attach(struct brcmu_d11inf *d11inf);
>
> #endif /* _BRCMU_CHANNELS_H_ */
> diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> index 898cacb..8ba445b 100644
> --- a/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> +++ b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> @@ -114,31 +114,29 @@ static inline struct sk_buff *pktq_ppeek_tail(struct pktq *pq, int prec)
> return skb_peek_tail(&pq->q[prec].skblist);
> }
>
> -extern struct sk_buff *brcmu_pktq_penq(struct pktq *pq, int prec,
> - struct sk_buff *p);
> -extern struct sk_buff *brcmu_pktq_penq_head(struct pktq *pq, int prec,
> - struct sk_buff *p);
> -extern struct sk_buff *brcmu_pktq_pdeq(struct pktq *pq, int prec);
> -extern struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec);
> -extern struct sk_buff *brcmu_pktq_pdeq_match(struct pktq *pq, int prec,
> - bool (*match_fn)(struct sk_buff *p,
> - void *arg),
> - void *arg);
> +struct sk_buff *brcmu_pktq_penq(struct pktq *pq, int prec, struct sk_buff *p);
> +struct sk_buff *brcmu_pktq_penq_head(struct pktq *pq, int prec,
> + struct sk_buff *p);
> +struct sk_buff *brcmu_pktq_pdeq(struct pktq *pq, int prec);
> +struct sk_buff *brcmu_pktq_pdeq_tail(struct pktq *pq, int prec);
> +struct sk_buff *brcmu_pktq_pdeq_match(struct pktq *pq, int prec,
> + bool (*match_fn)(struct sk_buff *p,
> + void *arg),
> + void *arg);
>
> /* packet primitives */
> -extern struct sk_buff *brcmu_pkt_buf_get_skb(uint len);
> -extern void brcmu_pkt_buf_free_skb(struct sk_buff *skb);
> +struct sk_buff *brcmu_pkt_buf_get_skb(uint len);
> +void brcmu_pkt_buf_free_skb(struct sk_buff *skb);
>
> /* Empty the queue at particular precedence level */
> /* callback function fn(pkt, arg) returns true if pkt belongs to if */
> -extern void brcmu_pktq_pflush(struct pktq *pq, int prec,
> - bool dir, bool (*fn)(struct sk_buff *, void *), void *arg);
> +void brcmu_pktq_pflush(struct pktq *pq, int prec, bool dir,
> + bool (*fn)(struct sk_buff *, void *), void *arg);
>
> /* operations on a set of precedences in packet queue */
>
> -extern int brcmu_pktq_mlen(struct pktq *pq, uint prec_bmp);
> -extern struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp,
> - int *prec_out);
> +int brcmu_pktq_mlen(struct pktq *pq, uint prec_bmp);
> +struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
>
> /* operations on packet queue as a whole */
>
> @@ -167,11 +165,11 @@ static inline bool pktq_empty(struct pktq *pq)
> return pq->len == 0;
> }
>
> -extern void brcmu_pktq_init(struct pktq *pq, int num_prec, int max_len);
> +void brcmu_pktq_init(struct pktq *pq, int num_prec, int max_len);
> /* prec_out may be NULL if caller is not interested in return value */
> -extern struct sk_buff *brcmu_pktq_peek_tail(struct pktq *pq, int *prec_out);
> -extern void brcmu_pktq_flush(struct pktq *pq, bool dir,
> - bool (*fn)(struct sk_buff *, void *), void *arg);
> +struct sk_buff *brcmu_pktq_peek_tail(struct pktq *pq, int *prec_out);
> +void brcmu_pktq_flush(struct pktq *pq, bool dir,
> + bool (*fn)(struct sk_buff *, void *), void *arg);
>
> /* externs */
> /* ip address */
> @@ -204,13 +202,13 @@ static inline u16 brcmu_maskget16(u16 var, u16 mask, u8 shift)
> /* externs */
> /* format/print */
> #ifdef DEBUG
> -extern void brcmu_prpkt(const char *msg, struct sk_buff *p0);
> +void brcmu_prpkt(const char *msg, struct sk_buff *p0);
> #else
> #define brcmu_prpkt(a, b)
> #endif /* DEBUG */
>
> #ifdef DEBUG
> -extern __printf(3, 4)
> +__printf(3, 4)
> void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...);
> #else
> __printf(3, 4)
>
^ permalink raw reply
* Re: [PATCH 04/11] ath: Remove extern from function prototypes
From: Kalle Valo @ 2013-09-26 7:30 UTC (permalink / raw)
To: Joe Perches
Cc: netdev, linux-wireless, Jouni Malinen, Luis R. Rodriguez, ath10k,
John W. Linville, ath9k-devel, David S. Miller, linux-kernel
In-Reply-To: <a3dabaf02d36dbb4051188b706a3e66e6465c56b.1380137609.git.joe@perches.com>
Joe Perches <joe@perches.com> writes:
> There are a mix of function prototypes with and without extern
> in the kernel sources. Standardize on not using extern for
> function prototypes.
>
> Function prototypes don't need to be written with extern.
> extern is assumed by the compiler. Its use is as unnecessary as
> using auto to declare automatic/local variables in a block.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/wireless/ath/ath10k/debug.h | 8 ++++----
> drivers/net/wireless/ath/ath6kl/common.h | 3 +--
> drivers/net/wireless/ath/ath6kl/debug.h | 9 ++++-----
> drivers/net/wireless/ath/ath9k/ath9k.h | 2 +-
> 4 files changed, 10 insertions(+), 12 deletions(-)
For the ath10k and ath6kl changes:
Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>
--
Kalle Valo
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox