Re: [PATCH v2 1/2] sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications
Hi Stefan, [auto build test WARNING on net-next/master] [also build test WARNING on v4.10-rc7] [cannot apply to next-20170207] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Stefan-Br-ns/sierra_net-Add-support-for-IPv6-and-Dual-Stack-Link-Sense-Indications/20170207-105111 config: x86_64-randconfig-b0-02081035 (attached as .config) compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): drivers/net/usb/sierra_net.c: In function 'sierra_net_bind': >> drivers/net/usb/sierra_net.c:687: warning: unused variable 'eth' vim +/eth +687 drivers/net/usb/sierra_net.c f7385ec9 Ming Lei 2012-10-24 671 if (result < 0) eb4fd8cd Elina Pasheva 2010-04-27 672 return -EIO; eb4fd8cd Elina Pasheva 2010-04-27 673 f7385ec9 Ming Lei 2012-10-24 674 *datap = le16_to_cpu(attrdata); eb4fd8cd Elina Pasheva 2010-04-27 675 return result; eb4fd8cd Elina Pasheva 2010-04-27 676 } eb4fd8cd Elina Pasheva 2010-04-27 677 eb4fd8cd Elina Pasheva 2010-04-27 678 /* eb4fd8cd Elina Pasheva 2010-04-27 679 * collects the bulk endpoints, the status endpoint. eb4fd8cd Elina Pasheva 2010-04-27 680 */ eb4fd8cd Elina Pasheva 2010-04-27 681 static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) eb4fd8cd Elina Pasheva 2010-04-27 682 { eb4fd8cd Elina Pasheva 2010-04-27 683 u8 ifacenum; eb4fd8cd Elina Pasheva 2010-04-27 684 u8 numendpoints; eb4fd8cd Elina Pasheva 2010-04-27 685 u16 fwattr = 0; eb4fd8cd Elina Pasheva 2010-04-27 686 int status; eb4fd8cd Elina Pasheva 2010-04-27 @687 struct ethhdr *eth; eb4fd8cd Elina Pasheva 2010-04-27 688 struct sierra_net_data *priv; eb4fd8cd Elina Pasheva 2010-04-27 689 static const u8 sync_tmplate[sizeof(priv->sync_msg)] = { eb4fd8cd Elina Pasheva 2010-04-27 690 0x00, 0x00, SIERRA_NET_HIP_MSYNC_ID, 0x00}; eb4fd8cd Elina Pasheva 2010-04-27 691 static const u8 shdwn_tmplate[sizeof(priv->shdwn_msg)] = { eb4fd8cd Elina Pasheva 2010-04-27 692 0x00, 0x00, SIERRA_NET_HIP_SHUTD_ID, 0x00}; eb4fd8cd Elina Pasheva 2010-04-27 693 eb4fd8cd Elina Pasheva 2010-04-27 694 dev_dbg(&dev->udev->dev, "%s", __func__); eb4fd8cd Elina Pasheva 2010-04-27 695 :: The code at line 687 was first introduced by commit :: eb4fd8cd355c8ec425a12ec6cbdac614e8a4819d net/usb: add sierra_net.c driver :: TO: Elina Pasheva :: CC: David S. Miller --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH v2 1/2] sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications
From: Stefan Brüns Date: Tue, 7 Feb 2017 03:33:16 +0100 > If a context is configured as dualstack ("IPv4v6"), the modem indicates > the context activation with a slightly different indication message. > The dual-stack indication omits the link_type (IPv4/v6) and adds > additional address fields. > IPv6 LSIs are identical to IPv4 LSIs, but have a different link type. > > Signed-off-by: Stefan Brüns Applied. Ignore my earlier comments about the UMTS comment, it is still accurate of course. :-)
Re: [PATCH v2 1/2] sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications
From: David Miller Date: Tue, 07 Feb 2017 13:53:12 -0500 (EST) > From: Stefan Brüns > Date: Tue, 7 Feb 2017 03:33:16 +0100 > >> If a context is configured as dualstack ("IPv4v6"), the modem indicates >> the context activation with a slightly different indication message. >> The dual-stack indication omits the link_type (IPv4/v6) and adds >> additional address fields. >> IPv6 LSIs are identical to IPv4 LSIs, but have a different link type. >> >> Signed-off-by: Stefan Brüns > > Applied. > > Ignore my earlier comments about the UMTS comment, it is still > accurate of course. :-) Acutally, this still need work. I had to revert. You removed the code using the 'eth' variable from sierra_net_bind() but left the unused variable declared. Please respin this series with it removed so we don't get the warning: drivers/net/usb/sierra_net.c: In function ‘sierra_net_bind’: drivers/net/usb/sierra_net.c:687:17: warning: unused variable ‘eth’ [-Wunused-variable] struct ethhdr *eth;
[PATCH v2 1/2] sierra_net: Add support for IPv6 and Dual-Stack Link Sense Indications
If a context is configured as dualstack ("IPv4v6"), the modem indicates the context activation with a slightly different indication message. The dual-stack indication omits the link_type (IPv4/v6) and adds additional address fields. IPv6 LSIs are identical to IPv4 LSIs, but have a different link type. Signed-off-by: Stefan Brüns --- v2: Do not overwrite protocol field in rx_fixup Example LSI LINK UP indication: 00 ed 78 00 04 01 00 e9 0a 14 00 54 00 65 00 6c ..xT.e.l 0010 00 65 00 6b 00 6f 00 6d 00 2e 00 64 00 65 48 03 .e.k.o.m...d.eH. 0020 c8 be d1 00 62 00 00 00 2c 80 f0 01 00 00 00 00 b...,... 0030 30 cb 04 4c 49 4e 4b 20 55 50 00 00 00 00 00 00 0..LINK UP.. 0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0050 00 00 00 00 04 0a 23 38 db 10 2a 01 05 98 88 c0 ..#8..*. 0060 1f da 00 01 00 01 91 23 a8 f9 00 00 00 00 00 00 ...# 0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0080 00 04 0a 4a d2 d2 10 2a 01 05 98 07 ff 00 00 00 ...J...* 0090 10 00 74 02 10 02 10 04 0a 4a d2 d3 10 2a 01 05 ..t..J...*.. 00a0 98 07 ff 00 00 00 10 00 74 02 10 02 11 00 00 00 t... 00b0 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00c0 00 00 00 00 00 c3 50 04 00 00 00 00 10 fe 80 00 ..P. 00d0 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00f0 00 --- drivers/net/usb/sierra_net.c | 100 --- 1 file changed, 66 insertions(+), 34 deletions(-) diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index a251588762ec..977afe74ed54 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c @@ -73,8 +73,6 @@ staticatomic_t iface_counter = ATOMIC_INIT(0); /* Private data structure */ struct sierra_net_data { - u8 ethr_hdr_tmpl[ETH_HLEN]; /* ethernet header template for rx'd pkts */ - u16 link_up;/* air link up or down */ u8 tx_hdr_template[4]; /* part of HIP hdr for tx'd packets */ @@ -122,6 +120,7 @@ struct param { /* LSI Protocol types */ #define SIERRA_NET_PROTOCOL_UMTS 0x01 +#define SIERRA_NET_PROTOCOL_UMTS_DS 0x04 /* LSI Coverage */ #define SIERRA_NET_COVERAGE_NONE 0x00 #define SIERRA_NET_COVERAGE_NOPACKET 0x01 @@ -129,7 +128,8 @@ struct param { /* LSI Session */ #define SIERRA_NET_SESSION_IDLE 0x00 /* LSI Link types */ -#define SIERRA_NET_AS_LINK_TYPE_IPv4 0x00 +#define SIERRA_NET_AS_LINK_TYPE_IPV4 0x00 +#define SIERRA_NET_AS_LINK_TYPE_IPV6 0x02 struct lsi_umts { u8 protocol; @@ -137,9 +137,14 @@ struct lsi_umts { __be16 length; /* eventually use a union for the rest - assume umts for now */ u8 coverage; - u8 unused2[41]; + u8 network_len; /* network name len */ + u8 network[40]; /* network name (UCS2, bigendian) */ u8 session_state; u8 unused3[33]; +} __packed; + +struct lsi_umts_single { + struct lsi_umts lsi; u8 link_type; u8 pdp_addr_len; /* NW-supplied PDP address len */ u8 pdp_addr[16]; /* NW-supplied PDP address (bigendian)) */ @@ -158,10 +163,31 @@ struct lsi_umts { u8 reserved[8]; } __packed; +struct lsi_umts_dual { + struct lsi_umts lsi; + u8 pdp_addr4_len; /* NW-supplied PDP IPv4 address len */ + u8 pdp_addr4[4]; /* NW-supplied PDP IPv4 address (bigendian)) */ + u8 pdp_addr6_len; /* NW-supplied PDP IPv6 address len */ + u8 pdp_addr6[16]; /* NW-supplied PDP IPv6 address (bigendian)) */ + u8 unused4[23]; + u8 dns1_addr4_len; /* NW-supplied 1st DNS v4 address len (bigendian) */ + u8 dns1_addr4[4]; /* NW-supplied 1st DNS v4 address */ + u8 dns1_addr6_len; /* NW-supplied 1st DNS v6 address len */ + u8 dns1_addr6[16]; /* NW-supplied 1st DNS v6 address (bigendian)*/ + u8 dns2_addr4_len; /* NW-supplied 2nd DNS v4 address len (bigendian) */ + u8 dns2_addr4[4]; /* NW-supplied 2nd DNS v4 address */ + u8 dns2_addr6_len; /* NW-supplied 2nd DNS v6 address len */ + u8 dns2_addr6[16]; /* NW-supplied 2nd DNS v6 address (bigendian)*/ + u8 unused5[68]; +} __packed; + #define SIERRA_NET_LSI_COMMON_LEN 4 -#define SIERRA_NET_LSI_UMTS_LEN(sizeof(struct lsi_umts)) +#define SIERRA_NET_LSI_UMTS_LEN(sizeof(struct lsi_umts_single)) #define SIERRA_NET_LSI_UMTS_STATUS_LEN \ (SIERRA_NET_LSI_UMTS_LEN - SIERRA_NET_LSI_COMMON_LEN) +#define SIERRA_NET_LSI_UMTS_DS_LEN (sizeof(struct lsi_umts_dual)) +#define SIERRA_NET_LSI_UMTS_DS_STATUS_LEN \ + (SIERRA_NET_LSI_UMTS_DS_LEN - SIERRA_NET_LSI_COMMON_LEN) /* Forward definitions */ static void sierra_sync_timer(unsigned long syncdata); @@ -191,10 +217,11 @@ static inline void sierra_net_set_private(struct usbnet *dev, dev->data[0