* Re: [net-next 1/2] stmmac: extend mac addr reg and fix perfect filering
From: David Miller @ 2012-05-11 22:11 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: netdev, gianni.antoniazzi-ext
In-Reply-To: <1336381953-18041-1-git-send-email-peppe.cavallaro@st.com>
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon, 7 May 2012 11:12:32 +0200
> + /* Extra 16 regs are available in cores newer than the 3.40. */
> + if (id > 34)
No magic constants, even if you describe it in the comment. Add
an appropriate macro and use it.
> + /* For MAC Addr registers se have to set the Address Enable (AE)
> + * bit that has no effect on the High Reg 0 where the bit 31 (MO)
> + * is RO. */
Comments should be formatted as:
/* For MAC Addr registers se have to set the Address Enable (AE)
* bit that has no effect on the High Reg 0 where the bit 31 (MO)
* is RO.
*/
^ permalink raw reply
* Linux Plumbers Conference: Networking-bufferbloat
From: Tom Herbert @ 2012-05-11 22:12 UTC (permalink / raw)
To: Linux Netdev List
Hi all,
I proposed a micro conference for this years Linux Plumbers Conference
for August 29-31, 2012 San Diego, California.
I'm soliciting ideas for presentation and conversation to fill a ~2.5
hour mini-conference. I think the major topics will be buffer bloat
(can't wait to hear more about codel :-) ) , networking performance
(including TCP enhancements), and maybe integration advanced NIC HW
features.
If you have ideas for discussion that you think would benefit from
discussion at the Plumbers Conference, please add your idea to the
wiki, and email me.
http://www.linuxplumbersconf.org/2012/
http://wiki.linuxplumbersconf.org/2012:networking-bufferbloat
Thanks,
Tom
^ permalink raw reply
* Re: [net-next 2/2] stmmac: add mixed burst for DMA
From: David Miller @ 2012-05-11 22:12 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: netdev
In-Reply-To: <1336381953-18041-2-git-send-email-peppe.cavallaro@st.com>
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Date: Mon, 7 May 2012 11:12:33 +0200
> - int (*init) (void __iomem *ioaddr, int pbl, int fb, int burst_len,
> - u32 dma_tx, u32 dma_rx);
> + int (*init) (void __iomem *ioaddr, int pbl, int fb, int mb,
> + int burst_len, u32 dma_tx, u32 dma_rx);
Fix the indentation of the arguments on the second line,
the first character must line up with the first column after
the function's openning parenthesis on the previous line.
> -static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, int fb,
> +static int dwmac1000_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
> int burst_len, u32 dma_tx, u32 dma_rx)
While you're here fix up that issue in the existing code here as well.
> -static int dwmac100_dma_init(void __iomem *ioaddr, int pbl, int fb,
> +static int dwmac100_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb,
> int burst_len, u32 dma_tx, u32 dma_rx)
Likewise.
> - int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, burst_len = 0;
> + int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, burst_len = 0,
> + mixed_burst = 0;
This is gross, just make a new "int" declaration for mixed_burst.
^ permalink raw reply
* Re: [PATCH v2 net-next] fq_codel: Fair Queue Codel AQM
From: Eric Dumazet @ 2012-05-11 22:16 UTC (permalink / raw)
To: Changli Gao
Cc: David Miller, netdev, Dave Taht, Kathleen Nichols, Van Jacobson,
Tom Herbert, Matt Mathis, Yuchung Cheng, Stephen Hemminger,
Maciej Żenczykowski, Nandita Dukkipati
In-Reply-To: <1336764650.31653.277.camel@edumazet-glaptop>
On Fri, 2012-05-11 at 21:30 +0200, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
...
> +static int fq_codel_dump_class_stats(struct Qdisc *sch, unsigned long cl,
> + struct gnet_dump *d)
> +{
> + struct fq_codel_sched_data *q = qdisc_priv(sch);
> + u32 idx = cl - 1;
> + struct gnet_stats_queue qs = { 0 };
> + struct tc_fq_codel_xstats xstats;
> +
> + WARN_ON_ONCE(1);
> + if (idx < q->flows_cnt) {
> + const struct fq_codel_flow *flow = &q->flows[idx];
> + const struct sk_buff *skb = flow->head;
Oh well, I forgot to remove this WARN_ON_ONCE(1)
^ permalink raw reply
* Re: [PATCH v4 1/2] vhost-net: fix handle_rx buffer size
From: David Miller @ 2012-05-11 22:17 UTC (permalink / raw)
To: basil.gor; +Cc: mst, ebiederm, netdev
In-Reply-To: <1336121724-31902-1-git-send-email-basil.gor@gmail.com>
From: Basil Gor <basil.gor@gmail.com>
Date: Fri, 4 May 2012 12:55:23 +0400
> Take vlan header length into account, when vlan id is stored as
> vlan_tci. Otherwise tagged packets comming from macvtap will be
> truncated.
>
> Signed-off-by: Basil Gor <basil.gor@gmail.com>
My patience with Eric B. to review this has run out, applied,
thanks Basil.
^ permalink raw reply
* Re: [PATCH v4 2/2] macvtap: restore vlan header on user read
From: David Miller @ 2012-05-11 22:17 UTC (permalink / raw)
To: basil.gor; +Cc: mst, ebiederm, netdev
In-Reply-To: <1336121724-31902-2-git-send-email-basil.gor@gmail.com>
From: Basil Gor <basil.gor@gmail.com>
Date: Fri, 4 May 2012 12:55:24 +0400
> Ethernet vlan header is not on the packet and kept in the skb->vlan_tci
> when it comes from lower dev. This patch inserts vlan header in user
> buffer during skb copy on user read.
>
> Signed-off-by: Basil Gor <basil.gor@gmail.com>
Also applied, thanks.
^ permalink raw reply
* Re: [PATCH v2 net-next] fq_codel: Fair Queue Codel AQM
From: David Miller @ 2012-05-11 22:17 UTC (permalink / raw)
To: eric.dumazet
Cc: xiaosuo, netdev, dave.taht, nichols, van, therbert, mattmathis,
ycheng, shemminger, maze, nanditad
In-Reply-To: <1336774576.31653.289.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 12 May 2012 00:16:16 +0200
> On Fri, 2012-05-11 at 21:30 +0200, Eric Dumazet wrote:
>> From: Eric Dumazet <edumazet@google.com>
>
> ...
>
>> +static int fq_codel_dump_class_stats(struct Qdisc *sch, unsigned long cl,
>> + struct gnet_dump *d)
>> +{
>> + struct fq_codel_sched_data *q = qdisc_priv(sch);
>> + u32 idx = cl - 1;
>> + struct gnet_stats_queue qs = { 0 };
>> + struct tc_fq_codel_xstats xstats;
>> +
>> + WARN_ON_ONCE(1);
>> + if (idx < q->flows_cnt) {
>> + const struct fq_codel_flow *flow = &q->flows[idx];
>> + const struct sk_buff *skb = flow->head;
>
> Oh well, I forgot to remove this WARN_ON_ONCE(1)
I can do it.
^ permalink raw reply
* [PATCH net-next] etherdevice: Remove now unused compare_ether_addr_64bits
From: Joe Perches @ 2012-05-11 22:21 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-kernel
In-Reply-To: <20120510.233554.263340913611469229.davem@davemloft.net>
Move and invert the logic from the otherwise unused
compare_ether_addr_64bits to ether_addr_equal_64bits.
Neaten the logic in is_etherdev_addr.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/etherdevice.h | 46 ++++++++++++------------------------------
1 files changed, 13 insertions(+), 33 deletions(-)
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index afacf85..dc85c1d 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -193,12 +193,12 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
}
/**
- * compare_ether_addr_64bits - Compare two Ethernet addresses
+ * ether_addr_equal_64bits - Compare two Ethernet addresses
* @addr1: Pointer to an array of 8 bytes
* @addr2: Pointer to an other array of 8 bytes
*
- * Compare two ethernet addresses, returns 0 if equal, non-zero otherwise.
- * Unlike memcmp(), it doesn't return a value suitable for sorting.
+ * Compare two ethernet addresses, returns true if equal, false otherwise.
+ *
* The function doesn't need any conditional branches and possibly uses
* word memory accesses on CPU allowing cheap unaligned memory reads.
* arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2}
@@ -206,45 +206,25 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
* Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits.
*/
-static inline unsigned compare_ether_addr_64bits(const u8 addr1[6+2],
- const u8 addr2[6+2])
+static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
+ const u8 addr2[6+2])
{
#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
unsigned long fold = ((*(unsigned long *)addr1) ^
(*(unsigned long *)addr2));
if (sizeof(fold) == 8)
- return zap_last_2bytes(fold) != 0;
+ return zap_last_2bytes(fold) == 0;
fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
(*(unsigned long *)(addr2 + 4)));
- return fold != 0;
+ return fold == 0;
#else
- return compare_ether_addr(addr1, addr2);
+ return ether_addr_equal(addr1, addr2);
#endif
}
/**
- * ether_addr_equal_64bits - Compare two Ethernet addresses
- * @addr1: Pointer to an array of 8 bytes
- * @addr2: Pointer to an other array of 8 bytes
- *
- * Compare two ethernet addresses, returns true if equal, false otherwise.
- *
- * The function doesn't need any conditional branches and possibly uses
- * word memory accesses on CPU allowing cheap unaligned memory reads.
- * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2}
- *
- * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits.
- */
-
-static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
- const u8 addr2[6+2])
-{
- return !compare_ether_addr_64bits(addr1, addr2);
-}
-
-/**
* is_etherdev_addr - Tell if given Ethernet address belongs to the device.
* @dev: Pointer to a device structure
* @addr: Pointer to a six-byte array containing the Ethernet address
@@ -252,23 +232,23 @@ static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
* Compare passed address with all addresses of the device. Return true if the
* address if one of the device addresses.
*
- * Note that this function calls compare_ether_addr_64bits() so take care of
+ * Note that this function calls ether_addr_equal_64bits() so take care of
* the right padding.
*/
static inline bool is_etherdev_addr(const struct net_device *dev,
const u8 addr[6 + 2])
{
struct netdev_hw_addr *ha;
- int res = 1;
+ bool res = false;
rcu_read_lock();
for_each_dev_addr(dev, ha) {
- res = compare_ether_addr_64bits(addr, ha->addr);
- if (!res)
+ res = ether_addr_equal_64bits(addr, ha->addr);
+ if (res)
break;
}
rcu_read_unlock();
- return !res;
+ return res;
}
#endif /* __KERNEL__ */
^ permalink raw reply related
* Re: [PATCH] ks8851: Update link status during link change interrupt
From: David Miller @ 2012-05-11 22:23 UTC (permalink / raw)
To: sboyd; +Cc: netdev, linux-kernel, ben-linux
In-Reply-To: <1336690290-21304-1-git-send-email-sboyd@codeaurora.org>
From: Stephen Boyd <sboyd@codeaurora.org>
Date: Thu, 10 May 2012 15:51:30 -0700
> If a link change interrupt comes in we just clear the interrupt
> and continue along without notifying the upper networking layers
> that the link has changed. Use the mii_check_link() function to
> update the link status whenever a link change interrupt occurs.
>
> Cc: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Applied, thanks.
^ permalink raw reply
* Re: [net-next 2/2] igb: Add Support for new i210/i211 devices.
From: David Miller @ 2012-05-11 22:27 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: carolyn.wyborny, netdev, gospo, sassmann
In-Reply-To: <1336723282-3130-3-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 11 May 2012 01:01:22 -0700
> +s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
> +{
> + s32 ret_val;
> +
> + ret_val = igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
> +
> + return ret_val;
> +}
Please, this is just unnecessary syntactic masterbation, simplify this
to:
s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
{
return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
}
And:
> +void igb_release_nvm_i210(struct e1000_hw *hw)
> +{
> +
> + igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
> +}
Please get rid of that unnecessary empty line.
I can really tell when someone is extremely careless when removing
their debugging code, and I can almost guarentee that's what has
happened here.
^ permalink raw reply
* [PATCH net-next] sch_htb: report backlog information in htb classes
From: Eric Dumazet @ 2012-05-11 22:31 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
htb classes at level 0 can copy their qdisc child backlog to provide to
"tc -s class" users more relevant information. (packet counter is
correct but byte counter (backlog) is 0)
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/sched/sch_htb.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 9d75b77..0f4d534 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1073,9 +1073,10 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg,
spin_lock_bh(root_lock);
tcm->tcm_parent = cl->parent ? cl->parent->common.classid : TC_H_ROOT;
tcm->tcm_handle = cl->common.classid;
- if (!cl->level && cl->un.leaf.q)
+ if (!cl->level && cl->un.leaf.q) {
tcm->tcm_info = cl->un.leaf.q->handle;
-
+ sch->qstats.backlog = cl->un.leaf.q->qstats.backlog;
+ }
nest = nla_nest_start(skb, TCA_OPTIONS);
if (nest == NULL)
goto nla_put_failure;
^ permalink raw reply related
* Re: [PATCH RESEND 2/5] net: fec: adopt pinctrl support
From: David Miller @ 2012-05-11 22:31 UTC (permalink / raw)
To: shawn.guo; +Cc: arnd, netdev, s.hauer, olof, dong.aisheng, linux-arm-kernel
In-Reply-To: <1336352040-28447-3-git-send-email-shawn.guo@linaro.org>
From: Shawn Guo <shawn.guo@linaro.org>
Date: Mon, 7 May 2012 08:53:57 +0800
> Cc: netdev@vger.kernel.org
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: [PATCH net-next] sch_htb: report backlog information in htb classes
From: Eric Dumazet @ 2012-05-11 22:41 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <1336775494.31653.297.camel@edumazet-glaptop>
On Sat, 2012-05-12 at 00:31 +0200, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> htb classes at level 0 can copy their qdisc child backlog to provide to
> "tc -s class" users more relevant information. (packet counter is
> correct but byte counter (backlog) is 0)
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> net/sched/sch_htb.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Please disregard this patch, more work is needed.
Thanks
^ permalink raw reply
* Re: [PATCH v4 1/2] vhost-net: fix handle_rx buffer size
From: Eric W. Biederman @ 2012-05-11 23:05 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: Basil Gor, David S. Miller, netdev
In-Reply-To: <20120508192732.GA28536@redhat.com>
"Michael S. Tsirkin" <mst@redhat.com> writes:
> On Fri, May 04, 2012 at 12:55:23PM +0400, Basil Gor wrote:
>> Take vlan header length into account, when vlan id is stored as
>> vlan_tci. Otherwise tagged packets comming from macvtap will be
>> truncated.
>>
>> Signed-off-by: Basil Gor <basil.gor@gmail.com>
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> This doesn't fix packet socket backends but that can be
> handled separately later.
Yes that seems good enough.
Let me recommend just taking the packet out of the socket queue
instead of calling the recvmsg method. Since vhost/net.c is
already munging with the queue directly that should make
it easy to avoid the peculiarities of pf_packet sockets
for reporting vlan information.
Eric
^ permalink raw reply
* Re: [net-next 2/2] igb: Add Support for new i210/i211 devices.
From: Jeff Kirsher @ 2012-05-11 23:02 UTC (permalink / raw)
To: David Miller; +Cc: carolyn.wyborny, netdev, gospo, sassmann
In-Reply-To: <20120511.182735.63933163877487008.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]
On Fri, 2012-05-11 at 18:27 -0400, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Fri, 11 May 2012 01:01:22 -0700
>
> > +s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
> > +{
> > + s32 ret_val;
> > +
> > + ret_val = igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
> > +
> > + return ret_val;
> > +}
>
> Please, this is just unnecessary syntactic masterbation, simplify this
> to:
>
> s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
> {
> return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
> }
>
> And:
>
> > +void igb_release_nvm_i210(struct e1000_hw *hw)
> > +{
> > +
> > + igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
> > +}
>
> Please get rid of that unnecessary empty line.
>
> I can really tell when someone is extremely careless when removing
> their debugging code, and I can almost guarentee that's what has
> happened here.
Dave,
I get this cleaned up for Carolyn. I will wait to re-submit till later
tonight to ensure that there is no other feedback or comments that need
to be addressed.
Cheers,
Jeff
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* RE: [net-next 2/2] igb: Add Support for new i210/i211 devices.
From: Wyborny, Carolyn @ 2012-05-11 23:02 UTC (permalink / raw)
To: David Miller, Kirsher, Jeffrey T
Cc: netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <20120511.182735.63933163877487008.davem@davemloft.net>
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Friday, May 11, 2012 3:28 PM
>To: Kirsher, Jeffrey T
>Cc: Wyborny, Carolyn; netdev@vger.kernel.org; gospo@redhat.com;
>sassmann@redhat.com
>Subject: Re: [net-next 2/2] igb: Add Support for new i210/i211 devices.
>
>From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>Date: Fri, 11 May 2012 01:01:22 -0700
>
>> +s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
>> +{
>> + s32 ret_val;
>> +
>> + ret_val = igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
>> +
>> + return ret_val;
>> +}
>
>Please, this is just unnecessary syntactic masterbation, simplify this
>to:
>
>s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
>{
> return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
>}
>
>And:
>
>> +void igb_release_nvm_i210(struct e1000_hw *hw)
>> +{
>> +
>> + igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
>> +}
>
>Please get rid of that unnecessary empty line.
>
>I can really tell when someone is extremely careless when removing
>their debugging code, and I can almost guarentee that's what has
>happened here.
Yes, you're right. Will fix ASAP.
Carolyn
Carolyn Wyborny
Linux Development
LAN Access Division
Intel Corporation
^ permalink raw reply
* Re: [PATCH 0/2] Add and use vsprintf extension %pMbt for bluetooth macs
From: Joe Perches @ 2012-05-11 23:21 UTC (permalink / raw)
To: Andrei Emeltchenko
Cc: Marcel Holtmann, Gustavo F. Padovan, linux-bluetooth, netdev,
linux-kernel
In-Reply-To: <20120509090156.GB8473@aemeltch-MOBL1>
On Wed, 2012-05-09 at 12:01 +0300, Andrei Emeltchenko wrote:
> Hi Joe
>
> On Fri, Dec 03, 2010 at 06:33:02PM -0800, Joe Perches wrote:
> > Using vsprintf extensions can save text and data.
> > Add %pMbt for the byte reversed output for bluetooth addresses.
> >
> > Joe Perches (2):
> > vsprintf: Add %pMbt, bluetooth mac address
> > bluetooth: Use printf extension %pMbt
>
> I think this would be the best way to solve our issues with batostr.
>
> BTW: What is the status with this patch series?
18 month old patches generally don't apply.
If you want to bring it forward or redo it,
please do.
^ permalink raw reply
* Re: [PATCH] net: of/phy: fix build error when phylib is built as a module
From: Randy Dunlap @ 2012-05-11 23:50 UTC (permalink / raw)
To: Bjørn Mork
Cc: David Miller, paul.gortmaker, sfr, linux-next, linux-kernel,
netdev, linuxppc-dev, david.daney
In-Reply-To: <1336751221-19127-1-git-send-email-bjorn@mork.no>
On 05/11/2012 08:47 AM, Bjørn Mork wrote:
> CONFIG_OF_MDIO is tristate and will be m if PHYLIB is m. Use
> IS_ENABLED macro to prevent build error:
>
> ERROR: "of_mdio_find_bus" [drivers/net/phy/mdio-mux.ko] undefined!
>
> Reported-by: Randy Dunlap <rdunlap@xenotime.net>
> Cc: David Daney <david.daney@cavium.com>
> Signed-off-by: Bjørn Mork <bjorn@mork.no>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Thanks.
> ---
> I wonder if this could be as banal as this? Not even build tested...
>
> Should be wrapped into commit 25106022 if it works, to ensure
> bisectability.
>
>
>
> Bjørn
>
> drivers/net/phy/mdio_bus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
> index 83d5c9f..683ef1c 100644
> --- a/drivers/net/phy/mdio_bus.c
> +++ b/drivers/net/phy/mdio_bus.c
> @@ -88,7 +88,7 @@ static struct class mdio_bus_class = {
> .dev_release = mdiobus_release,
> };
>
> -#ifdef CONFIG_OF_MDIO
> +#if IS_ENABLED(CONFIG_OF_MDIO)
> /* Helper function for of_mdio_find_bus */
> static int of_mdio_bus_match(struct device *dev, void *mdio_bus_np)
> {
--
~Randy
^ permalink raw reply
* Re: [3.2.y] phy:icplus:fix Auto Power Saving in ip101a_config_init.
From: Ben Hutchings @ 2012-05-12 0:57 UTC (permalink / raw)
To: Jonathan Nieder
Cc: stable, David Miller, srinivas.kandagatla, netdev,
peppe.cavallaro
In-Reply-To: <20120509171847.GC4884@burratino>
[-- Attachment #1: Type: text/plain, Size: 967 bytes --]
On Wed, 2012-05-09 at 12:18 -0500, Jonathan Nieder wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> Date: Mon, 2 Apr 2012 00:02:09 +0000
>
> [ Upstream commit b3300146aa8efc5d3937fd33f3cfdc580a3843bc ]
[...]
> David Miller wrote:
> > From: Jonathan Nieder <jrnieder@gmail.com>
>
> >> I'm guessing 3.2.y needs this, too, since it also includes
> >> v3.2-rc1~129^2~247 ("net/phy: add IC+ IP101A and support APS").
> >>
> >> Here's a quick backport made by adjusting the context line to
> >> use IP101A_APS_ON instead of IP101A_G_APS_ON.
> >>
> >> Please include it in some later stable update if appropriate.
> >
> > Please submit this directly to the stable list.
>
> Thanks for looking it over. Doing so.
[...]
I've queued this up, thanks.
Ben.
--
Ben Hutchings
Experience is directly proportional to the value of equipment destroyed.
- Carolyn Scheppner
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* [PATCH net-next v3] be2net: Fix to allow get/set of debug levels in the firmware.
From: Somnath Kotur @ 2012-05-12 3:39 UTC (permalink / raw)
To: netdev, bhutchings; +Cc: Somnath Kotur, Suresh Redy
Pls ignore previous patch v2.
Removed unwanted brace.
Incorporated comments from Ben Hutchings.
Signed-off-by: Suresh Redy <suresh.reddy@emulex.com>
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
---
drivers/net/ethernet/emulex/benet/be.h | 3 +
drivers/net/ethernet/emulex/benet/be_cmds.c | 56 +++++++++++++++++
drivers/net/ethernet/emulex/benet/be_cmds.h | 57 +++++++++++++++++
drivers/net/ethernet/emulex/benet/be_ethtool.c | 77 ++++++++++++++++++++++++
drivers/net/ethernet/emulex/benet/be_main.c | 37 +++++++++++
5 files changed, 230 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index c3ee910..9817fed 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -415,6 +415,7 @@ struct be_adapter {
bool wol;
u32 max_pmac_cnt; /* Max secondary UC MACs programmable */
u32 uc_macs; /* Count of secondary UC MAC programmed */
+ u32 msg_enable;
};
#define be_physfn(adapter) (!adapter->is_virtfn)
@@ -603,4 +604,6 @@ extern void be_parse_stats(struct be_adapter *adapter);
extern int be_load_fw(struct be_adapter *adapter, u8 *func);
extern bool be_is_wol_supported(struct be_adapter *adapter);
extern bool be_pause_supported(struct be_adapter *adapter);
+extern u32 be_get_fw_log_level(struct be_adapter *adapter);
+
#endif /* BE_H */
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 43167e8..b24623c 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -2589,4 +2589,60 @@ err:
mutex_unlock(&adapter->mbox_lock);
pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
return status;
+
+}
+int be_cmd_get_ext_fat_capabilites(struct be_adapter *adapter,
+ struct be_dma_mem *cmd)
+{
+ struct be_mcc_wrb *wrb;
+ struct be_cmd_req_get_ext_fat_caps *req;
+ int status;
+
+ if (mutex_lock_interruptible(&adapter->mbox_lock))
+ return -1;
+
+ wrb = wrb_from_mbox(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
+
+ req = cmd->va;
+ be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
+ OPCODE_COMMON_GET_EXT_FAT_CAPABILITES,
+ cmd->size, wrb, cmd);
+ req->parameter_type = cpu_to_le32(1);
+
+ status = be_mbox_notify_wait(adapter);
+err:
+ mutex_unlock(&adapter->mbox_lock);
+ return status;
+}
+
+int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter,
+ struct be_dma_mem *cmd,
+ struct be_fat_conf_params *configs)
+{
+ struct be_mcc_wrb *wrb;
+ struct be_cmd_req_set_ext_fat_caps *req;
+ int status;
+
+ spin_lock_bh(&adapter->mcc_lock);
+
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
+
+ req = cmd->va;
+ memcpy(&req->set_params, configs, sizeof(struct be_fat_conf_params));
+ be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
+ OPCODE_COMMON_SET_EXT_FAT_CAPABILITES,
+ cmd->size, wrb, cmd);
+
+ status = be_mcc_notify_wait(adapter);
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
+ return status;
}
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index 944f031..0b1029b 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -189,6 +189,8 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_GET_PHY_DETAILS 102
#define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103
#define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121
+#define OPCODE_COMMON_GET_EXT_FAT_CAPABILITES 125
+#define OPCODE_COMMON_SET_EXT_FAT_CAPABILITES 126
#define OPCODE_COMMON_GET_MAC_LIST 147
#define OPCODE_COMMON_SET_MAC_LIST 148
#define OPCODE_COMMON_GET_HSW_CONFIG 152
@@ -1602,6 +1604,56 @@ static inline void *be_erx_stats_from_cmd(struct be_adapter *adapter)
}
}
+
+/************** get fat capabilites *******************/
+#define MAX_MODULES 27
+#define MAX_MODES 4
+#define MODE_UART 0
+#define FW_LOG_LEVEL_DEFAULT 48
+#define FW_LOG_LEVEL_FATAL 64
+
+struct ext_fat_mode {
+ u8 mode;
+ u8 rsvd0;
+ u16 port_mask;
+ u32 dbg_lvl;
+ u64 fun_mask;
+} __packed;
+
+struct ext_fat_modules {
+ u8 modules_str[32];
+ u32 modules_id;
+ u32 num_modes;
+ struct ext_fat_mode trace_lvl[MAX_MODES];
+} __packed;
+
+struct be_fat_conf_params {
+ u32 max_log_entries;
+ u32 log_entry_size;
+ u8 log_type;
+ u8 max_log_funs;
+ u8 max_log_ports;
+ u8 rsvd0;
+ u32 supp_modes;
+ u32 num_modules;
+ struct ext_fat_modules module[MAX_MODULES];
+} __packed;
+
+struct be_cmd_req_get_ext_fat_caps {
+ struct be_cmd_req_hdr hdr;
+ u32 parameter_type;
+};
+
+struct be_cmd_resp_get_ext_fat_caps {
+ struct be_cmd_resp_hdr hdr;
+ struct be_fat_conf_params get_params;
+};
+
+struct be_cmd_req_set_ext_fat_caps {
+ struct be_cmd_req_hdr hdr;
+ struct be_fat_conf_params set_params;
+};
+
extern int be_pci_fnum_get(struct be_adapter *adapter);
extern int be_cmd_POST(struct be_adapter *adapter);
extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
@@ -1707,4 +1759,9 @@ extern int be_cmd_set_hsw_config(struct be_adapter *adapter, u16 pvid,
extern int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid,
u32 domain, u16 intf_id);
extern int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter);
+extern int be_cmd_get_ext_fat_capabilites(struct be_adapter *adapter,
+ struct be_dma_mem *cmd);
+extern int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter,
+ struct be_dma_mem *cmd,
+ struct be_fat_conf_params *cfgs);
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index 747f68f..2b5164f 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -878,6 +878,81 @@ be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
return status;
}
+static u32 be_get_msg_level(struct net_device *netdev)
+{
+ struct be_adapter *adapter = netdev_priv(netdev);
+
+ if (lancer_chip(adapter)) {
+ dev_err(&adapter->pdev->dev, "Operation not supported\n");
+ return -EOPNOTSUPP;
+ }
+
+ return adapter->msg_enable;
+}
+
+static void be_set_fw_log_level(struct be_adapter *adapter, u32 level)
+{
+ struct be_dma_mem extfat_cmd;
+ struct be_fat_conf_params *cfgs;
+ int status;
+ int i, j;
+
+ memset(&extfat_cmd, 0, sizeof(struct be_dma_mem));
+ extfat_cmd.size = sizeof(struct be_cmd_resp_get_ext_fat_caps);
+ extfat_cmd.va = pci_alloc_consistent(adapter->pdev, extfat_cmd.size,
+ &extfat_cmd.dma);
+ if (!extfat_cmd.va) {
+ dev_err(&adapter->pdev->dev, "%s: Memory allocation failure\n",
+ __func__);
+ goto err;
+ }
+ status = be_cmd_get_ext_fat_capabilites(adapter, &extfat_cmd);
+ if (!status) {
+ cfgs = (struct be_fat_conf_params *)(extfat_cmd.va +
+ sizeof(struct be_cmd_resp_hdr));
+ for (i = 0; i < cfgs->num_modules; i++) {
+ for (j = 0; j < cfgs->module[i].num_modes; j++) {
+ if (cfgs->module[i].trace_lvl[j].mode ==
+ MODE_UART)
+ cfgs->module[i].trace_lvl[j].dbg_lvl =
+ cpu_to_le32(level);
+ }
+ }
+ status = be_cmd_set_ext_fat_capabilites(adapter, &extfat_cmd,
+ cfgs);
+ if (status)
+ dev_err(&adapter->pdev->dev,
+ "Message level set failed\n");
+ } else {
+ dev_err(&adapter->pdev->dev, "Message level get failed\n");
+ }
+
+ pci_free_consistent(adapter->pdev, extfat_cmd.size, extfat_cmd.va,
+ extfat_cmd.dma);
+err:
+ return;
+}
+
+static void be_set_msg_level(struct net_device *netdev, u32 level)
+{
+ struct be_adapter *adapter = netdev_priv(netdev);
+
+ if (lancer_chip(adapter)) {
+ dev_err(&adapter->pdev->dev, "Operation not supported\n");
+ return;
+ }
+
+ if (adapter->msg_enable == level)
+ return;
+
+ if (level & NETIF_MSG_HW != adapter->msg_enable & NETIF_MSG_HW)
+ be_set_fw_log_level(adapter, level & NETIF_MSG_HW ?
+ FW_LOG_LEVEL_DEFAULT : FW_LOG_LEVEL_FATAL);
+ adapter->msg_enable = level;
+
+ return;
+}
+
const struct ethtool_ops be_ethtool_ops = {
.get_settings = be_get_settings,
.get_drvinfo = be_get_drvinfo,
@@ -893,6 +968,8 @@ const struct ethtool_ops be_ethtool_ops = {
.set_pauseparam = be_set_pauseparam,
.get_strings = be_get_stat_strings,
.set_phys_id = be_set_phys_id,
+ .get_msglevel = be_get_msg_level,
+ .set_msglevel = be_set_msg_level,
.get_sset_count = be_get_sset_count,
.get_ethtool_stats = be_get_ethtool_stats,
.get_regs_len = be_get_reg_len,
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 6d5d30b..c2286a2 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3367,9 +3367,43 @@ bool be_is_wol_supported(struct be_adapter *adapter)
!be_is_wol_excluded(adapter)) ? true : false;
}
+u32 be_get_fw_log_level(struct be_adapter *adapter)
+{
+ struct be_dma_mem extfat_cmd;
+ struct be_fat_conf_params *cfgs;
+ int status;
+ u32 level = 0;
+ int j;
+
+ memset(&extfat_cmd, 0, sizeof(struct be_dma_mem));
+ extfat_cmd.size = sizeof(struct be_cmd_resp_get_ext_fat_caps);
+ extfat_cmd.va = pci_alloc_consistent(adapter->pdev, extfat_cmd.size,
+ &extfat_cmd.dma);
+ if (!extfat_cmd.va) {
+ dev_err(&adapter->pdev->dev, "%s: Memory allocation failure\n",
+ __func__);
+ goto err;
+ }
+
+ status = be_cmd_get_ext_fat_capabilites(adapter, &extfat_cmd);
+ if (!status) {
+ cfgs = (struct be_fat_conf_params *)(extfat_cmd.va +
+ sizeof(struct be_cmd_resp_hdr));
+ for (j = 0; j < cfgs->module[0].num_modes; j++) {
+ if (cfgs->module[0].trace_lvl[j].mode == MODE_UART)
+ level = cfgs->module[0].trace_lvl[j].dbg_lvl;
+ }
+ }
+ pci_free_consistent(adapter->pdev, extfat_cmd.size, extfat_cmd.va,
+ extfat_cmd.dma);
+err:
+ return level;
+}
+
static int be_get_config(struct be_adapter *adapter)
{
int status;
+ u32 level;
status = be_cmd_query_fw_cfg(adapter, &adapter->port_num,
&adapter->function_mode, &adapter->function_caps);
@@ -3407,6 +3441,9 @@ static int be_get_config(struct be_adapter *adapter)
if (be_is_wol_supported(adapter))
adapter->wol = true;
+ level = be_get_fw_log_level(adapter);
+ adapter->msg_enable = level <= FW_LOG_LEVEL_DEFAULT ? NETIF_MSG_HW : 0;
+
return 0;
}
--
1.5.6.1
^ permalink raw reply related
* Re: [net-next 06/12] ixgbe: Hardware Timestamping + PTP Hardware Clock (PHC)
From: Richard Cochran @ 2012-05-12 5:24 UTC (permalink / raw)
To: Keller, Jacob E
Cc: Kirsher, Jeffrey T, davem@davemloft.net, netdev@vger.kernel.org,
gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <02874ECE860811409154E81DA85FBB5807794A06@ORSMSX105.amr.corp.intel.com>
On Fri, May 11, 2012 at 07:34:12PM +0000, Keller, Jacob E wrote:
>
> Sorry for the spam here, but I looked at the ixgbe code, and found a
> solution. When ptp4l discovers a missing rx timestamp, it faults and
> then waits for 15 seconds until the fault is cleared. After this, it
> reopens the socket, and reruns the hwtstamp ioctl. This function
> actually does clear the tx/rx timestamps (just in case) So after a
> fault the values should end up being reset. Is this good enough?
Yes, for ptp4l, that will work, but this program is acting extremely
defensively in that situation. Not every user space program will
necessarily behave in the same way. The classic ptpd just ignores
packets with missing time stamps, IRRC.
Richard
^ permalink raw reply
* Re: [net-next 06/12] ixgbe: Hardware Timestamping + PTP Hardware Clock (PHC)
From: Richard Cochran @ 2012-05-12 5:34 UTC (permalink / raw)
To: Keller, Jacob E
Cc: Kirsher, Jeffrey T, davem@davemloft.net, netdev@vger.kernel.org,
gospo@redhat.com, sassmann@redhat.com
In-Reply-To: <02874ECE860811409154E81DA85FBB58077949E8@ORSMSX105.amr.corp.intel.com>
On Fri, May 11, 2012 at 07:23:44PM +0000, Keller, Jacob E wrote:
>
>
> I believe this very rare case might be possible, but I don't think
> that checking the ptp seqid will fix anything. In normal cases,
> hardware latches Rx packet timestamp, then the ptp packet goes into
> the queue and we process it shortly after. Before we process that
> packet there will never be another packet in the queue that needs a
> timestamp. We know this because the hardware stops timestamping
> until we unlatch the RX registers. This should mean we don't need to
> check the sequence ID, and spending time doing it would never fix
> the issue you are talking about.
>
> The issue is for when a packet is timestamped and then never reaches
> the queue. Then the rx stamp registers are locked for good, because
> we never clear them, and hardware would never timestamp another
> receive packet. I don't know a good solution to this, except to
> clear the registers periodically. Do you have any suggestions?
Well, one solution would be to check every received packet with the
BPF in ptp_classify.h (whenever Rx time stamping is enabled).
When the driver finds an event packet in the Rx queue, and
TSYNCRXCTL[RXTT] is set, it reads out the time stamp along with
RXSATRL/H. If the fields match, then add the time stamp to the skb.
[ Or perhaps instead of using RXSATRL/H, just use the descriptor bit.
If *not* set, then the time stamp does not belong to this packet. ]
HTH,
Richard
^ permalink raw reply
* Re: [PATCH RFC 1/6] skbuff: support per-page destructors in copy_ubufs
From: Ian Campbell @ 2012-05-12 6:01 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: David Miller, netdev@vger.kernel.org, eric.dumazet@gmail.com
In-Reply-To: <20120511163057.GB10344@redhat.com>
On Fri, 2012-05-11 at 17:30 +0100, Michael S. Tsirkin wrote:
> On Fri, May 11, 2012 at 03:08:36PM +0300, Michael S. Tsirkin wrote:
> > On Fri, May 11, 2012 at 11:58:12AM +0100, Ian Campbell wrote:
> > > On Fri, 2012-05-11 at 10:00 +0100, Ian Campbell wrote:
> > > > I'm seeing copy_ubufs called in my remote NFS test, which I don't
> > > > think I expected -- I'll investigate why this is happening today.
> > >
> > > It's tcp_transmit_skb which can (conditionally) call skb_clone
> > > (backtrace below)
> >
> > Interesting. I didn't realise we clone skbs on data path:
> > tcp_write_xmit calls tcp_transmit_skb with clone_it flag.
> > Could someone comment on why we need to clone on good path
> > like this?
>
> Hmm, it's in case we need to retransmit it later.
I wonder if we could avoid the copy_ubuf in this particular clone path
and have any subsequent calls to copy_ubufs use skb->fclone to determine
if it can safely replace the frags?
If it cannot then could it do a full copy of the skb (including new
shinfo, new frag pages etc) as a fallback?
Ian.
^ permalink raw reply
* [PATCH 00/17 v5] usb/net: rndis: first step toward consolidation
From: Linus Walleij @ 2012-05-12 8:15 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
David S. Miller, Greg Kroah-Hartman, Felipe Balbi
Cc: Jussi Kivilinna, Haiyang Zhang, Wei Yongjun, Ben Hutchings,
Linus Walleij
A fifth iteration of the first steps of RNDIS consolidation.
This version mainly address byte order issues found with
sparse by Jussi Kivilinna, his fixes are folded into patch 1.
At the end I have added Jussis patches cleaning up rndis_host and
rndis_wlan based on top of this series.
Jussi Kivilinna (4):
rndis_host: cleanup: byteswap data from device instead of RNDIS_*
defines
rndis_wlan: cleanup: byteswap data from device instead of RNDIS_*
defines
rndis_host: cleanup: change oid from __le32 to u32 in rndis_query()
rndis_wlan: cleanup: change oid from __le32 to u32 in various places
Linus Walleij (13):
usb/net: rndis: inline the cpu_to_le32() macro
usb/net: rndis: break out <linux/rndis.h> defines
usb/net: rndis: remove ambigous status codes
usb/net: rndis: eliminate first set of duplicate OIDs
usb/net: rndis: merge duplicate 802_* OIDs
usb/net: rndis: delete surplus defines
usb/net: rndis: group all status codes together
usb/net: rndis: merge media type definitions
usb/net: rndis: delete duplicate packet types
usb/net: rndis: move and namespace PnP defines
usb/net: rndis: merge command codes
usb/net: rndis: fixup a few name prefixes
usb/net: rndis: move bus message definition
drivers/net/hyperv/hyperv_net.h | 290 +---------------------------
drivers/net/hyperv/rndis_filter.c | 46 +++---
drivers/net/usb/rndis_host.c | 83 ++++----
drivers/net/wireless/rndis_wlan.c | 361 +++++++++++++++++------------------
drivers/usb/gadget/f_rndis.c | 6 +-
drivers/usb/gadget/ndis.h | 164 ----------------
drivers/usb/gadget/rndis.c | 271 +++++++++++++-------------
drivers/usb/gadget/rndis.h | 48 +-----
include/linux/rndis.h | 390 +++++++++++++++++++++++++++++++++++++
include/linux/usb/rndis_host.h | 66 +------
10 files changed, 774 insertions(+), 951 deletions(-)
create mode 100644 include/linux/rndis.h
--
1.7.7.6
--
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
* [PATCH 01/17 v5] usb/net: rndis: inline the cpu_to_le32() macro
From: Linus Walleij @ 2012-05-12 8:15 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
David S. Miller, Greg Kroah-Hartman, Felipe Balbi
Cc: Jussi Kivilinna, Haiyang Zhang, Wei Yongjun, Ben Hutchings,
Linus Walleij
The header file <linux/usb/rndis_host.h> used a number of #defines
that included the cpu_to_le32() macro to assure the result will be
in LE endianness. Inlining this into the code instead of using it
in the code definitions yields consolidation opportunities later
on as you will see in the following patches. The individual
drivers also used local defines - all are switched over to the
pattern of doing the conversion at the call sites instead.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna-E01nCVcF24I@public.gmane.org>
Signed-off-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
ChangeLog v1->v5:
- Folded in a number of endianness fixes from Jussi Kivilinna.
---
drivers/net/usb/rndis_host.c | 54 +++++-----
drivers/net/wireless/rndis_wlan.c | 212 +++++++++++++++++++------------------
include/linux/usb/rndis_host.h | 84 +++++++-------
3 files changed, 177 insertions(+), 173 deletions(-)
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index c8f1b5b..3b7ddfd 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -78,10 +78,10 @@ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg,
dev->driver_info->indication(dev, msg, buflen);
} else {
switch (msg->status) {
- case RNDIS_STATUS_MEDIA_CONNECT:
+ case cpu_to_le32(RNDIS_STATUS_MEDIA_CONNECT):
dev_info(udev, "rndis media connect\n");
break;
- case RNDIS_STATUS_MEDIA_DISCONNECT:
+ case cpu_to_le32(RNDIS_STATUS_MEDIA_DISCONNECT):
dev_info(udev, "rndis media disconnect\n");
break;
default:
@@ -117,8 +117,8 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
*/
/* Issue the request; xid is unique, don't bother byteswapping it */
- if (likely(buf->msg_type != RNDIS_MSG_HALT &&
- buf->msg_type != RNDIS_MSG_RESET)) {
+ if (likely(buf->msg_type != cpu_to_le32(RNDIS_MSG_HALT) &&
+ buf->msg_type != cpu_to_le32(RNDIS_MSG_RESET))) {
xid = dev->xid++;
if (!xid)
xid = dev->xid++;
@@ -149,7 +149,7 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
}
/* Poll the control channel; the request probably completed immediately */
- rsp = buf->msg_type | RNDIS_MSG_COMPLETION;
+ rsp = buf->msg_type | cpu_to_le32(RNDIS_MSG_COMPLETION);
for (count = 0; count < 10; count++) {
memset(buf, 0, CONTROL_BUFFER_SIZE);
retval = usb_control_msg(dev->udev,
@@ -164,9 +164,10 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
request_id = (__force u32) buf->request_id;
if (likely(buf->msg_type == rsp)) {
if (likely(request_id == xid)) {
- if (unlikely(rsp == RNDIS_MSG_RESET_C))
+ if (unlikely(rsp ==
+ cpu_to_le32(RNDIS_MSG_RESET_C)))
return 0;
- if (likely(RNDIS_STATUS_SUCCESS
+ if (likely(cpu_to_le32(RNDIS_STATUS_SUCCESS)
== buf->status))
return 0;
dev_dbg(&info->control->dev,
@@ -179,16 +180,15 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
request_id, xid);
/* then likely retry */
} else switch (buf->msg_type) {
- case RNDIS_MSG_INDICATE: /* fault/event */
+ case cpu_to_le32(RNDIS_MSG_INDICATE): /* fault/event */
rndis_msg_indicate(dev, (void *)buf, buflen);
-
break;
- case RNDIS_MSG_KEEPALIVE: { /* ping */
+ case cpu_to_le32(RNDIS_MSG_KEEPALIVE): { /* ping */
struct rndis_keepalive_c *msg = (void *)buf;
- msg->msg_type = RNDIS_MSG_KEEPALIVE_C;
+ msg->msg_type = cpu_to_le32(RNDIS_MSG_KEEPALIVE_C);
msg->msg_len = cpu_to_le32(sizeof *msg);
- msg->status = RNDIS_STATUS_SUCCESS;
+ msg->status = cpu_to_le32(RNDIS_STATUS_SUCCESS);
retval = usb_control_msg(dev->udev,
usb_sndctrlpipe(dev->udev, 0),
USB_CDC_SEND_ENCAPSULATED_COMMAND,
@@ -251,7 +251,7 @@ static int rndis_query(struct usbnet *dev, struct usb_interface *intf,
u.buf = buf;
memset(u.get, 0, sizeof *u.get + in_len);
- u.get->msg_type = RNDIS_MSG_QUERY;
+ u.get->msg_type = cpu_to_le32(RNDIS_MSG_QUERY);
u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len);
u.get->oid = oid;
u.get->len = cpu_to_le32(in_len);
@@ -324,7 +324,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
if (retval < 0)
goto fail;
- u.init->msg_type = RNDIS_MSG_INIT;
+ u.init->msg_type = cpu_to_le32(RNDIS_MSG_INIT);
u.init->msg_len = cpu_to_le32(sizeof *u.init);
u.init->major_version = cpu_to_le32(1);
u.init->minor_version = cpu_to_le32(0);
@@ -395,22 +395,23 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
/* Check physical medium */
phym = NULL;
reply_len = sizeof *phym;
- retval = rndis_query(dev, intf, u.buf, OID_GEN_PHYSICAL_MEDIUM,
+ retval = rndis_query(dev, intf, u.buf,
+ cpu_to_le32(OID_GEN_PHYSICAL_MEDIUM),
0, (void **) &phym, &reply_len);
if (retval != 0 || !phym) {
/* OID is optional so don't fail here. */
- phym_unspec = RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED;
+ phym_unspec = cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED);
phym = &phym_unspec;
}
if ((flags & FLAG_RNDIS_PHYM_WIRELESS) &&
- *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) {
+ *phym != cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN)) {
netif_dbg(dev, probe, dev->net,
"driver requires wireless physical medium, but device is not\n");
retval = -ENODEV;
goto halt_fail_and_release;
}
if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) &&
- *phym == RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) {
+ *phym == cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN)) {
netif_dbg(dev, probe, dev->net,
"driver requires non-wireless physical medium, but device is wireless.\n");
retval = -ENODEV;
@@ -419,7 +420,8 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
/* Get designated host ethernet address */
reply_len = ETH_ALEN;
- retval = rndis_query(dev, intf, u.buf, OID_802_3_PERMANENT_ADDRESS,
+ retval = rndis_query(dev, intf, u.buf,
+ cpu_to_le32(OID_802_3_PERMANENT_ADDRESS),
48, (void **) &bp, &reply_len);
if (unlikely(retval< 0)) {
dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval);
@@ -430,12 +432,12 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
/* set a nonzero filter to enable data transfers */
memset(u.set, 0, sizeof *u.set);
- u.set->msg_type = RNDIS_MSG_SET;
+ u.set->msg_type = cpu_to_le32(RNDIS_MSG_SET);
u.set->msg_len = cpu_to_le32(4 + sizeof *u.set);
- u.set->oid = OID_GEN_CURRENT_PACKET_FILTER;
+ u.set->oid = cpu_to_le32(OID_GEN_CURRENT_PACKET_FILTER);
u.set->len = cpu_to_le32(4);
u.set->offset = cpu_to_le32((sizeof *u.set) - 8);
- *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER;
+ *(__le32 *)(u.buf + sizeof *u.set) = cpu_to_le32(RNDIS_DEFAULT_FILTER);
retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE);
if (unlikely(retval < 0)) {
@@ -450,7 +452,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
halt_fail_and_release:
memset(u.halt, 0, sizeof *u.halt);
- u.halt->msg_type = RNDIS_MSG_HALT;
+ u.halt->msg_type = cpu_to_le32(RNDIS_MSG_HALT);
u.halt->msg_len = cpu_to_le32(sizeof *u.halt);
(void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE);
fail_and_release:
@@ -475,7 +477,7 @@ void rndis_unbind(struct usbnet *dev, struct usb_interface *intf)
/* try to clear any rndis state/activity (no i/o from stack!) */
halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL);
if (halt) {
- halt->msg_type = RNDIS_MSG_HALT;
+ halt->msg_type = cpu_to_le32(RNDIS_MSG_HALT);
halt->msg_len = cpu_to_le32(sizeof *halt);
(void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE);
kfree(halt);
@@ -501,7 +503,7 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
data_len = le32_to_cpu(hdr->data_len);
/* don't choke if we see oob, per-packet data, etc */
- if (unlikely(hdr->msg_type != RNDIS_MSG_PACKET ||
+ if (unlikely(hdr->msg_type != cpu_to_le32(RNDIS_MSG_PACKET) ||
skb->len < msg_len ||
(data_offset + data_len + 8) > msg_len)) {
dev->net->stats.rx_frame_errors++;
@@ -569,7 +571,7 @@ rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
fill:
hdr = (void *) __skb_push(skb, sizeof *hdr);
memset(hdr, 0, sizeof *hdr);
- hdr->msg_type = RNDIS_MSG_PACKET;
+ hdr->msg_type = cpu_to_le32(RNDIS_MSG_PACKET);
hdr->msg_len = cpu_to_le32(skb->len);
hdr->data_offset = cpu_to_le32(sizeof(*hdr) - 8);
hdr->data_len = cpu_to_le32(len);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index d66e298..a686b5d 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -90,45 +90,45 @@ MODULE_PARM_DESC(workaround_interval,
/* various RNDIS OID defs */
-#define OID_GEN_LINK_SPEED cpu_to_le32(0x00010107)
-#define OID_GEN_RNDIS_CONFIG_PARAMETER cpu_to_le32(0x0001021b)
-
-#define OID_GEN_XMIT_OK cpu_to_le32(0x00020101)
-#define OID_GEN_RCV_OK cpu_to_le32(0x00020102)
-#define OID_GEN_XMIT_ERROR cpu_to_le32(0x00020103)
-#define OID_GEN_RCV_ERROR cpu_to_le32(0x00020104)
-#define OID_GEN_RCV_NO_BUFFER cpu_to_le32(0x00020105)
-
-#define OID_802_3_CURRENT_ADDRESS cpu_to_le32(0x01010102)
-#define OID_802_3_MULTICAST_LIST cpu_to_le32(0x01010103)
-#define OID_802_3_MAXIMUM_LIST_SIZE cpu_to_le32(0x01010104)
-
-#define OID_802_11_BSSID cpu_to_le32(0x0d010101)
-#define OID_802_11_SSID cpu_to_le32(0x0d010102)
-#define OID_802_11_INFRASTRUCTURE_MODE cpu_to_le32(0x0d010108)
-#define OID_802_11_ADD_WEP cpu_to_le32(0x0d010113)
-#define OID_802_11_REMOVE_WEP cpu_to_le32(0x0d010114)
-#define OID_802_11_DISASSOCIATE cpu_to_le32(0x0d010115)
-#define OID_802_11_AUTHENTICATION_MODE cpu_to_le32(0x0d010118)
-#define OID_802_11_PRIVACY_FILTER cpu_to_le32(0x0d010119)
-#define OID_802_11_BSSID_LIST_SCAN cpu_to_le32(0x0d01011a)
-#define OID_802_11_ENCRYPTION_STATUS cpu_to_le32(0x0d01011b)
-#define OID_802_11_ADD_KEY cpu_to_le32(0x0d01011d)
-#define OID_802_11_REMOVE_KEY cpu_to_le32(0x0d01011e)
-#define OID_802_11_ASSOCIATION_INFORMATION cpu_to_le32(0x0d01011f)
-#define OID_802_11_CAPABILITY cpu_to_le32(0x0d010122)
-#define OID_802_11_PMKID cpu_to_le32(0x0d010123)
-#define OID_802_11_NETWORK_TYPES_SUPPORTED cpu_to_le32(0x0d010203)
-#define OID_802_11_NETWORK_TYPE_IN_USE cpu_to_le32(0x0d010204)
-#define OID_802_11_TX_POWER_LEVEL cpu_to_le32(0x0d010205)
-#define OID_802_11_RSSI cpu_to_le32(0x0d010206)
-#define OID_802_11_RSSI_TRIGGER cpu_to_le32(0x0d010207)
-#define OID_802_11_FRAGMENTATION_THRESHOLD cpu_to_le32(0x0d010209)
-#define OID_802_11_RTS_THRESHOLD cpu_to_le32(0x0d01020a)
-#define OID_802_11_SUPPORTED_RATES cpu_to_le32(0x0d01020e)
-#define OID_802_11_CONFIGURATION cpu_to_le32(0x0d010211)
-#define OID_802_11_POWER_MODE cpu_to_le32(0x0d010216)
-#define OID_802_11_BSSID_LIST cpu_to_le32(0x0d010217)
+#define OID_GEN_LINK_SPEED 0x00010107
+#define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021b
+
+#define OID_GEN_XMIT_OK 0x00020101
+#define OID_GEN_RCV_OK 0x00020102
+#define OID_GEN_XMIT_ERROR 0x00020103
+#define OID_GEN_RCV_ERROR 0x00020104
+#define OID_GEN_RCV_NO_BUFFER 0x00020105
+
+#define OID_802_3_CURRENT_ADDRESS 0x01010102
+#define OID_802_3_MULTICAST_LIST 0x01010103
+#define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
+
+#define OID_802_11_BSSID 0x0d010101
+#define OID_802_11_SSID 0x0d010102
+#define OID_802_11_INFRASTRUCTURE_MODE 0x0d010108
+#define OID_802_11_ADD_WEP 0x0d010113
+#define OID_802_11_REMOVE_WEP 0x0d010114
+#define OID_802_11_DISASSOCIATE 0x0d010115
+#define OID_802_11_AUTHENTICATION_MODE 0x0d010118
+#define OID_802_11_PRIVACY_FILTER 0x0d010119
+#define OID_802_11_BSSID_LIST_SCAN 0x0d01011a
+#define OID_802_11_ENCRYPTION_STATUS 0x0d01011b
+#define OID_802_11_ADD_KEY 0x0d01011d
+#define OID_802_11_REMOVE_KEY 0x0d01011e
+#define OID_802_11_ASSOCIATION_INFORMATION 0x0d01011f
+#define OID_802_11_CAPABILITY 0x0d010122
+#define OID_802_11_PMKID 0x0d010123
+#define OID_802_11_NETWORK_TYPES_SUPPORTED 0x0d010203
+#define OID_802_11_NETWORK_TYPE_IN_USE 0x0d010204
+#define OID_802_11_TX_POWER_LEVEL 0x0d010205
+#define OID_802_11_RSSI 0x0d010206
+#define OID_802_11_RSSI_TRIGGER 0x0d010207
+#define OID_802_11_FRAGMENTATION_THRESHOLD 0x0d010209
+#define OID_802_11_RTS_THRESHOLD 0x0d01020a
+#define OID_802_11_SUPPORTED_RATES 0x0d01020e
+#define OID_802_11_CONFIGURATION 0x0d010211
+#define OID_802_11_POWER_MODE 0x0d010216
+#define OID_802_11_BSSID_LIST 0x0d010217
/* Typical noise/maximum signal level values taken from ndiswrapper iw_ndis.h */
@@ -151,8 +151,8 @@ MODULE_PARM_DESC(workaround_interval,
/* codes for "status" field of completion messages */
-#define RNDIS_STATUS_ADAPTER_NOT_READY cpu_to_le32(0xc0010011)
-#define RNDIS_STATUS_ADAPTER_NOT_OPEN cpu_to_le32(0xc0010012)
+#define RNDIS_STATUS_ADAPTER_NOT_READY 0xc0010011
+#define RNDIS_STATUS_ADAPTER_NOT_OPEN 0xc0010012
/* Known device types */
@@ -673,7 +673,7 @@ static int rndis_akm_suite_to_key_mgmt(u32 akm_suite)
static const char *oid_to_string(__le32 oid)
{
switch (oid) {
-#define OID_STR(oid) case oid: return(#oid)
+#define OID_STR(oid) case cpu_to_le32(oid): return(#oid)
/* from rndis_host.h */
OID_STR(OID_802_3_PERMANENT_ADDRESS);
OID_STR(OID_GEN_MAXIMUM_FRAME_SIZE);
@@ -737,18 +737,18 @@ static int rndis_error_status(__le32 rndis_status)
{
int ret = -EINVAL;
switch (rndis_status) {
- case RNDIS_STATUS_SUCCESS:
+ case cpu_to_le32(RNDIS_STATUS_SUCCESS):
ret = 0;
break;
- case RNDIS_STATUS_FAILURE:
- case RNDIS_STATUS_INVALID_DATA:
+ case cpu_to_le32(RNDIS_STATUS_FAILURE):
+ case cpu_to_le32(RNDIS_STATUS_INVALID_DATA):
ret = -EINVAL;
break;
- case RNDIS_STATUS_NOT_SUPPORTED:
+ case cpu_to_le32(RNDIS_STATUS_NOT_SUPPORTED):
ret = -EOPNOTSUPP;
break;
- case RNDIS_STATUS_ADAPTER_NOT_READY:
- case RNDIS_STATUS_ADAPTER_NOT_OPEN:
+ case cpu_to_le32(RNDIS_STATUS_ADAPTER_NOT_READY):
+ case cpu_to_le32(RNDIS_STATUS_ADAPTER_NOT_OPEN):
ret = -EBUSY;
break;
}
@@ -782,7 +782,7 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len)
mutex_lock(&priv->command_lock);
memset(u.get, 0, sizeof *u.get);
- u.get->msg_type = RNDIS_MSG_QUERY;
+ u.get->msg_type = cpu_to_le32(RNDIS_MSG_QUERY);
u.get->msg_len = cpu_to_le32(sizeof *u.get);
u.get->oid = oid;
@@ -866,7 +866,7 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, const void *data,
mutex_lock(&priv->command_lock);
memset(u.set, 0, sizeof *u.set);
- u.set->msg_type = RNDIS_MSG_SET;
+ u.set->msg_type = cpu_to_le32(RNDIS_MSG_SET);
u.set->msg_len = cpu_to_le32(sizeof(*u.set) + len);
u.set->oid = oid;
u.set->len = cpu_to_le32(len);
@@ -908,7 +908,7 @@ static int rndis_reset(struct usbnet *usbdev)
reset = (void *)priv->command_buffer;
memset(reset, 0, sizeof(*reset));
- reset->msg_type = RNDIS_MSG_RESET;
+ reset->msg_type = cpu_to_le32(RNDIS_MSG_RESET);
reset->msg_len = cpu_to_le32(sizeof(*reset));
priv->current_command_oid = 0;
ret = rndis_command(usbdev, (void *)reset, CONTROL_BUFFER_SIZE);
@@ -994,7 +994,7 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param,
}
#endif
- ret = rndis_set_oid(dev, OID_GEN_RNDIS_CONFIG_PARAMETER,
+ ret = rndis_set_oid(dev, cpu_to_le32(OID_GEN_RNDIS_CONFIG_PARAMETER),
infobuf, info_len);
if (ret != 0)
netdev_dbg(dev->net, "setting rndis config parameter failed, %d\n",
@@ -1033,7 +1033,7 @@ static int rndis_start_bssid_list_scan(struct usbnet *usbdev)
/* Note: OID_802_11_BSSID_LIST_SCAN clears internal BSS list. */
tmp = cpu_to_le32(1);
- return rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp,
+ return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_BSSID_LIST_SCAN), &tmp,
sizeof(tmp));
}
@@ -1042,7 +1042,7 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid)
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
int ret;
- ret = rndis_set_oid(usbdev, OID_802_11_SSID, ssid, sizeof(*ssid));
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_SSID), ssid, sizeof(*ssid));
if (ret < 0) {
netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret);
return ret;
@@ -1059,7 +1059,7 @@ static int set_bssid(struct usbnet *usbdev, const u8 *bssid)
{
int ret;
- ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN);
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_BSSID), bssid, ETH_ALEN);
if (ret < 0) {
netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n",
bssid, ret);
@@ -1083,7 +1083,7 @@ static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])
int ret, len;
len = ETH_ALEN;
- ret = rndis_query_oid(usbdev, OID_802_11_BSSID, bssid, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_BSSID), bssid, &len);
if (ret != 0)
memset(bssid, 0, ETH_ALEN);
@@ -1094,7 +1094,7 @@ static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN])
static int get_association_info(struct usbnet *usbdev,
struct ndis_80211_assoc_info *info, int len)
{
- return rndis_query_oid(usbdev, OID_802_11_ASSOCIATION_INFORMATION,
+ return rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_ASSOCIATION_INFORMATION),
info, &len);
}
@@ -1119,7 +1119,7 @@ static int disassociate(struct usbnet *usbdev, bool reset_ssid)
int i, ret = 0;
if (priv->radio_on) {
- ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0);
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_DISASSOCIATE), NULL, 0);
if (ret == 0) {
priv->radio_on = false;
netdev_dbg(usbdev->net, "%s(): radio_on = false\n",
@@ -1181,7 +1181,7 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version,
return -ENOTSUPP;
tmp = cpu_to_le32(auth_mode);
- ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_AUTHENTICATION_MODE), &tmp,
sizeof(tmp));
if (ret != 0) {
netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n",
@@ -1208,7 +1208,7 @@ static int set_priv_filter(struct usbnet *usbdev)
else
tmp = cpu_to_le32(NDIS_80211_PRIV_ACCEPT_ALL);
- return rndis_set_oid(usbdev, OID_802_11_PRIVACY_FILTER, &tmp,
+ return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_PRIVACY_FILTER), &tmp,
sizeof(tmp));
}
@@ -1234,7 +1234,7 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise)
encr_mode = NDIS_80211_ENCR_DISABLED;
tmp = cpu_to_le32(encr_mode);
- ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_ENCRYPTION_STATUS), &tmp,
sizeof(tmp));
if (ret != 0) {
netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n",
@@ -1255,7 +1255,7 @@ static int set_infra_mode(struct usbnet *usbdev, int mode)
__func__, priv->infra_mode);
tmp = cpu_to_le32(mode);
- ret = rndis_set_oid(usbdev, OID_802_11_INFRASTRUCTURE_MODE, &tmp,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_INFRASTRUCTURE_MODE), &tmp,
sizeof(tmp));
if (ret != 0) {
netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n",
@@ -1282,7 +1282,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold)
rts_threshold = 2347;
tmp = cpu_to_le32(rts_threshold);
- return rndis_set_oid(usbdev, OID_802_11_RTS_THRESHOLD, &tmp,
+ return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_RTS_THRESHOLD), &tmp,
sizeof(tmp));
}
@@ -1296,7 +1296,7 @@ static int set_frag_threshold(struct usbnet *usbdev, u32 frag_threshold)
frag_threshold = 2346;
tmp = cpu_to_le32(frag_threshold);
- return rndis_set_oid(usbdev, OID_802_11_FRAGMENTATION_THRESHOLD, &tmp,
+ return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_FRAGMENTATION_THRESHOLD), &tmp,
sizeof(tmp));
}
@@ -1333,7 +1333,7 @@ static int set_channel(struct usbnet *usbdev, int channel)
dsconfig = ieee80211_dsss_chan_to_freq(channel) * 1000;
len = sizeof(config);
- ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_CONFIGURATION), &config, &len);
if (ret < 0) {
netdev_dbg(usbdev->net, "%s(): querying configuration failed\n",
__func__);
@@ -1341,7 +1341,7 @@ static int set_channel(struct usbnet *usbdev, int channel)
}
config.ds_config = cpu_to_le32(dsconfig);
- ret = rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_CONFIGURATION), &config,
sizeof(config));
netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret);
@@ -1359,7 +1359,7 @@ static struct ieee80211_channel *get_current_channel(struct usbnet *usbdev,
/* Get channel and beacon interval */
len = sizeof(config);
- ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_CONFIGURATION), &config, &len);
netdev_dbg(usbdev->net, "%s(): OID_802_11_CONFIGURATION -> %d\n",
__func__, ret);
if (ret < 0)
@@ -1413,7 +1413,7 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len,
ret);
}
- ret = rndis_set_oid(usbdev, OID_802_11_ADD_WEP, &ndis_key,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_ADD_WEP), &ndis_key,
sizeof(ndis_key));
if (ret != 0) {
netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n",
@@ -1504,7 +1504,7 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
get_bssid(usbdev, ndis_key.bssid);
}
- ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_ADD_KEY), &ndis_key,
le32_to_cpu(ndis_key.size));
netdev_dbg(usbdev->net, "%s(): OID_802_11_ADD_KEY -> %08X\n",
__func__, ret);
@@ -1594,13 +1594,13 @@ static int remove_key(struct usbnet *usbdev, u8 index, const u8 *bssid)
memset(remove_key.bssid, 0xff,
sizeof(remove_key.bssid));
- ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_KEY, &remove_key,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_REMOVE_KEY), &remove_key,
sizeof(remove_key));
if (ret != 0)
return ret;
} else {
keyindex = cpu_to_le32(index);
- ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_WEP, &keyindex,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_REMOVE_WEP), &keyindex,
sizeof(keyindex));
if (ret != 0) {
netdev_warn(usbdev->net,
@@ -1626,14 +1626,14 @@ static void set_multicast_list(struct usbnet *usbdev)
char *mc_addrs = NULL;
int mc_count;
- basefilter = filter = RNDIS_PACKET_TYPE_DIRECTED |
- RNDIS_PACKET_TYPE_BROADCAST;
+ basefilter = filter = cpu_to_le32(RNDIS_PACKET_TYPE_DIRECTED |
+ RNDIS_PACKET_TYPE_BROADCAST);
if (usbdev->net->flags & IFF_PROMISC) {
- filter |= RNDIS_PACKET_TYPE_PROMISCUOUS |
- RNDIS_PACKET_TYPE_ALL_LOCAL;
+ filter |= cpu_to_le32(RNDIS_PACKET_TYPE_PROMISCUOUS |
+ RNDIS_PACKET_TYPE_ALL_LOCAL);
} else if (usbdev->net->flags & IFF_ALLMULTI) {
- filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST;
+ filter |= cpu_to_le32(RNDIS_PACKET_TYPE_ALL_MULTICAST);
}
if (filter != basefilter)
@@ -1646,7 +1646,7 @@ static void set_multicast_list(struct usbnet *usbdev)
netif_addr_lock_bh(usbdev->net);
mc_count = netdev_mc_count(usbdev->net);
if (mc_count > priv->multicast_size) {
- filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST;
+ filter |= cpu_to_le32(RNDIS_PACKET_TYPE_ALL_MULTICAST);
} else if (mc_count) {
int i = 0;
@@ -1669,20 +1669,20 @@ static void set_multicast_list(struct usbnet *usbdev)
goto set_filter;
if (mc_count) {
- ret = rndis_set_oid(usbdev, OID_802_3_MULTICAST_LIST, mc_addrs,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_3_MULTICAST_LIST), mc_addrs,
mc_count * ETH_ALEN);
kfree(mc_addrs);
if (ret == 0)
- filter |= RNDIS_PACKET_TYPE_MULTICAST;
+ filter |= cpu_to_le32(RNDIS_PACKET_TYPE_MULTICAST);
else
- filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST;
+ filter |= cpu_to_le32(RNDIS_PACKET_TYPE_ALL_MULTICAST);
netdev_dbg(usbdev->net, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d\n",
mc_count, priv->multicast_size, ret);
}
set_filter:
- ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_GEN_CURRENT_PACKET_FILTER), &filter,
sizeof(filter));
if (ret < 0) {
netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n",
@@ -1748,7 +1748,7 @@ static struct ndis_80211_pmkid *get_device_pmkids(struct usbnet *usbdev)
pmkids->length = cpu_to_le32(len);
pmkids->bssid_info_count = cpu_to_le32(max_pmkids);
- ret = rndis_query_oid(usbdev, OID_802_11_PMKID, pmkids, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_PMKID), pmkids, &len);
if (ret < 0) {
netdev_dbg(usbdev->net, "%s(): OID_802_11_PMKID(%d, %d)"
" -> %d\n", __func__, len, max_pmkids, ret);
@@ -1776,7 +1776,7 @@ static int set_device_pmkids(struct usbnet *usbdev,
debug_print_pmkids(usbdev, pmkids, __func__);
- ret = rndis_set_oid(usbdev, OID_802_11_PMKID, pmkids,
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_PMKID), pmkids,
le32_to_cpu(pmkids->length));
if (ret < 0) {
netdev_dbg(usbdev->net, "%s(): OID_802_11_PMKID(%d, %d) -> %d"
@@ -2113,7 +2113,7 @@ resize_buf:
* resizing until it won't get any bigger.
*/
new_len = len;
- ret = rndis_query_oid(usbdev, OID_802_11_BSSID_LIST, buf, &new_len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_BSSID_LIST), buf, &new_len);
if (ret != 0 || new_len < sizeof(struct ndis_80211_bssid_list_ex))
goto out;
@@ -2511,14 +2511,14 @@ static void rndis_fill_station_info(struct usbnet *usbdev,
memset(sinfo, 0, sizeof(*sinfo));
len = sizeof(linkspeed);
- ret = rndis_query_oid(usbdev, OID_GEN_LINK_SPEED, &linkspeed, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_GEN_LINK_SPEED), &linkspeed, &len);
if (ret == 0) {
sinfo->txrate.legacy = le32_to_cpu(linkspeed) / 1000;
sinfo->filled |= STATION_INFO_TX_BITRATE;
}
len = sizeof(rssi);
- ret = rndis_query_oid(usbdev, OID_802_11_RSSI, &rssi, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_RSSI), &rssi, &len);
if (ret == 0) {
sinfo->signal = level_to_qual(le32_to_cpu(rssi));
sinfo->filled |= STATION_INFO_SIGNAL;
@@ -2624,7 +2624,7 @@ static int rndis_flush_pmksa(struct wiphy *wiphy, struct net_device *netdev)
pmkid.length = cpu_to_le32(sizeof(pmkid));
pmkid.bssid_info_count = cpu_to_le32(0);
- return rndis_set_oid(usbdev, OID_802_11_PMKID, &pmkid, sizeof(pmkid));
+ return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_PMKID), &pmkid, sizeof(pmkid));
}
static int rndis_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
@@ -2654,7 +2654,7 @@ static int rndis_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
priv->power_mode = power_mode;
mode = cpu_to_le32(power_mode);
- ret = rndis_set_oid(usbdev, OID_802_11_POWER_MODE, &mode, sizeof(mode));
+ ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_POWER_MODE), &mode, sizeof(mode));
netdev_dbg(usbdev->net, "%s(): OID_802_11_POWER_MODE -> %d\n",
__func__, ret);
@@ -2693,7 +2693,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid,
/* Get signal quality, in case of error use rssi=0 and ignore error. */
len = sizeof(rssi);
rssi = 0;
- ret = rndis_query_oid(usbdev, OID_802_11_RSSI, &rssi, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_RSSI), &rssi, &len);
signal = level_to_qual(le32_to_cpu(rssi));
netdev_dbg(usbdev->net, "%s(): OID_802_11_RSSI -> %d, "
@@ -2720,7 +2720,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid,
/* Get SSID, in case of error, use zero length SSID and ignore error. */
len = sizeof(ssid);
memset(&ssid, 0, sizeof(ssid));
- ret = rndis_query_oid(usbdev, OID_802_11_SSID, &ssid, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_SSID), &ssid, &len);
netdev_dbg(usbdev->net, "%s(): OID_802_11_SSID -> %d, len: %d, ssid: "
"'%.32s'\n", __func__, ret,
le32_to_cpu(ssid.length), ssid.essid);
@@ -3096,8 +3096,8 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
struct rndis_indicate *msg = ind;
switch (msg->status) {
- case RNDIS_STATUS_MEDIA_CONNECT:
- if (priv->current_command_oid == OID_802_11_ADD_KEY) {
+ case cpu_to_le32(RNDIS_STATUS_MEDIA_CONNECT):
+ if (priv->current_command_oid == cpu_to_le32(OID_802_11_ADD_KEY)) {
/* OID_802_11_ADD_KEY causes sometimes extra
* "media connect" indications which confuses driver
* and userspace to think that device is
@@ -3116,7 +3116,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
queue_work(priv->workqueue, &priv->work);
break;
- case RNDIS_STATUS_MEDIA_DISCONNECT:
+ case cpu_to_le32(RNDIS_STATUS_MEDIA_DISCONNECT):
netdev_info(usbdev->net, "media disconnect\n");
/* queue work to avoid recursive calls into rndis_command */
@@ -3124,7 +3124,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
queue_work(priv->workqueue, &priv->work);
break;
- case RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION:
+ case cpu_to_le32(RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION):
rndis_wlan_media_specific_indication(usbdev, msg, buflen);
break;
@@ -3148,7 +3148,7 @@ static int rndis_wlan_get_caps(struct usbnet *usbdev, struct wiphy *wiphy)
/* determine supported modes */
len = sizeof(networks_supported);
- retval = rndis_query_oid(usbdev, OID_802_11_NETWORK_TYPES_SUPPORTED,
+ retval = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_NETWORK_TYPES_SUPPORTED),
&networks_supported, &len);
if (retval >= 0) {
n = le32_to_cpu(networks_supported.num_items);
@@ -3173,7 +3173,7 @@ static int rndis_wlan_get_caps(struct usbnet *usbdev, struct wiphy *wiphy)
/* get device 802.11 capabilities, number of PMKIDs */
caps = (struct ndis_80211_capability *)caps_buf;
len = sizeof(caps_buf);
- retval = rndis_query_oid(usbdev, OID_802_11_CAPABILITY, caps, &len);
+ retval = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_CAPABILITY), caps, &len);
if (retval >= 0) {
netdev_dbg(usbdev->net, "OID_802_11_CAPABILITY -> len %d, "
"ver %d, pmkids %d, auth-encr-pairs %d\n",
@@ -3247,7 +3247,7 @@ static void rndis_device_poller(struct work_struct *work)
}
len = sizeof(rssi);
- ret = rndis_query_oid(usbdev, OID_802_11_RSSI, &rssi, &len);
+ ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_RSSI), &rssi, &len);
if (ret == 0) {
priv->last_qual = level_to_qual(le32_to_cpu(rssi));
rndis_do_cqm(usbdev, le32_to_cpu(rssi));
@@ -3275,7 +3275,7 @@ static void rndis_device_poller(struct work_struct *work)
* working.
*/
tmp = cpu_to_le32(1);
- rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp,
+ rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_BSSID_LIST_SCAN), &tmp,
sizeof(tmp));
len = CONTROL_BUFFER_SIZE;
@@ -3283,7 +3283,7 @@ static void rndis_device_poller(struct work_struct *work)
if (!buf)
goto end;
- rndis_query_oid(usbdev, OID_802_11_BSSID_LIST, buf, &len);
+ rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_BSSID_LIST), buf, &len);
kfree(buf);
}
@@ -3465,13 +3465,15 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf)
*/
usbdev->net->netdev_ops = &rndis_wlan_netdev_ops;
- tmp = RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST;
- retval = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &tmp,
- sizeof(tmp));
+ tmp = cpu_to_le32(RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST);
+ retval = rndis_set_oid(usbdev,
+ cpu_to_le32(OID_GEN_CURRENT_PACKET_FILTER),
+ &tmp, sizeof(tmp));
len = sizeof(tmp);
- retval = rndis_query_oid(usbdev, OID_802_3_MAXIMUM_LIST_SIZE, &tmp,
- &len);
+ retval = rndis_query_oid(usbdev,
+ cpu_to_le32(OID_802_3_MAXIMUM_LIST_SIZE),
+ &tmp, &len);
priv->multicast_size = le32_to_cpu(tmp);
if (retval < 0 || priv->multicast_size < 0)
priv->multicast_size = 0;
@@ -3601,7 +3603,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev)
/* Set current packet filter zero to block receiving data packets from
device. */
filter = 0;
- rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter,
+ rndis_set_oid(usbdev, cpu_to_le32(OID_GEN_CURRENT_PACKET_FILTER), &filter,
sizeof(filter));
return retval;
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h
index 88fceb7..9a005b6 100644
--- a/include/linux/usb/rndis_host.h
+++ b/include/linux/usb/rndis_host.h
@@ -49,46 +49,46 @@ struct rndis_msg_hdr {
*/
#define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000)
-#define RNDIS_MSG_COMPLETION cpu_to_le32(0x80000000)
+#define RNDIS_MSG_COMPLETION 0x80000000
/* codes for "msg_type" field of rndis messages;
* only the data channel uses packet messages (maybe batched);
* everything else goes on the control channel.
*/
-#define RNDIS_MSG_PACKET cpu_to_le32(0x00000001) /* 1-N packets */
-#define RNDIS_MSG_INIT cpu_to_le32(0x00000002)
+#define RNDIS_MSG_PACKET 0x00000001 /* 1-N packets */
+#define RNDIS_MSG_INIT 0x00000002
#define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION)
-#define RNDIS_MSG_HALT cpu_to_le32(0x00000003)
-#define RNDIS_MSG_QUERY cpu_to_le32(0x00000004)
+#define RNDIS_MSG_HALT 0x00000003
+#define RNDIS_MSG_QUERY 0x00000004
#define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION)
-#define RNDIS_MSG_SET cpu_to_le32(0x00000005)
+#define RNDIS_MSG_SET 0x00000005
#define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION)
-#define RNDIS_MSG_RESET cpu_to_le32(0x00000006)
+#define RNDIS_MSG_RESET 0x00000006
#define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION)
-#define RNDIS_MSG_INDICATE cpu_to_le32(0x00000007)
-#define RNDIS_MSG_KEEPALIVE cpu_to_le32(0x00000008)
+#define RNDIS_MSG_INDICATE 0x00000007
+#define RNDIS_MSG_KEEPALIVE 0x00000008
#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION)
/* codes for "status" field of completion messages */
-#define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000)
-#define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001)
-#define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015)
-#define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb)
-#define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b)
-#define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c)
-#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION cpu_to_le32(0x40010012)
+#define RNDIS_STATUS_SUCCESS 0x00000000
+#define RNDIS_STATUS_FAILURE 0xc0000001
+#define RNDIS_STATUS_INVALID_DATA 0xc0010015
+#define RNDIS_STATUS_NOT_SUPPORTED 0xc00000bb
+#define RNDIS_STATUS_MEDIA_CONNECT 0x4001000b
+#define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000c
+#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION 0x40010012
/* codes for OID_GEN_PHYSICAL_MEDIUM */
-#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000)
-#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN cpu_to_le32(0x00000001)
-#define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM cpu_to_le32(0x00000002)
-#define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE cpu_to_le32(0x00000003)
-#define RNDIS_PHYSICAL_MEDIUM_POWER_LINE cpu_to_le32(0x00000004)
-#define RNDIS_PHYSICAL_MEDIUM_DSL cpu_to_le32(0x00000005)
-#define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL cpu_to_le32(0x00000006)
-#define RNDIS_PHYSICAL_MEDIUM_1394 cpu_to_le32(0x00000007)
-#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN cpu_to_le32(0x00000008)
-#define RNDIS_PHYSICAL_MEDIUM_MAX cpu_to_le32(0x00000009)
+#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED 0x00000000
+#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN 0x00000001
+#define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM 0x00000002
+#define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE 0x00000003
+#define RNDIS_PHYSICAL_MEDIUM_POWER_LINE 0x00000004
+#define RNDIS_PHYSICAL_MEDIUM_DSL 0x00000005
+#define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL 0x00000006
+#define RNDIS_PHYSICAL_MEDIUM_1394 0x00000007
+#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN 0x00000008
+#define RNDIS_PHYSICAL_MEDIUM_MAX 0x00000009
struct rndis_data_hdr {
__le32 msg_type; /* RNDIS_MSG_PACKET */
@@ -226,24 +226,24 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */
* there are gobs more that may optionally be supported. We'll avoid as much
* of that mess as possible.
*/
-#define OID_802_3_PERMANENT_ADDRESS cpu_to_le32(0x01010101)
-#define OID_GEN_MAXIMUM_FRAME_SIZE cpu_to_le32(0x00010106)
-#define OID_GEN_CURRENT_PACKET_FILTER cpu_to_le32(0x0001010e)
-#define OID_GEN_PHYSICAL_MEDIUM cpu_to_le32(0x00010202)
+#define OID_802_3_PERMANENT_ADDRESS 0x01010101
+#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
+#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010e
+#define OID_GEN_PHYSICAL_MEDIUM 0x00010202
/* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */
-#define RNDIS_PACKET_TYPE_DIRECTED cpu_to_le32(0x00000001)
-#define RNDIS_PACKET_TYPE_MULTICAST cpu_to_le32(0x00000002)
-#define RNDIS_PACKET_TYPE_ALL_MULTICAST cpu_to_le32(0x00000004)
-#define RNDIS_PACKET_TYPE_BROADCAST cpu_to_le32(0x00000008)
-#define RNDIS_PACKET_TYPE_SOURCE_ROUTING cpu_to_le32(0x00000010)
-#define RNDIS_PACKET_TYPE_PROMISCUOUS cpu_to_le32(0x00000020)
-#define RNDIS_PACKET_TYPE_SMT cpu_to_le32(0x00000040)
-#define RNDIS_PACKET_TYPE_ALL_LOCAL cpu_to_le32(0x00000080)
-#define RNDIS_PACKET_TYPE_GROUP cpu_to_le32(0x00001000)
-#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL cpu_to_le32(0x00002000)
-#define RNDIS_PACKET_TYPE_FUNCTIONAL cpu_to_le32(0x00004000)
-#define RNDIS_PACKET_TYPE_MAC_FRAME cpu_to_le32(0x00008000)
+#define RNDIS_PACKET_TYPE_DIRECTED 0x00000001
+#define RNDIS_PACKET_TYPE_MULTICAST 0x00000002
+#define RNDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
+#define RNDIS_PACKET_TYPE_BROADCAST 0x00000008
+#define RNDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
+#define RNDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
+#define RNDIS_PACKET_TYPE_SMT 0x00000040
+#define RNDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
+#define RNDIS_PACKET_TYPE_GROUP 0x00001000
+#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000
+#define RNDIS_PACKET_TYPE_FUNCTIONAL 0x00004000
+#define RNDIS_PACKET_TYPE_MAC_FRAME 0x00008000
/* default filter used with RNDIS devices */
#define RNDIS_DEFAULT_FILTER ( \
--
1.7.7.6
--
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 related
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