Re: [PATCH 1/5] netlink: extended ACK reporting
> perhaps I misunderstand something, but nla_parse suggests attribute > type can not be 0: [...] Yes, some - very few - families still insist on using attribute 0, perhaps parsing by hand or so. Like you say though, the entire infrastructure makes that hard and undesirable, so I don't really see why we need to invest the extra code/work into making it work *here*, especially since it's such a corner case as I described in my other email. johannes
[PATCH v2] staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler
Change the config packet format used in handle_set_wfi_drv_handler() to align the host driver with the new format used in the wilc firmware. The change updates the format in which the host driver provides the firmware with the drv_handler index and also uses two new fields viz. "mode" and 'name" in the config packet along with this index to directly provide details about the interface and its mode to the firmware instead of having multiple if-else statements in the host driver to decide which interface to configure. Change in v2: Fixed build warning Signed-off-by: Aditya Shankar --- drivers/staging/wilc1000/host_interface.c | 54 +++ drivers/staging/wilc1000/host_interface.h | 9 +++- drivers/staging/wilc1000/linux_wlan.c | 29 +++- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 2 +- 5 files changed, 59 insertions(+), 37 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c3a8af0..ad1e625 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -198,6 +198,7 @@ struct host_if_msg { union message_body body; struct wilc_vif *vif; struct work_struct work; + void *drv_handler; }; struct join_bss_param { @@ -334,14 +335,42 @@ static void handle_set_wfi_drv_handler(struct wilc_vif *vif, { int ret = 0; struct wid wid; + u8 *currbyte; + struct host_if_drv *hif_drv = NULL; + int driver_handler_id = 0; + u8 *buffer = kzalloc(DRV_HANDLER_SIZE, GFP_ATOMIC); + + if (!vif->hif_drv) + return; + + if (!hif_drv_handler) + return; + + hif_drv = vif->hif_drv; + + if (hif_drv) + driver_handler_id = hif_drv->driver_handler_id; + else + driver_handler_id = 0; + + currbyte = buffer; + *currbyte = driver_handler_id & DRV_HANDLER_MASK; + currbyte++; + *currbyte = (u32)0 & DRV_HANDLER_MASK; + currbyte++; + *currbyte = (u32)0 & DRV_HANDLER_MASK; + currbyte++; + *currbyte = (u32)0 & DRV_HANDLER_MASK; + currbyte++; + *currbyte = (hif_drv_handler->name | (hif_drv_handler->mode << 1)); wid.id = (u16)WID_SET_DRV_HANDLER; wid.type = WID_STR; - wid.val = (s8 *)hif_drv_handler; - wid.size = sizeof(*hif_drv_handler); + wid.val = (s8 *)buffer; + wid.size = DRV_HANDLER_SIZE; ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, - hif_drv_handler->handler); + driver_handler_id); if (!hif_drv_handler->handler) complete(&hif_driver_comp); @@ -2403,9 +2432,9 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif, pu8CurrByte = wid.val; *pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF); - *pu8CurrByte++ = 0; - *pu8CurrByte++ = 0; - *pu8CurrByte++ = 0; + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF); + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF); + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 24) & 0xFF); *pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF); *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF); @@ -3099,7 +3128,8 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel) return 0; } -int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mac_idx) +int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, char +*ifname) { int result = 0; struct host_if_msg msg; @@ -3107,9 +3137,14 @@ int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mac_idx) memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_SET_WFIDRV_HANDLER; msg.body.drv.handler = index; - msg.body.drv.mac_idx = mac_idx; + msg.body.drv.mode = mode; msg.vif = vif; + if (!memcmp(ifname, "wlan0", 5)) + msg.body.drv.name = 1; + else if (!memcmp(ifname, "p2p0", 4)) + msg.body.drv.name = 0; + result = wilc_enqueue_cmd(&msg); if (result) { netdev_err(vif->ndev, "wilc mq send fail\n"); @@ -3330,6 +3365,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) for (i = 0; i < wilc->vif_num; i++) if (dev == wilc->vif[i]->ndev) { wilc->vif[i]->hif_drv = hif_drv; + hif_drv->driver_handler_id = i + 1; break; } @@ -3403,7 +3439,7 @@ int wilc_deinit(struct wilc_vif *vif) del_timer_sync(&periodic_rssi); del_timer_sync(&hif_drv->remain_on_ch_timer); - wilc_set_wfi_drv_handler(vif, 0, 0); + wilc_s
Re: [PATCH] staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler
Hi Aditya, [auto build test WARNING on staging/staging-testing] [also build test WARNING on v4.11-rc6 next-20170407] [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/Aditya-Shankar/staging-wilc1000-New-cfg-packet-format-in-handle_set_wfi_drv_handler/20170410-122917 config: i386-randconfig-x019-201715 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): drivers/staging/wilc1000/host_interface.c: In function 'handle_set_wfi_drv_handler': >> drivers/staging/wilc1000/host_interface.c:350:2: warning: ISO C90 forbids >> mixed declarations and code [-Wdeclaration-after-statement] u8 *buffer = kzalloc(DRV_HANDLER_SIZE, GFP_ATOMIC); ^~ vim +350 drivers/staging/wilc1000/host_interface.c 334 struct drv_handler *hif_drv_handler) 335 { 336 int ret = 0; 337 struct wid wid; 338 u8 *currbyte; 339 struct host_if_drv *hif_drv = NULL; 340 int driver_handler_id = 0; 341 342 if (!vif->hif_drv) 343 return; 344 345 if (!hif_drv_handler) 346 return; 347 348 hif_drv = vif->hif_drv; 349 > 350 u8 *buffer = kzalloc(DRV_HANDLER_SIZE, GFP_ATOMIC); 351 352 if (hif_drv) 353 driver_handler_id = hif_drv->driver_handler_id; 354 else 355 driver_handler_id = 0; 356 357 currbyte = buffer; 358 *currbyte = driver_handler_id & DRV_HANDLER_MASK; --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
[PATCH] staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler
Change the config packet format used in handle_set_wfi_drv_handler() to align the host driver with the new format used in the wilc firmware. The change updates the format in which the host driver provides the firmware with the drv_handler index and also uses two new fields viz. "mode" and 'name" in the config packet along with this index to directly provide details about the interface and its mode to the firmware instead of having multiple if-else statements in the host driver to decide which interface to configure. Signed-off-by: Aditya Shankar --- drivers/staging/wilc1000/host_interface.c | 55 +++ drivers/staging/wilc1000/host_interface.h | 9 +++- drivers/staging/wilc1000/linux_wlan.c | 29 +++- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- drivers/staging/wilc1000/wilc_wlan_if.h | 2 +- 5 files changed, 60 insertions(+), 37 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c3a8af0..8493505 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -198,6 +198,7 @@ struct host_if_msg { union message_body body; struct wilc_vif *vif; struct work_struct work; + void *drv_handler; }; struct join_bss_param { @@ -334,14 +335,43 @@ static void handle_set_wfi_drv_handler(struct wilc_vif *vif, { int ret = 0; struct wid wid; + u8 *currbyte; + struct host_if_drv *hif_drv = NULL; + int driver_handler_id = 0; + + if (!vif->hif_drv) + return; + + if (!hif_drv_handler) + return; + + hif_drv = vif->hif_drv; + + u8 *buffer = kzalloc(DRV_HANDLER_SIZE, GFP_ATOMIC); + + if (hif_drv) + driver_handler_id = hif_drv->driver_handler_id; + else + driver_handler_id = 0; + + currbyte = buffer; + *currbyte = driver_handler_id & DRV_HANDLER_MASK; + currbyte++; + *currbyte = (u32)0 & DRV_HANDLER_MASK; + currbyte++; + *currbyte = (u32)0 & DRV_HANDLER_MASK; + currbyte++; + *currbyte = (u32)0 & DRV_HANDLER_MASK; + currbyte++; + *currbyte = (hif_drv_handler->name | (hif_drv_handler->mode << 1)); wid.id = (u16)WID_SET_DRV_HANDLER; wid.type = WID_STR; - wid.val = (s8 *)hif_drv_handler; - wid.size = sizeof(*hif_drv_handler); + wid.val = (s8 *)buffer; + wid.size = DRV_HANDLER_SIZE; ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, - hif_drv_handler->handler); + driver_handler_id); if (!hif_drv_handler->handler) complete(&hif_driver_comp); @@ -2403,9 +2433,9 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif, pu8CurrByte = wid.val; *pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF); - *pu8CurrByte++ = 0; - *pu8CurrByte++ = 0; - *pu8CurrByte++ = 0; + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF); + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF); + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 24) & 0xFF); *pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF); *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF); @@ -3099,7 +3129,8 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel) return 0; } -int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mac_idx) +int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, char +*ifname) { int result = 0; struct host_if_msg msg; @@ -3107,9 +3138,14 @@ int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mac_idx) memset(&msg, 0, sizeof(struct host_if_msg)); msg.id = HOST_IF_MSG_SET_WFIDRV_HANDLER; msg.body.drv.handler = index; - msg.body.drv.mac_idx = mac_idx; + msg.body.drv.mode = mode; msg.vif = vif; + if (!memcmp(ifname, "wlan0", 5)) + msg.body.drv.name = 1; + else if (!memcmp(ifname, "p2p0", 4)) + msg.body.drv.name = 0; + result = wilc_enqueue_cmd(&msg); if (result) { netdev_err(vif->ndev, "wilc mq send fail\n"); @@ -3330,6 +3366,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) for (i = 0; i < wilc->vif_num; i++) if (dev == wilc->vif[i]->ndev) { wilc->vif[i]->hif_drv = hif_drv; + hif_drv->driver_handler_id = i + 1; break; } @@ -3403,7 +3440,7 @@ int wilc_deinit(struct wilc_vif *vif) del_timer_sync(&periodic_rssi); del_timer_sync(&hif_drv->remain_on_ch_timer); - wilc_set_wfi_drv_handler(vif, 0, 0); + wilc_set_wfi_drv_handler(vif, 0, 0, 0);
Re: [PATCH] staging: wilc1000: Update handler assignment logic
On Sat, 8 Apr 2017 13:00:15 +0200 Greg KH wrote: > On Fri, Apr 07, 2017 at 05:24:05PM +0530, Aditya Shankar wrote: > > With this update, the host driver is consistent with the > > implementation on the firmware side with respect to obtaining > > the driver handler for all modes. > > With this new format, the calls to set the wilc operation mode > > is simplified. > > > > Signed-off-by: Aditya Shankar > > --- > > drivers/staging/wilc1000/host_interface.c | 56 > > +++ > > drivers/staging/wilc1000/host_interface.h | 9 +++- > > drivers/staging/wilc1000/linux_wlan.c | 29 ++-- > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +- > > drivers/staging/wilc1000/wilc_wlan_if.h | 2 +- > > 5 files changed, 61 insertions(+), 37 deletions(-) > > > > diff --git a/drivers/staging/wilc1000/host_interface.c > > b/drivers/staging/wilc1000/host_interface.c > > index c3a8af0..c04643e 100644 > > --- a/drivers/staging/wilc1000/host_interface.c > > +++ b/drivers/staging/wilc1000/host_interface.c > > @@ -198,6 +198,7 @@ struct host_if_msg { > > union message_body body; > > struct wilc_vif *vif; > > struct work_struct work; > > + void *drv_handler; > > }; > > > > struct join_bss_param { > > @@ -334,14 +335,44 @@ static void handle_set_wfi_drv_handler(struct > > wilc_vif *vif, > > { > > int ret = 0; > > struct wid wid; > > + u8 *currbyte; > > + struct host_if_drv *hif_drv = NULL; > > + int driver_handler_id = 0; > > + u8 *buffer = kzalloc(DRV_HANDLER_SIZE, GFP_ATOMIC); > > + > > + if (!vif->hif_drv) > > + return; > > + > > + if (!hif_drv_handler) > > + return; > > + > > + hif_drv = vif->hif_drv; > > + > > + if (hif_drv) > > + driver_handler_id = hif_drv->driver_handler_id; > > + else > > + driver_handler_id = 0; > > + > > + driver_handler_id = hif_drv->driver_handler_id; > > + > > + currbyte = buffer; > > + *currbyte = driver_handler_id & DRV_HANDLER_MASK; > > + currbyte++; > > + *currbyte = (u32)0 & DRV_HANDLER_MASK; > > + currbyte++; > > + *currbyte = (u32)0 & DRV_HANDLER_MASK; > > + currbyte++; > > + *currbyte = (u32)0 & DRV_HANDLER_MASK; > > + currbyte++; > > + *currbyte = (hif_drv_handler->name | (hif_drv_handler->mode << 1)); > > > > wid.id = (u16)WID_SET_DRV_HANDLER; > > wid.type = WID_STR; > > - wid.val = (s8 *)hif_drv_handler; > > - wid.size = sizeof(*hif_drv_handler); > > + wid.val = (s8 *)buffer; > > + wid.size = DRV_HANDLER_SIZE; > > > > ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, > > - hif_drv_handler->handler); > > + driver_handler_id); > > > > if (!hif_drv_handler->handler) > > complete(&hif_driver_comp); > > @@ -2403,9 +2434,9 @@ static void Handle_SetMulticastFilter(struct wilc_vif > > *vif, > > > > pu8CurrByte = wid.val; > > *pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF); > > - *pu8CurrByte++ = 0; > > - *pu8CurrByte++ = 0; > > - *pu8CurrByte++ = 0; > > + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 8) & 0xFF); > > + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 16) & 0xFF); > > + *pu8CurrByte++ = ((strHostIfSetMulti->enabled >> 24) & 0xFF); > > > > *pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF); > > *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF); > > @@ -3099,7 +3130,8 @@ int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 > > channel) > > return 0; > > } > > > > -int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mac_idx) > > +int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index, u8 mode, char > > +*ifname) > > { > > int result = 0; > > struct host_if_msg msg; > > @@ -3107,9 +3139,14 @@ int wilc_set_wfi_drv_handler(struct wilc_vif *vif, > > int index, u8 mac_idx) > > memset(&msg, 0, sizeof(struct host_if_msg)); > > msg.id = HOST_IF_MSG_SET_WFIDRV_HANDLER; > > msg.body.drv.handler = index; > > - msg.body.drv.mac_idx = mac_idx; > > + msg.body.drv.mode = mode; > > msg.vif = vif; > > > > + if (!memcmp(ifname, "wlan0", 5)) > > + msg.body.drv.name = 1; > > + else if (!memcmp(ifname, "p2p0", 4)) > > + msg.body.drv.name = 0; > > Does that code look correct to you? > > Always use checkpatch before sending your patches out. > > Also, your changelog is very vague, please explain what is happening > in your patch much better. > > thanks, > > greg k-h That's a mistake. I will re-send the patch with a new subject line as "staging: wilc1000: New cfg packet format in handle_set_wfi_drv_handler" and an updated description instead of a v2 of the same change log. Thanks, Aditya
Re: [PATCH] rt2x00: invert external PA capability flag logic
Hi Daniel, [auto build test ERROR on wireless-drivers-next/master] [also build test ERROR on v4.11-rc6 next-20170407] [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/Daniel-Golle/rt2x00-invert-external-PA-capability-flag-logic/20170410-095601 base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master config: i386-randconfig-x077-201715 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): drivers/net//wireless/ralink/rt2x00/rt2800lib.c: In function 'rt2800_init_rfcsr_3352': >> drivers/net//wireless/ralink/rt2x00/rt2800lib.c:7095:37: error: 'tx0_int_pa' >> undeclared (first use in this function) rt2800_rfcsr_write(rt2x00dev, 51, (tx0_int_pa ? 0x7f : 0x52)); ^~ drivers/net//wireless/ralink/rt2x00/rt2800lib.c:7095:37: note: each undeclared identifier is reported only once for each function it appears in >> drivers/net//wireless/ralink/rt2x00/rt2800lib.c:7099:37: error: 'tx1_int_pa' >> undeclared (first use in this function) rt2800_rfcsr_write(rt2x00dev, 55, (tx1_int_pa ? 0x7f : 0x52)); ^~ vim +/tx0_int_pa +7095 drivers/net//wireless/ralink/rt2x00/rt2800lib.c dab38e7d Daniel Golle 2017-01-16 7089 rfcsr = 0x2d; 931ed5ca Daniel Golle 2017-04-10 7090 if (tx0_ext_pa) dab38e7d Daniel Golle 2017-01-16 7091 rt2x00_set_field8(&rfcsr, RFCSR50_TX0_EXT_PA, 1); 931ed5ca Daniel Golle 2017-04-10 7092 if (tx1_ext_pa) dab38e7d Daniel Golle 2017-01-16 7093 rt2x00_set_field8(&rfcsr, RFCSR50_TX1_EXT_PA, 1); dab38e7d Daniel Golle 2017-01-16 7094 rt2800_rfcsr_write(rt2x00dev, 50, rfcsr); dab38e7d Daniel Golle 2017-01-16 @7095 rt2800_rfcsr_write(rt2x00dev, 51, (tx0_int_pa ? 0x7f : 0x52)); dab38e7d Daniel Golle 2017-01-16 7096 rt2800_rfcsr_write(rt2x00dev, 52, (tx0_int_pa ? 0x00 : 0xc0)); dab38e7d Daniel Golle 2017-01-16 7097 rt2800_rfcsr_write(rt2x00dev, 53, (tx0_int_pa ? 0x52 : 0xd2)); dab38e7d Daniel Golle 2017-01-16 7098 rt2800_rfcsr_write(rt2x00dev, 54, (tx0_int_pa ? 0x1b : 0xc0)); dab38e7d Daniel Golle 2017-01-16 @7099 rt2800_rfcsr_write(rt2x00dev, 55, (tx1_int_pa ? 0x7f : 0x52)); dab38e7d Daniel Golle 2017-01-16 7100 rt2800_rfcsr_write(rt2x00dev, 56, (tx1_int_pa ? 0x00 : 0xc0)); dab38e7d Daniel Golle 2017-01-16 7101 rt2800_rfcsr_write(rt2x00dev, 57, (tx0_int_pa ? 0x52 : 0x49)); dab38e7d Daniel Golle 2017-01-16 7102 rt2800_rfcsr_write(rt2x00dev, 58, (tx1_int_pa ? 0x1b : 0xc0)); :: The code at line 7095 was first introduced by commit :: dab38e7d251d26917935352bee605974cc46eaec rt2x00: rt2800lib: support for for RT3352 with external PA :: TO: Daniel Golle :: CC: Kalle Valo --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
[PATCH] rt2x00: invert external PA capability flag logic
Consequently refer to external PA instead of inverting the logic and use an internal PA capability flag which is a bit confusing. Currently this is used for Rt3352 only, but MT7620A also allows for an external PA which will be supported by a follow up patch. Signed-off-by: Daniel Golle --- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 24 drivers/net/wireless/ralink/rt2x00/rt2x00.h| 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c index 201b12ed90c6..3e49df1607ff 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c @@ -7014,9 +7014,9 @@ static void rt2800_init_rfcsr_3290(struct rt2x00_dev *rt2x00dev) static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) { - int tx0_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX0, + int tx0_ext_pa = test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags); - int tx1_int_pa = test_bit(CAPABILITY_INTERNAL_PA_TX1, + int tx1_ext_pa = test_bit(CAPABILITY_EXTERNAL_PA_TX1, &rt2x00dev->cap_flags); u8 rfcsr; @@ -7056,9 +7056,9 @@ static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) rt2800_rfcsr_write(rt2x00dev, 32, 0x80); rt2800_rfcsr_write(rt2x00dev, 33, 0x00); rfcsr = 0x01; - if (!tx0_int_pa) + if (tx0_ext_pa) rt2x00_set_field8(&rfcsr, RFCSR34_TX0_EXT_PA, 1); - if (!tx1_int_pa) + if (tx1_ext_pa) rt2x00_set_field8(&rfcsr, RFCSR34_TX1_EXT_PA, 1); rt2800_rfcsr_write(rt2x00dev, 34, rfcsr); rt2800_rfcsr_write(rt2x00dev, 35, 0x03); @@ -7068,13 +7068,13 @@ static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) rt2800_rfcsr_write(rt2x00dev, 39, 0xc5); rt2800_rfcsr_write(rt2x00dev, 40, 0x33); rfcsr = 0x52; - if (tx0_int_pa) { + if (!tx0_ext_pa) { rt2x00_set_field8(&rfcsr, RFCSR41_BIT1, 1); rt2x00_set_field8(&rfcsr, RFCSR41_BIT4, 1); } rt2800_rfcsr_write(rt2x00dev, 41, rfcsr); rfcsr = 0x52; - if (tx1_int_pa) { + if (!tx1_ext_pa) { rt2x00_set_field8(&rfcsr, RFCSR42_BIT1, 1); rt2x00_set_field8(&rfcsr, RFCSR42_BIT4, 1); } @@ -7087,9 +7087,9 @@ static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) rt2800_rfcsr_write(rt2x00dev, 48, 0x14); rt2800_rfcsr_write(rt2x00dev, 49, 0x00); rfcsr = 0x2d; - if (!tx0_int_pa) + if (tx0_ext_pa) rt2x00_set_field8(&rfcsr, RFCSR50_TX0_EXT_PA, 1); - if (!tx1_int_pa) + if (tx1_ext_pa) rt2x00_set_field8(&rfcsr, RFCSR50_TX1_EXT_PA, 1); rt2800_rfcsr_write(rt2x00dev, 50, rfcsr); rt2800_rfcsr_write(rt2x00dev, 51, (tx0_int_pa ? 0x7f : 0x52)); @@ -8782,13 +8782,13 @@ static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom); if (rt2x00_rt(rt2x00dev, RT3352)) { - if (!rt2x00_get_field16(eeprom, + if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352)) - __set_bit(CAPABILITY_INTERNAL_PA_TX0, + __set_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags); - if (!rt2x00_get_field16(eeprom, + if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_EXTERNAL_TX1_PA_3352)) - __set_bit(CAPABILITY_INTERNAL_PA_TX1, + __set_bit(CAPABILITY_EXTERNAL_PA_TX1, &rt2x00dev->cap_flags); } diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h index 8fdd2f9726ee..1bc353eafe37 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h @@ -719,8 +719,8 @@ enum rt2x00_capability_flags { CAPABILITY_DOUBLE_ANTENNA, CAPABILITY_BT_COEXIST, CAPABILITY_VCO_RECALIBRATION, - CAPABILITY_INTERNAL_PA_TX0, - CAPABILITY_INTERNAL_PA_TX1, + CAPABILITY_EXTERNAL_PA_TX0, + CAPABILITY_EXTERNAL_PA_TX1, }; /* -- 2.12.1
Re: pull-request: wireless-drivers-next 2017-04-07
From: Kalle Valo Date: Fri, 07 Apr 2017 17:36:39 +0300 > here's a pull request for net-next, more info in the signed tag below. > Please let me know if there are any problems. Pulled, thanks Kalle.
Re: [PATCH 0/7] ath10k: remove ath10k_sdio_io()
I have made some basic testing (AP scanning) with this patchset and as far as I can see they haven't broken anything. I have not exercised all code (like error interrupt handling etc.) so those patches might contain bugs (I noticed a FIXME comment in one of them). I will review those patches and get back with more comments (if I find anything). Erik On 2017-04-05 09:06, Kalle Valo wrote: Using ath10k_sdio_io() and ath10k_sdio_read_write_sync() are just confusing. Refactor the code by following the plan outlined below. I'm planning to fold all these seven patches into Erik's patch adding sdio.c[1] so I didn't write any commit logs. I'm just submitting these separately to make it easier to review the changes. Kalle ath10k_sdio_read_write_sync(): X HIF_RD_SYNC_BLOCK_FIX -> ath10k_sdio_readsb() X HIF_RD_SYNC_BYTE_INC -> ath10k_sdio_read(), ath10k_sdio_read32() X HIF_WR_SYNC_BYTE_FIX -> ath10k_sdio_writesb32() X HIF_WR_SYNC_BYTE_INC -> ath10k_sdio_write() ath10k_sdio_prep_async_req(): X HIF_WRITE -> HIF_WR_SYNC_BYTE_INC -> ath10k_sdio_write() ath10k_sdio_read/write32(): sdio_readl()/sdio_writel() (those use endian macros) ath10k_sdio_writesb32(): kmalloc() sdio_writesb(len) kfree() ath10k_sdio_readsb(): len = round_down(len, ar_sdio->mbox_info.block_size); sdio_readsb(len) ath10k_sdio_read(): sdio_memcpy_fromio() ath10k_sdio_write(): sdio_memcpy_toio() [1] https://patchwork.kernel.org/patch/9626001/ --- Kalle Valo (7): ath10k: add ath10k_sdio_write32/read32() ath10k: add ath10k_sdio_writesb() ath10k: add ath10k_sdio_read() ath10k: add ath10k_sdio_write() ath10k: add ath10k_sdio_readsb() ath10k: convert __ath10k_sdio_write_async() to use ath10k_sdio_write() ath10k: remove unused sdio wrappers drivers/net/wireless/ath/ath10k/sdio.c | 419 +--- drivers/net/wireless/ath/ath10k/sdio.h | 40 --- 2 files changed, 219 insertions(+), 240 deletions(-) ___ ath10k mailing list ath...@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH 1/5] netlink: extended ACK reporting
On 4/8/17 2:40 PM, Jiri Pirko wrote: > Sat, Apr 08, 2017 at 08:37:01PM CEST, johan...@sipsolutions.net wrote: >> On Sat, 2017-04-08 at 20:34 +0200, Jiri Pirko wrote: >>> nla_total_size(sizeof(u32)); + if (extack && + (extack->missing_attr || extack- > bad_attr)) >>> >>> Attr could be 0, right? I know that on the most of the places 0 is >>> UNSPEC, but I'm pretty sure not everywhere. perhaps I misunderstand something, but nla_parse suggests attribute type can not be 0: int nla_parse(struct nlattr **tb, int maxtype, const struct nlattr *head, int len, const struct nla_policy *policy, struct netlink_ext_ack *extack) { ... nla_for_each_attr(nla, head, len, rem) { u16 type = nla_type(nla); if (type > 0 && type <= maxtype) { ... tb[type] = (struct nlattr *)nla; } } > Also, could you please attach a patch to iproute2 for example which > would make use of this. I just want to make sure it clicks. I have follow on patches to Johannes' set that plumbs extack for rtnetlink doit function and iproute2. will send later.
Re: [PATCH] net: rfkill: gpio: Add OBDA8723 ACPI HID
On 04/09/2017 07:11 AM, Marcel Holtmann wrote: Hi Hans, The OBDA8723 ACPI HID is used on quite a few Bay Trail based tablets for bluetooth rfkill functionality. Tested-by: russianneuroman...@ya.ru Signed-off-by: Hans de Goede --- net/rfkill/rfkill-gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 76c01cb..50ca65e 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -163,6 +163,7 @@ static int rfkill_gpio_remove(struct platform_device *pdev) static const struct acpi_device_id rfkill_acpi_match[] = { { "BCM4752", RFKILL_TYPE_GPS }, { "LNV4752", RFKILL_TYPE_GPS }, + { "OBDA8723", RFKILL_TYPE_BLUETOOTH }, { }, }; NAK. We are integrating these with hci_bcm.c or hci_intel.c drivers. This is for the bluetooth side of the rtl8723bs driver which recently (yesterday) got merged in into drivers/staging. Which still needs hciattach from userspace. I completely agree that eventually we should fix that. In the mean time it would be nice if we could carry this one line patch to give people using the staging driver working bluetooth. why are Bluetooth drivers in staging? I objected to them before. The only reason to have them in staging would be people being to lazy to clean things up. The Bluetooth driver is not in staging. It is only the wifi part; however, having a driver for that hardware in the kernel makes it easier for users to handle the BT part of the device. As Hans stated, the current BT driver runs in userspace. Until we actually produce hci_rtk, having this one line patch will be helpful. Larry -- If I was stranded on an island and the only way to get off the island was to make a pretty UI, I’d die there. Linus Torvalds
Re: [PATCH] net: rfkill: gpio: Add OBDA8723 ACPI HID
Hi Hans, >>> The OBDA8723 ACPI HID is used on quite a few Bay Trail based tablets >>> for bluetooth rfkill functionality. >>> >>> Tested-by: russianneuroman...@ya.ru >>> Signed-off-by: Hans de Goede >>> --- >>> net/rfkill/rfkill-gpio.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c >>> index 76c01cb..50ca65e 100644 >>> --- a/net/rfkill/rfkill-gpio.c >>> +++ b/net/rfkill/rfkill-gpio.c >>> @@ -163,6 +163,7 @@ static int rfkill_gpio_remove(struct platform_device >>> *pdev) >>> static const struct acpi_device_id rfkill_acpi_match[] = { >>> { "BCM4752", RFKILL_TYPE_GPS }, >>> { "LNV4752", RFKILL_TYPE_GPS }, >>> + { "OBDA8723", RFKILL_TYPE_BLUETOOTH }, >>> { }, >>> }; >> >> NAK. We are integrating these with hci_bcm.c or hci_intel.c drivers. > > This is for the bluetooth side of the rtl8723bs driver which recently > (yesterday) got merged in into drivers/staging. Which still needs > hciattach from userspace. I completely agree that eventually we should > fix that. In the mean time it would be nice if we could carry this > one line patch to give people using the staging driver working bluetooth. why are Bluetooth drivers in staging? I objected to them before. The only reason to have them in staging would be people being to lazy to clean things up. Regards Marcel
Re: [PATCH] net: rfkill: gpio: Add OBDA8723 ACPI HID
Hi, On 09-04-17 10:01, Marcel Holtmann wrote: Hi Hans, The OBDA8723 ACPI HID is used on quite a few Bay Trail based tablets for bluetooth rfkill functionality. Tested-by: russianneuroman...@ya.ru Signed-off-by: Hans de Goede --- net/rfkill/rfkill-gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 76c01cb..50ca65e 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -163,6 +163,7 @@ static int rfkill_gpio_remove(struct platform_device *pdev) static const struct acpi_device_id rfkill_acpi_match[] = { { "BCM4752", RFKILL_TYPE_GPS }, { "LNV4752", RFKILL_TYPE_GPS }, + { "OBDA8723", RFKILL_TYPE_BLUETOOTH }, { }, }; NAK. We are integrating these with hci_bcm.c or hci_intel.c drivers. This is for the bluetooth side of the rtl8723bs driver which recently (yesterday) got merged in into drivers/staging. Which still needs hciattach from userspace. I completely agree that eventually we should fix that. In the mean time it would be nice if we could carry this one line patch to give people using the staging driver working bluetooth. Regards, Hans
iwlwifi crashing on X1 Carbon 5th Gen iwlwifi-8265 "Microcode SW error detected"
Hello, on the new 5th Gen Lenovo X1 Carbon and Intel 8265 on a fresh Arch install iwlwifi keeps crashing the moment network is coming up. Happens on both core/linux-firmware 20170309.695f2d6-1 and aur/linux-firmware-iwlwifi-git. After it's crashing it's impossible to rmmod iwlmvm and iwlwifi, all netctl and ip commands are hanging, sudo isn't working and even shutdown isn't working. Tried netctl and NetworkManager. Netctl sometimes work for a few minutes before it crashes, NetworkManager is chrashing after a few seconds. Someone reported a bug with Intel 7265D card wich looks exactly the same. https://bugs.archlinux.org/task/53317 The firmware files for 8265 found in /lib/firmware are: - iwlwifi-8265-21.ucode - iwlwifi-8265-22.ucode - iwlwifi-8265-27.ucode The dmesg output is attached to this mail as dmesg.txt Best regards, Djagoo[0.00] Linux version 4.10.8-1-ARCH (builduser@tobias) (gcc version 6.3.1 20170306 (GCC) ) #1 SMP PREEMPT Fri Mar 31 16:50:19 CEST 2017 [0.00] Command line: initrd=\initramfs-linux.img root=PARTUUID=733cf40c-53ec-45b8-835f-83a63bbb62a1 rw rootflags=subvol=@root [0.00] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' [0.00] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' [0.00] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' [0.00] x86/fpu: Supporting XSAVE feature 0x008: 'MPX bounds registers' [0.00] x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR' [0.00] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 [0.00] x86/fpu: xstate_offset[3]: 832, xstate_sizes[3]: 64 [0.00] x86/fpu: xstate_offset[4]: 896, xstate_sizes[4]: 64 [0.00] x86/fpu: Enabled xstate features 0x1f, context size is 960 bytes, using 'compacted' format. [0.00] e820: BIOS-provided physical RAM map: [0.00] BIOS-e820: [mem 0x-0x00057fff] usable [0.00] BIOS-e820: [mem 0x00058000-0x00058fff] reserved [0.00] BIOS-e820: [mem 0x00059000-0x0009cfff] usable [0.00] BIOS-e820: [mem 0x0009d000-0x000f] reserved [0.00] BIOS-e820: [mem 0x0010-0x4505afff] usable [0.00] BIOS-e820: [mem 0x4505b000-0x4505bfff] ACPI NVS [0.00] BIOS-e820: [mem 0x4505c000-0x4505cfff] reserved [0.00] BIOS-e820: [mem 0x4505d000-0x4e9b8fff] usable [0.00] BIOS-e820: [mem 0x4e9b9000-0x4ff5bfff] reserved [0.00] BIOS-e820: [mem 0x4ff5c000-0x4ff99fff] ACPI NVS [0.00] BIOS-e820: [mem 0x4ff9a000-0x4fffefff] ACPI data [0.00] BIOS-e820: [mem 0x4000-0x4fff] usable [0.00] BIOS-e820: [mem 0x5000-0x57ff] reserved [0.00] BIOS-e820: [mem 0x5860-0x5c7f] reserved [0.00] BIOS-e820: [mem 0xf000-0xf7ff] reserved [0.00] BIOS-e820: [mem 0xfe01-0xfe010fff] reserved [0.00] BIOS-e820: [mem 0x0001-0x0004a17f] usable [0.00] NX (Execute Disable) protection: active [0.00] efi: EFI v2.50 by Lenovo [0.00] efi: SMBIOS=0x4f113000 SMBIOS 3.0=0x4f11 ACPI=0x4fffe000 ACPI 2.0=0x4fffe014 ESRT=0x4ef8b000 MEMATTR=0x49888018 [0.00] SMBIOS 3.0.0 present. [0.00] DMI: LENOVO 20HQS02200/20HQS02200, BIOS N1MET31W (1.16 ) 03/10/2017 [0.00] e820: update [mem 0x-0x0fff] usable ==> reserved [0.00] e820: remove [mem 0x000a-0x000f] usable [0.00] e820: last_pfn = 0x4a1800 max_arch_pfn = 0x4 [0.00] MTRR default type: write-back [0.00] MTRR fixed ranges enabled: [0.00] 0-9 write-back [0.00] A-B uncachable [0.00] C-F write-protect [0.00] MTRR variable ranges enabled: [0.00] 0 base 008000 mask 7F8000 uncachable [0.00] 1 base 006000 mask 7FE000 uncachable [0.00] 2 base 005C00 mask 7FFC00 uncachable [0.00] 3 base 005A00 mask 7FFE00 uncachable [0.00] 4 disabled [0.00] 5 disabled [0.00] 6 disabled [0.00] 7 disabled [0.00] 8 disabled [0.00] 9 disabled [0.00] x86/PAT: Configuration [0-7]: WB WC UC- UC WB WC UC- WT [0.00] e820: last_pfn = 0x5 max_arch_pfn = 0x4 [0.00] esrt: Reserving ESRT space from 0x4ef8b000 to 0x4ef8b088. [0.00] Scanning 1 areas for low memory corruption [0.00] Base memory trampoline at [88096000] 96000 size 24576 [0.00] Using GB pages for direct mapping [0.00] BRK [0x01d5f000, 0x01d5] PGTABLE [0.00] BRK [0x01d6, 0x01d60fff] PGTABLE [0.00] BRK [0x01d61000, 0x01d
Re: [PATCH] net: rfkill: gpio: Add OBDA8723 ACPI HID
Hi Hans, > The OBDA8723 ACPI HID is used on quite a few Bay Trail based tablets > for bluetooth rfkill functionality. > > Tested-by: russianneuroman...@ya.ru > Signed-off-by: Hans de Goede > --- > net/rfkill/rfkill-gpio.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c > index 76c01cb..50ca65e 100644 > --- a/net/rfkill/rfkill-gpio.c > +++ b/net/rfkill/rfkill-gpio.c > @@ -163,6 +163,7 @@ static int rfkill_gpio_remove(struct platform_device > *pdev) > static const struct acpi_device_id rfkill_acpi_match[] = { > { "BCM4752", RFKILL_TYPE_GPS }, > { "LNV4752", RFKILL_TYPE_GPS }, > + { "OBDA8723", RFKILL_TYPE_BLUETOOTH }, > { }, > }; NAK. We are integrating these with hci_bcm.c or hci_intel.c drivers. Regards Marcel