Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (30 commits)
ctcm: rename READ/WRITE defines to avoid redefinitions
claw: rename READ/WRITE defines to avoid redefinitions
phylib: available for any speed ethernet
can: add limit for nframes and clean up signed/unsigned variables
pkt_sched: Check .walk and .leaf class handlers
pkt_sched: Fix sch_sfq vs tc_modify_qdisc oops
caif-spi: Bugfix SPI_DATA_POS settings were inverted.
caif: Bugfix - Increase default headroom size for control channel.
net: make netpoll_rx return bool for !CONFIG_NETPOLL
Bluetooth: Use 3-DH5 payload size for default ERTM max PDU size
Bluetooth: Fix incorrect setting of remote_tx_win for L2CAP ERTM
Bluetooth: Change default L2CAP ERTM retransmit timeout
Bluetooth: Fix endianness issue with L2CAP MPS configuration
net: Use NET_XMIT_SUCCESS where possible.
isdn: mISDN: call pci_disable_device() if pci_probe() failed
isdn: avm: call pci_disable_device() if pci_probe() failed
isdn: avm: call pci_disable_device() if pci_probe() failed
usbnet: rx_submit() should return an error code.
pkt_sched: Add some basic qdisc class ops verification. Was: [PATCH] sfq: add dummy bind/unbind handles
pkt_sched: sch_sfq: Add dummy unbind_tcf and put handles. Was: [PATCH] sfq: add dummy bind/unbind handles
...

+428 -391
+1
drivers/isdn/hardware/avm/c4.c
··· 1273 1273 if (retval != 0) { 1274 1274 printk(KERN_ERR "c4: no AVM-C%d at i/o %#x, irq %d detected, mem %#x\n", 1275 1275 nr, param.port, param.irq, param.membase); 1276 + pci_disable_device(dev); 1276 1277 return -ENODEV; 1277 1278 } 1278 1279 return 0;
+1
drivers/isdn/hardware/avm/t1pci.c
··· 210 210 if (retval != 0) { 211 211 printk(KERN_ERR "t1pci: no AVM-T1-PCI at i/o %#x, irq %d detected, mem %#x\n", 212 212 param.port, param.irq, param.membase); 213 + pci_disable_device(dev); 213 214 return -ENODEV; 214 215 } 215 216 return 0;
+4 -1
drivers/isdn/hardware/mISDN/mISDNinfineon.c
··· 1094 1094 pr_info("mISDN: do not have informations about adapter at %s\n", 1095 1095 pci_name(pdev)); 1096 1096 kfree(card); 1097 + pci_disable_device(pdev); 1097 1098 return -EINVAL; 1098 1099 } else 1099 1100 pr_notice("mISDN: found adapter %s at %s\n", ··· 1104 1103 pci_set_drvdata(pdev, card); 1105 1104 err = setup_instance(card); 1106 1105 if (err) { 1107 - pci_disable_device(card->pdev); 1106 + pci_disable_device(pdev); 1108 1107 kfree(card); 1109 1108 pci_set_drvdata(pdev, NULL); 1110 1109 } else if (ent->driver_data == INF_SCT_1) { ··· 1115 1114 sc = kzalloc(sizeof(struct inf_hw), GFP_KERNEL); 1116 1115 if (!sc) { 1117 1116 release_card(card); 1117 + pci_disable_device(pdev); 1118 1118 return -ENOMEM; 1119 1119 } 1120 1120 sc->irq = card->irq; ··· 1123 1121 sc->ci = card->ci + i; 1124 1122 err = setup_instance(sc); 1125 1123 if (err) { 1124 + pci_disable_device(pdev); 1126 1125 kfree(sc); 1127 1126 release_card(card); 1128 1127 break;
+2 -2
drivers/net/caif/caif_spi_slave.c
··· 22 22 #include <net/caif/caif_spi.h> 23 23 24 24 #ifndef CONFIG_CAIF_SPI_SYNC 25 - #define SPI_DATA_POS SPI_CMD_SZ 25 + #define SPI_DATA_POS 0 26 26 static inline int forward_to_spi_cmd(struct cfspi *cfspi) 27 27 { 28 28 return cfspi->rx_cpck_len; 29 29 } 30 30 #else 31 - #define SPI_DATA_POS 0 31 + #define SPI_DATA_POS SPI_CMD_SZ 32 32 static inline int forward_to_spi_cmd(struct cfspi *cfspi) 33 33 { 34 34 return 0;
+1 -1
drivers/net/phy/Kconfig
··· 5 5 menuconfig PHYLIB 6 6 tristate "PHY Device support and infrastructure" 7 7 depends on !S390 8 - depends on NET_ETHERNET 8 + depends on NETDEVICES 9 9 help 10 10 Ethernet controllers are usually attached to PHY 11 11 devices. This option provides infrastructure for
+1 -1
drivers/net/phy/phy.c
··· 301 301 /** 302 302 * phy_mii_ioctl - generic PHY MII ioctl interface 303 303 * @phydev: the phy_device struct 304 - * @mii_data: MII ioctl data 304 + * @ifr: &struct ifreq for socket ioctl's 305 305 * @cmd: ioctl cmd to execute 306 306 * 307 307 * Note that this function is currently incompatible with the
+44 -28
drivers/net/qlcnic/qlcnic_main.c
··· 473 473 static int 474 474 qlcnic_init_pci_info(struct qlcnic_adapter *adapter) 475 475 { 476 - struct qlcnic_pci_info pci_info[QLCNIC_MAX_PCI_FUNC]; 476 + struct qlcnic_pci_info *pci_info; 477 477 int i, ret = 0, err; 478 478 u8 pfn; 479 479 480 - if (!adapter->npars) 481 - adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) * 482 - QLCNIC_MAX_PCI_FUNC, GFP_KERNEL); 483 - if (!adapter->npars) 480 + pci_info = kcalloc(QLCNIC_MAX_PCI_FUNC, sizeof(*pci_info), GFP_KERNEL); 481 + if (!pci_info) 484 482 return -ENOMEM; 485 483 486 - if (!adapter->eswitch) 487 - adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) * 484 + adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) * 485 + QLCNIC_MAX_PCI_FUNC, GFP_KERNEL); 486 + if (!adapter->npars) { 487 + err = -ENOMEM; 488 + goto err_pci_info; 489 + } 490 + 491 + adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) * 488 492 QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL); 489 493 if (!adapter->eswitch) { 490 494 err = -ENOMEM; 491 - goto err_eswitch; 495 + goto err_npars; 492 496 } 493 497 494 498 ret = qlcnic_get_pci_info(adapter, pci_info); 495 - if (!ret) { 496 - for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { 497 - pfn = pci_info[i].id; 498 - if (pfn > QLCNIC_MAX_PCI_FUNC) 499 - return QL_STATUS_INVALID_PARAM; 500 - adapter->npars[pfn].active = pci_info[i].active; 501 - adapter->npars[pfn].type = pci_info[i].type; 502 - adapter->npars[pfn].phy_port = pci_info[i].default_port; 503 - adapter->npars[pfn].mac_learning = DEFAULT_MAC_LEARN; 504 - adapter->npars[pfn].min_bw = pci_info[i].tx_min_bw; 505 - adapter->npars[pfn].max_bw = pci_info[i].tx_max_bw; 506 - } 499 + if (ret) 500 + goto err_eswitch; 507 501 508 - for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++) 509 - adapter->eswitch[i].flags |= QLCNIC_SWITCH_ENABLE; 510 - 511 - return ret; 502 + for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { 503 + pfn = pci_info[i].id; 504 + if (pfn > QLCNIC_MAX_PCI_FUNC) 505 + return QL_STATUS_INVALID_PARAM; 506 + adapter->npars[pfn].active = pci_info[i].active; 507 + adapter->npars[pfn].type = pci_info[i].type; 508 + adapter->npars[pfn].phy_port = pci_info[i].default_port; 509 + adapter->npars[pfn].mac_learning = DEFAULT_MAC_LEARN; 510 + adapter->npars[pfn].min_bw = pci_info[i].tx_min_bw; 511 + adapter->npars[pfn].max_bw = pci_info[i].tx_max_bw; 512 512 } 513 513 514 + for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++) 515 + adapter->eswitch[i].flags |= QLCNIC_SWITCH_ENABLE; 516 + 517 + kfree(pci_info); 518 + return 0; 519 + 520 + err_eswitch: 514 521 kfree(adapter->eswitch); 515 522 adapter->eswitch = NULL; 516 - err_eswitch: 523 + err_npars: 517 524 kfree(adapter->npars); 525 + adapter->npars = NULL; 526 + err_pci_info: 527 + kfree(pci_info); 518 528 519 529 return ret; 520 530 } ··· 3371 3361 struct device *dev = container_of(kobj, struct device, kobj); 3372 3362 struct qlcnic_adapter *adapter = dev_get_drvdata(dev); 3373 3363 struct qlcnic_pci_func_cfg pci_cfg[QLCNIC_MAX_PCI_FUNC]; 3374 - struct qlcnic_pci_info pci_info[QLCNIC_MAX_PCI_FUNC]; 3364 + struct qlcnic_pci_info *pci_info; 3375 3365 int i, ret; 3376 3366 3377 3367 if (size != sizeof(pci_cfg)) 3378 3368 return QL_STATUS_INVALID_PARAM; 3379 3369 3370 + pci_info = kcalloc(QLCNIC_MAX_PCI_FUNC, sizeof(*pci_info), GFP_KERNEL); 3371 + if (!pci_info) 3372 + return -ENOMEM; 3373 + 3380 3374 ret = qlcnic_get_pci_info(adapter, pci_info); 3381 - if (ret) 3375 + if (ret) { 3376 + kfree(pci_info); 3382 3377 return ret; 3378 + } 3383 3379 3384 3380 for (i = 0; i < QLCNIC_MAX_PCI_FUNC ; i++) { 3385 3381 pci_cfg[i].pci_func = pci_info[i].id; ··· 3396 3380 memcpy(&pci_cfg[i].def_mac_addr, &pci_info[i].mac, ETH_ALEN); 3397 3381 } 3398 3382 memcpy(buf, &pci_cfg, size); 3383 + kfree(pci_info); 3399 3384 return size; 3400 - 3401 3385 } 3402 3386 static struct bin_attribute bin_attr_npar_config = { 3403 3387 .attr = {.name = "npar_config", .mode = (S_IRUGO | S_IWUSR)},
+16 -6
drivers/net/usb/usbnet.c
··· 315 315 316 316 static void rx_complete (struct urb *urb); 317 317 318 - static void rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) 318 + static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) 319 319 { 320 320 struct sk_buff *skb; 321 321 struct skb_data *entry; ··· 327 327 netif_dbg(dev, rx_err, dev->net, "no rx skb\n"); 328 328 usbnet_defer_kevent (dev, EVENT_RX_MEMORY); 329 329 usb_free_urb (urb); 330 - return; 330 + return -ENOMEM; 331 331 } 332 332 skb_reserve (skb, NET_IP_ALIGN); 333 333 ··· 357 357 netif_dbg(dev, ifdown, dev->net, "device gone\n"); 358 358 netif_device_detach (dev->net); 359 359 break; 360 + case -EHOSTUNREACH: 361 + retval = -ENOLINK; 362 + break; 360 363 default: 361 364 netif_dbg(dev, rx_err, dev->net, 362 365 "rx submit, %d\n", retval); ··· 377 374 dev_kfree_skb_any (skb); 378 375 usb_free_urb (urb); 379 376 } 377 + return retval; 380 378 } 381 379 382 380 ··· 916 912 /* tasklet could resubmit itself forever if memory is tight */ 917 913 if (test_bit (EVENT_RX_MEMORY, &dev->flags)) { 918 914 struct urb *urb = NULL; 915 + int resched = 1; 919 916 920 917 if (netif_running (dev->net)) 921 918 urb = usb_alloc_urb (0, GFP_KERNEL); ··· 927 922 status = usb_autopm_get_interface(dev->intf); 928 923 if (status < 0) 929 924 goto fail_lowmem; 930 - rx_submit (dev, urb, GFP_KERNEL); 925 + if (rx_submit (dev, urb, GFP_KERNEL) == -ENOLINK) 926 + resched = 0; 931 927 usb_autopm_put_interface(dev->intf); 932 928 fail_lowmem: 933 - tasklet_schedule (&dev->bh); 929 + if (resched) 930 + tasklet_schedule (&dev->bh); 934 931 } 935 932 } 936 933 ··· 1182 1175 // don't refill the queue all at once 1183 1176 for (i = 0; i < 10 && dev->rxq.qlen < qlen; i++) { 1184 1177 urb = usb_alloc_urb (0, GFP_ATOMIC); 1185 - if (urb != NULL) 1186 - rx_submit (dev, urb, GFP_ATOMIC); 1178 + if (urb != NULL) { 1179 + if (rx_submit (dev, urb, GFP_ATOMIC) == 1180 + -ENOLINK) 1181 + return; 1182 + } 1187 1183 } 1188 1184 if (temp != dev->rxq.qlen) 1189 1185 netif_dbg(dev, link, dev->net,
+8 -7
drivers/net/wan/farsync.c
··· 885 885 * Receive a frame through the DMA 886 886 */ 887 887 static inline void 888 - fst_rx_dma(struct fst_card_info *card, unsigned char *skb, 889 - unsigned char *mem, int len) 888 + fst_rx_dma(struct fst_card_info *card, dma_addr_t skb, 889 + dma_addr_t mem, int len) 890 890 { 891 891 /* 892 892 * This routine will setup the DMA and start it 893 893 */ 894 894 895 - dbg(DBG_RX, "In fst_rx_dma %p %p %d\n", skb, mem, len); 895 + dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n", 896 + (unsigned long) skb, (unsigned long) mem, len); 896 897 if (card->dmarx_in_progress) { 897 898 dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n"); 898 899 } 899 900 900 - outl((unsigned long) skb, card->pci_conf + DMAPADR0); /* Copy to here */ 901 - outl((unsigned long) mem, card->pci_conf + DMALADR0); /* from here */ 901 + outl(skb, card->pci_conf + DMAPADR0); /* Copy to here */ 902 + outl(mem, card->pci_conf + DMALADR0); /* from here */ 902 903 outl(len, card->pci_conf + DMASIZ0); /* for this length */ 903 904 outl(0x00000000c, card->pci_conf + DMADPR0); /* In this direction */ 904 905 ··· 1310 1309 card->dma_port_rx = port; 1311 1310 card->dma_len_rx = len; 1312 1311 card->dma_rxpos = rxp; 1313 - fst_rx_dma(card, (char *) card->rx_dma_handle_card, 1314 - (char *) BUF_OFFSET(rxBuffer[pi][rxp][0]), len); 1312 + fst_rx_dma(card, card->rx_dma_handle_card, 1313 + BUF_OFFSET(rxBuffer[pi][rxp][0]), len); 1315 1314 } 1316 1315 if (rxp != port->rxpos) { 1317 1316 dbg(DBG_ASS, "About to increment rxpos by more than 1\n");
+1 -1
drivers/net/wireless/iwlwifi/iwl-1000.c
··· 260 260 .shadow_ram_support = false, 261 261 .ht_greenfield_support = true, 262 262 .led_compensation = 51, 263 - .use_rts_for_ht = true, /* use rts/cts protection */ 263 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 264 264 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 265 265 .support_ct_kill_exit = true, 266 266 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
+1 -17
drivers/net/wireless/iwlwifi/iwl-3945.c
··· 769 769 rts_retry_limit = data_retry_limit; 770 770 tx_cmd->rts_retry_limit = rts_retry_limit; 771 771 772 - if (ieee80211_is_mgmt(fc)) { 773 - switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { 774 - case cpu_to_le16(IEEE80211_STYPE_AUTH): 775 - case cpu_to_le16(IEEE80211_STYPE_DEAUTH): 776 - case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): 777 - case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): 778 - if (tx_flags & TX_CMD_FLG_RTS_MSK) { 779 - tx_flags &= ~TX_CMD_FLG_RTS_MSK; 780 - tx_flags |= TX_CMD_FLG_CTS_MSK; 781 - } 782 - break; 783 - default: 784 - break; 785 - } 786 - } 787 - 788 772 tx_cmd->rate = rate; 789 773 tx_cmd->tx_flags = tx_flags; 790 774 ··· 2701 2717 static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { 2702 2718 .get_hcmd_size = iwl3945_get_hcmd_size, 2703 2719 .build_addsta_hcmd = iwl3945_build_addsta_hcmd, 2704 - .rts_tx_cmd_flag = iwlcore_rts_tx_cmd_flag, 2720 + .tx_cmd_protection = iwlcore_tx_cmd_protection, 2705 2721 .request_scan = iwl3945_request_scan, 2706 2722 }; 2707 2723
+1 -1
drivers/net/wireless/iwlwifi/iwl-4965.c
··· 2223 2223 .build_addsta_hcmd = iwl4965_build_addsta_hcmd, 2224 2224 .chain_noise_reset = iwl4965_chain_noise_reset, 2225 2225 .gain_computation = iwl4965_gain_computation, 2226 - .rts_tx_cmd_flag = iwlcore_rts_tx_cmd_flag, 2226 + .tx_cmd_protection = iwlcore_tx_cmd_protection, 2227 2227 .calc_rssi = iwl4965_calc_rssi, 2228 2228 .request_scan = iwlagn_request_scan, 2229 2229 };
+5 -5
drivers/net/wireless/iwlwifi/iwl-5000.c
··· 506 506 .use_bsm = false, 507 507 .ht_greenfield_support = true, 508 508 .led_compensation = 51, 509 - .use_rts_for_ht = true, /* use rts/cts protection */ 509 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 510 510 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 511 511 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, 512 512 .chain_noise_scale = 1000, ··· 537 537 .use_bsm = false, 538 538 .ht_greenfield_support = true, 539 539 .led_compensation = 51, 540 - .use_rts_for_ht = true, /* use rts/cts protection */ 540 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 541 541 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 542 542 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, 543 543 .chain_noise_scale = 1000, ··· 597 597 .use_bsm = false, 598 598 .ht_greenfield_support = true, 599 599 .led_compensation = 51, 600 - .use_rts_for_ht = true, /* use rts/cts protection */ 600 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 601 601 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 602 602 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, 603 603 .chain_noise_scale = 1000, ··· 628 628 .use_bsm = false, 629 629 .ht_greenfield_support = true, 630 630 .led_compensation = 51, 631 - .use_rts_for_ht = true, /* use rts/cts protection */ 631 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 632 632 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 633 633 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, 634 634 .chain_noise_scale = 1000, ··· 659 659 .use_bsm = false, 660 660 .ht_greenfield_support = true, 661 661 .led_compensation = 51, 662 - .use_rts_for_ht = true, /* use rts/cts protection */ 662 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 663 663 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 664 664 .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF, 665 665 .chain_noise_scale = 1000,
+8 -8
drivers/net/wireless/iwlwifi/iwl-6000.c
··· 381 381 .shadow_ram_support = true, 382 382 .ht_greenfield_support = true, 383 383 .led_compensation = 51, 384 - .use_rts_for_ht = true, /* use rts/cts protection */ 384 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 385 385 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 386 386 .supports_idle = true, 387 387 .adv_thermal_throttle = true, ··· 489 489 .shadow_ram_support = true, 490 490 .ht_greenfield_support = true, 491 491 .led_compensation = 51, 492 - .use_rts_for_ht = true, /* use rts/cts protection */ 492 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 493 493 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 494 494 .supports_idle = true, 495 495 .adv_thermal_throttle = true, ··· 563 563 .shadow_ram_support = true, 564 564 .ht_greenfield_support = true, 565 565 .led_compensation = 51, 566 - .use_rts_for_ht = true, /* use rts/cts protection */ 566 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 567 567 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 568 568 .supports_idle = true, 569 569 .adv_thermal_throttle = true, ··· 637 637 .shadow_ram_support = true, 638 638 .ht_greenfield_support = true, 639 639 .led_compensation = 51, 640 - .use_rts_for_ht = true, /* use rts/cts protection */ 640 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 641 641 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 642 642 .supports_idle = true, 643 643 .adv_thermal_throttle = true, ··· 714 714 .shadow_ram_support = true, 715 715 .ht_greenfield_support = true, 716 716 .led_compensation = 51, 717 - .use_rts_for_ht = true, /* use rts/cts protection */ 717 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 718 718 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 719 719 .supports_idle = true, 720 720 .adv_thermal_throttle = true, ··· 821 821 .shadow_ram_support = true, 822 822 .ht_greenfield_support = true, 823 823 .led_compensation = 51, 824 - .use_rts_for_ht = true, /* use rts/cts protection */ 824 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 825 825 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 826 826 .supports_idle = true, 827 827 .adv_thermal_throttle = true, ··· 859 859 .shadow_ram_support = true, 860 860 .ht_greenfield_support = true, 861 861 .led_compensation = 51, 862 - .use_rts_for_ht = true, /* use rts/cts protection */ 862 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 863 863 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 864 864 .supports_idle = true, 865 865 .adv_thermal_throttle = true, ··· 933 933 .shadow_ram_support = true, 934 934 .ht_greenfield_support = true, 935 935 .led_compensation = 51, 936 - .use_rts_for_ht = true, /* use rts/cts protection */ 936 + .use_rts_for_aggregation = true, /* use rts/cts protection */ 937 937 .chain_noise_num_beacons = IWL_CAL_NUM_BEACONS, 938 938 .supports_idle = true, 939 939 .adv_thermal_throttle = true,
+15 -4
drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
··· 211 211 } 212 212 } 213 213 214 - static void iwlagn_rts_tx_cmd_flag(struct ieee80211_tx_info *info, 215 - __le32 *tx_flags) 214 + static void iwlagn_tx_cmd_protection(struct iwl_priv *priv, 215 + struct ieee80211_tx_info *info, 216 + __le16 fc, __le32 *tx_flags) 216 217 { 217 - *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; 218 + if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS || 219 + info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { 220 + *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; 221 + return; 222 + } 223 + 224 + if (priv->cfg->use_rts_for_aggregation && 225 + info->flags & IEEE80211_TX_CTL_AMPDU) { 226 + *tx_flags |= TX_CMD_FLG_PROT_REQUIRE_MSK; 227 + return; 228 + } 218 229 } 219 230 220 231 /* Calc max signal level (dBm) among 3 possible receivers */ ··· 279 268 .build_addsta_hcmd = iwlagn_build_addsta_hcmd, 280 269 .gain_computation = iwlagn_gain_computation, 281 270 .chain_noise_reset = iwlagn_chain_noise_reset, 282 - .rts_tx_cmd_flag = iwlagn_rts_tx_cmd_flag, 271 + .tx_cmd_protection = iwlagn_tx_cmd_protection, 283 272 .calc_rssi = iwlagn_calc_rssi, 284 273 .request_scan = iwlagn_request_scan, 285 274 };
+1 -19
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
··· 379 379 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 380 380 } 381 381 382 - priv->cfg->ops->utils->rts_tx_cmd_flag(info, &tx_flags); 383 - 384 - if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK)) 385 - tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; 382 + priv->cfg->ops->utils->tx_cmd_protection(priv, info, fc, &tx_flags); 386 383 387 384 tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); 388 385 if (ieee80211_is_mgmt(fc)) { ··· 452 455 /* Set CCK flag as needed */ 453 456 if ((rate_idx >= IWL_FIRST_CCK_RATE) && (rate_idx <= IWL_LAST_CCK_RATE)) 454 457 rate_flags |= RATE_MCS_CCK_MSK; 455 - 456 - /* Set up RTS and CTS flags for certain packets */ 457 - switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { 458 - case cpu_to_le16(IEEE80211_STYPE_AUTH): 459 - case cpu_to_le16(IEEE80211_STYPE_DEAUTH): 460 - case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): 461 - case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): 462 - if (tx_cmd->tx_flags & TX_CMD_FLG_RTS_MSK) { 463 - tx_cmd->tx_flags &= ~TX_CMD_FLG_RTS_MSK; 464 - tx_cmd->tx_flags |= TX_CMD_FLG_CTS_MSK; 465 - } 466 - break; 467 - default: 468 - break; 469 - } 470 458 471 459 /* Set up antennas */ 472 460 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
+21 -64
drivers/net/wireless/iwlwifi/iwl-agn.c
··· 202 202 203 203 priv->start_calib = 0; 204 204 if (new_assoc) { 205 - /* 206 - * allow CTS-to-self if possible for new association. 207 - * this is relevant only for 5000 series and up, 208 - * but will not damage 4965 209 - */ 210 - priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN; 211 - 212 205 /* Apply the new configuration 213 206 * RXON assoc doesn't clear the station table in uCode, 214 207 */ ··· 1611 1618 1612 1619 static DEVICE_ATTR(tx_power, S_IWUSR | S_IRUGO, show_tx_power, store_tx_power); 1613 1620 1614 - static ssize_t show_rts_ht_protection(struct device *d, 1615 - struct device_attribute *attr, char *buf) 1616 - { 1617 - struct iwl_priv *priv = dev_get_drvdata(d); 1618 - 1619 - return sprintf(buf, "%s\n", 1620 - priv->cfg->use_rts_for_ht ? "RTS/CTS" : "CTS-to-self"); 1621 - } 1622 - 1623 - static ssize_t store_rts_ht_protection(struct device *d, 1624 - struct device_attribute *attr, 1625 - const char *buf, size_t count) 1626 - { 1627 - struct iwl_priv *priv = dev_get_drvdata(d); 1628 - unsigned long val; 1629 - int ret; 1630 - 1631 - ret = strict_strtoul(buf, 10, &val); 1632 - if (ret) 1633 - IWL_INFO(priv, "Input is not in decimal form.\n"); 1634 - else { 1635 - if (!iwl_is_associated(priv)) 1636 - priv->cfg->use_rts_for_ht = val ? true : false; 1637 - else 1638 - IWL_ERR(priv, "Sta associated with AP - " 1639 - "Change protection mechanism is not allowed\n"); 1640 - ret = count; 1641 - } 1642 - return ret; 1643 - } 1644 - 1645 - static DEVICE_ATTR(rts_ht_protection, S_IWUSR | S_IRUGO, 1646 - show_rts_ht_protection, store_rts_ht_protection); 1647 - 1648 - 1649 1621 static struct attribute *iwl_sysfs_entries[] = { 1650 1622 &dev_attr_temperature.attr, 1651 1623 &dev_attr_tx_power.attr, 1652 - &dev_attr_rts_ht_protection.attr, 1653 1624 #ifdef CONFIG_IWLWIFI_DEBUG 1654 1625 &dev_attr_debug_level.attr, 1655 1626 #endif ··· 3421 3464 return ret; 3422 3465 } 3423 3466 3424 - /* 3425 - * switch to RTS/CTS for TX 3426 - */ 3427 - static void iwl_enable_rts_cts(struct iwl_priv *priv) 3428 - { 3429 - 3430 - if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 3431 - return; 3432 - 3433 - priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN; 3434 - if (!test_bit(STATUS_SCANNING, &priv->status)) { 3435 - IWL_DEBUG_INFO(priv, "use RTS/CTS protection\n"); 3436 - iwlcore_commit_rxon(priv); 3437 - } else { 3438 - /* scanning, defer the request until scan completed */ 3439 - IWL_DEBUG_INFO(priv, "defer setting RTS/CTS protection\n"); 3440 - } 3441 - } 3442 - 3443 3467 static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, 3444 3468 struct ieee80211_vif *vif, 3445 3469 enum ieee80211_ampdu_mlme_action action, ··· 3467 3529 } 3468 3530 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 3469 3531 ret = 0; 3532 + if (priv->cfg->use_rts_for_aggregation) { 3533 + struct iwl_station_priv *sta_priv = 3534 + (void *) sta->drv_priv; 3535 + /* 3536 + * switch off RTS/CTS if it was previously enabled 3537 + */ 3538 + 3539 + sta_priv->lq_sta.lq.general_params.flags &= 3540 + ~LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK; 3541 + iwl_send_lq_cmd(priv, &sta_priv->lq_sta.lq, 3542 + CMD_ASYNC, false); 3543 + } 3470 3544 break; 3471 3545 case IEEE80211_AMPDU_TX_OPERATIONAL: 3472 - if (priv->cfg->use_rts_for_ht) { 3546 + if (priv->cfg->use_rts_for_aggregation) { 3547 + struct iwl_station_priv *sta_priv = 3548 + (void *) sta->drv_priv; 3549 + 3473 3550 /* 3474 3551 * switch to RTS/CTS if it is the prefer protection 3475 3552 * method for HT traffic 3476 3553 */ 3477 - iwl_enable_rts_cts(priv); 3554 + 3555 + sta_priv->lq_sta.lq.general_params.flags |= 3556 + LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK; 3557 + iwl_send_lq_cmd(priv, &sta_priv->lq_sta.lq, 3558 + CMD_ASYNC, false); 3478 3559 } 3479 3560 ret = 0; 3480 3561 break;
+25 -4
drivers/net/wireless/iwlwifi/iwl-core.c
··· 401 401 EXPORT_SYMBOL(iwlcore_free_geos); 402 402 403 403 /* 404 - * iwlcore_rts_tx_cmd_flag: Set rts/cts. 3945 and 4965 only share this 404 + * iwlcore_tx_cmd_protection: Set rts/cts. 3945 and 4965 only share this 405 405 * function. 406 406 */ 407 - void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, 408 - __le32 *tx_flags) 407 + void iwlcore_tx_cmd_protection(struct iwl_priv *priv, 408 + struct ieee80211_tx_info *info, 409 + __le16 fc, __le32 *tx_flags) 409 410 { 410 411 if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) { 411 412 *tx_flags |= TX_CMD_FLG_RTS_MSK; 412 413 *tx_flags &= ~TX_CMD_FLG_CTS_MSK; 414 + *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; 415 + 416 + if (!ieee80211_is_mgmt(fc)) 417 + return; 418 + 419 + switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { 420 + case cpu_to_le16(IEEE80211_STYPE_AUTH): 421 + case cpu_to_le16(IEEE80211_STYPE_DEAUTH): 422 + case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): 423 + case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): 424 + *tx_flags &= ~TX_CMD_FLG_RTS_MSK; 425 + *tx_flags |= TX_CMD_FLG_CTS_MSK; 426 + break; 427 + } 413 428 } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { 414 429 *tx_flags &= ~TX_CMD_FLG_RTS_MSK; 415 430 *tx_flags |= TX_CMD_FLG_CTS_MSK; 431 + *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; 416 432 } 417 433 } 418 - EXPORT_SYMBOL(iwlcore_rts_tx_cmd_flag); 434 + EXPORT_SYMBOL(iwlcore_tx_cmd_protection); 435 + 419 436 420 437 static bool is_single_rx_stream(struct iwl_priv *priv) 421 438 { ··· 1886 1869 priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; 1887 1870 else 1888 1871 priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; 1872 + if (bss_conf->use_cts_prot) 1873 + priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN; 1874 + else 1875 + priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN; 1889 1876 } 1890 1877 1891 1878 if (changes & BSS_CHANGED_BASIC_RATES) {
+8 -6
drivers/net/wireless/iwlwifi/iwl-core.h
··· 104 104 u32 min_average_noise, 105 105 u8 default_chain); 106 106 void (*chain_noise_reset)(struct iwl_priv *priv); 107 - void (*rts_tx_cmd_flag)(struct ieee80211_tx_info *info, 108 - __le32 *tx_flags); 107 + void (*tx_cmd_protection)(struct iwl_priv *priv, 108 + struct ieee80211_tx_info *info, 109 + __le16 fc, __le32 *tx_flags); 109 110 int (*calc_rssi)(struct iwl_priv *priv, 110 111 struct iwl_rx_phy_res *rx_resp); 111 112 void (*request_scan)(struct iwl_priv *priv, struct ieee80211_vif *vif); ··· 250 249 * @led_compensation: compensate on the led on/off time per HW according 251 250 * to the deviation to achieve the desired led frequency. 252 251 * The detail algorithm is described in iwl-led.c 253 - * @use_rts_for_ht: use rts/cts protection for HT traffic 252 + * @use_rts_for_aggregation: use rts/cts protection for HT traffic 254 253 * @chain_noise_num_beacons: number of beacons used to compute chain noise 255 254 * @adv_thermal_throttle: support advance thermal throttle 256 255 * @support_ct_kill_exit: support ct kill exit condition ··· 319 318 const bool ht_greenfield_support; 320 319 u16 led_compensation; 321 320 const bool broken_powersave; 322 - bool use_rts_for_ht; 321 + bool use_rts_for_aggregation; 323 322 int chain_noise_num_beacons; 324 323 const bool supports_idle; 325 324 bool adv_thermal_throttle; ··· 391 390 void iwl_mac_reset_tsf(struct ieee80211_hw *hw); 392 391 int iwl_alloc_txq_mem(struct iwl_priv *priv); 393 392 void iwl_free_txq_mem(struct iwl_priv *priv); 394 - void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, 395 - __le32 *tx_flags); 393 + void iwlcore_tx_cmd_protection(struct iwl_priv *priv, 394 + struct ieee80211_tx_info *info, 395 + __le16 fc, __le32 *tx_flags); 396 396 #ifdef CONFIG_IWLWIFI_DEBUGFS 397 397 int iwl_alloc_traffic_mem(struct iwl_priv *priv); 398 398 void iwl_free_traffic_mem(struct iwl_priv *priv);
+1 -4
drivers/net/wireless/iwlwifi/iwl3945-base.c
··· 435 435 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 436 436 } 437 437 438 - priv->cfg->ops->utils->rts_tx_cmd_flag(info, &tx_flags); 439 - 440 - if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK)) 441 - tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; 438 + priv->cfg->ops->utils->tx_cmd_protection(priv, info, fc, &tx_flags); 442 439 443 440 tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); 444 441 if (ieee80211_is_mgmt(fc)) {
+1
drivers/net/wireless/libertas/cfg.c
··· 9 9 #include <linux/sched.h> 10 10 #include <linux/wait.h> 11 11 #include <linux/slab.h> 12 + #include <linux/sched.h> 12 13 #include <linux/ieee80211.h> 13 14 #include <net/cfg80211.h> 14 15 #include <asm/unaligned.h>
-2
drivers/net/wireless/p54/p54pci.c
··· 43 43 { PCI_DEVICE(0x1260, 0x3886) }, 44 44 /* Intersil PRISM Xbow Wireless LAN adapter (Symbol AP-300) */ 45 45 { PCI_DEVICE(0x1260, 0xffff) }, 46 - /* Standard Microsystems Corp SMC2802W Wireless PCI */ 47 - { PCI_DEVICE(0x10b8, 0x2802) }, 48 46 { }, 49 47 }; 50 48
+59 -59
drivers/s390/net/claw.c
··· 386 386 struct chbk *p_ch; 387 387 388 388 CLAW_DBF_TEXT(4, trace, "claw_tx"); 389 - p_ch=&privptr->channel[WRITE]; 389 + p_ch = &privptr->channel[WRITE_CHANNEL]; 390 390 spin_lock_irqsave(get_ccwdev_lock(p_ch->cdev), saveflags); 391 391 rc=claw_hw_tx( skb, dev, 1 ); 392 392 spin_unlock_irqrestore(get_ccwdev_lock(p_ch->cdev), saveflags); ··· 407 407 claw_pack_skb(struct claw_privbk *privptr) 408 408 { 409 409 struct sk_buff *new_skb,*held_skb; 410 - struct chbk *p_ch = &privptr->channel[WRITE]; 410 + struct chbk *p_ch = &privptr->channel[WRITE_CHANNEL]; 411 411 struct claw_env *p_env = privptr->p_env; 412 412 int pkt_cnt,pk_ind,so_far; 413 413 ··· 515 515 privptr->p_env->write_size=CLAW_FRAME_SIZE; 516 516 } 517 517 claw_set_busy(dev); 518 - tasklet_init(&privptr->channel[READ].tasklet, claw_irq_tasklet, 519 - (unsigned long) &privptr->channel[READ]); 518 + tasklet_init(&privptr->channel[READ_CHANNEL].tasklet, claw_irq_tasklet, 519 + (unsigned long) &privptr->channel[READ_CHANNEL]); 520 520 for ( i = 0; i < 2; i++) { 521 521 CLAW_DBF_TEXT_(2, trace, "opn_ch%d", i); 522 522 init_waitqueue_head(&privptr->channel[i].wait); 523 523 /* skb_queue_head_init(&p_ch->io_queue); */ 524 - if (i == WRITE) 524 + if (i == WRITE_CHANNEL) 525 525 skb_queue_head_init( 526 - &privptr->channel[WRITE].collect_queue); 526 + &privptr->channel[WRITE_CHANNEL].collect_queue); 527 527 privptr->channel[i].flag_a = 0; 528 528 privptr->channel[i].IO_active = 0; 529 529 privptr->channel[i].flag &= ~CLAW_TIMER; ··· 551 551 if((privptr->channel[i].flag & CLAW_TIMER) == 0x00) 552 552 del_timer(&timer); 553 553 } 554 - if ((((privptr->channel[READ].last_dstat | 555 - privptr->channel[WRITE].last_dstat) & 554 + if ((((privptr->channel[READ_CHANNEL].last_dstat | 555 + privptr->channel[WRITE_CHANNEL].last_dstat) & 556 556 ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) || 557 - (((privptr->channel[READ].flag | 558 - privptr->channel[WRITE].flag) & CLAW_TIMER) != 0x00)) { 559 - dev_info(&privptr->channel[READ].cdev->dev, 557 + (((privptr->channel[READ_CHANNEL].flag | 558 + privptr->channel[WRITE_CHANNEL].flag) & CLAW_TIMER) != 0x00)) { 559 + dev_info(&privptr->channel[READ_CHANNEL].cdev->dev, 560 560 "%s: remote side is not ready\n", dev->name); 561 561 CLAW_DBF_TEXT(2, trace, "notrdy"); 562 562 ··· 608 608 } 609 609 } 610 610 privptr->buffs_alloc = 0; 611 - privptr->channel[READ].flag= 0x00; 612 - privptr->channel[WRITE].flag = 0x00; 611 + privptr->channel[READ_CHANNEL].flag = 0x00; 612 + privptr->channel[WRITE_CHANNEL].flag = 0x00; 613 613 privptr->p_buff_ccw=NULL; 614 614 privptr->p_buff_read=NULL; 615 615 privptr->p_buff_write=NULL; ··· 652 652 } 653 653 654 654 /* Try to extract channel from driver data. */ 655 - if (privptr->channel[READ].cdev == cdev) 656 - p_ch = &privptr->channel[READ]; 657 - else if (privptr->channel[WRITE].cdev == cdev) 658 - p_ch = &privptr->channel[WRITE]; 655 + if (privptr->channel[READ_CHANNEL].cdev == cdev) 656 + p_ch = &privptr->channel[READ_CHANNEL]; 657 + else if (privptr->channel[WRITE_CHANNEL].cdev == cdev) 658 + p_ch = &privptr->channel[WRITE_CHANNEL]; 659 659 else { 660 660 dev_warn(&cdev->dev, "The device is not a CLAW device\n"); 661 661 CLAW_DBF_TEXT(2, trace, "badchan"); ··· 813 813 claw_clearbit_busy(TB_TX, dev); 814 814 claw_clear_busy(dev); 815 815 } 816 - p_ch_r = (struct chbk *)&privptr->channel[READ]; 816 + p_ch_r = (struct chbk *)&privptr->channel[READ_CHANNEL]; 817 817 if (test_and_set_bit(CLAW_BH_ACTIVE, 818 818 (void *)&p_ch_r->flag_a) == 0) 819 819 tasklet_schedule(&p_ch_r->tasklet); ··· 878 878 for ( i = 1; i >=0 ; i--) { 879 879 spin_lock_irqsave( 880 880 get_ccwdev_lock(privptr->channel[i].cdev), saveflags); 881 - /* del_timer(&privptr->channel[READ].timer); */ 881 + /* del_timer(&privptr->channel[READ_CHANNEL].timer); */ 882 882 privptr->channel[i].claw_state = CLAW_STOP; 883 883 privptr->channel[i].IO_active = 0; 884 884 parm = (unsigned long) &privptr->channel[i]; 885 - if (i == WRITE) 885 + if (i == WRITE_CHANNEL) 886 886 claw_purge_skb_queue( 887 - &privptr->channel[WRITE].collect_queue); 887 + &privptr->channel[WRITE_CHANNEL].collect_queue); 888 888 rc = ccw_device_halt (privptr->channel[i].cdev, parm); 889 889 if (privptr->system_validate_comp==0x00) /* never opened? */ 890 890 init_waitqueue_head(&privptr->channel[i].wait); ··· 971 971 privptr->mtc_skipping = 1; 972 972 privptr->mtc_offset=0; 973 973 974 - if (((privptr->channel[READ].last_dstat | 975 - privptr->channel[WRITE].last_dstat) & 974 + if (((privptr->channel[READ_CHANNEL].last_dstat | 975 + privptr->channel[WRITE_CHANNEL].last_dstat) & 976 976 ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) { 977 - dev_warn(&privptr->channel[READ].cdev->dev, 977 + dev_warn(&privptr->channel[READ_CHANNEL].cdev->dev, 978 978 "Deactivating %s completed with incorrect" 979 979 " subchannel status " 980 980 "(read %02x, write %02x)\n", 981 981 dev->name, 982 - privptr->channel[READ].last_dstat, 983 - privptr->channel[WRITE].last_dstat); 982 + privptr->channel[READ_CHANNEL].last_dstat, 983 + privptr->channel[WRITE_CHANNEL].last_dstat); 984 984 CLAW_DBF_TEXT(2, trace, "badclose"); 985 985 } 986 986 CLAW_DBF_TEXT(4, trace, "rlsexit"); ··· 1324 1324 1325 1325 CLAW_DBF_TEXT(4, trace, "hw_tx"); 1326 1326 privptr = (struct claw_privbk *)(dev->ml_priv); 1327 - p_ch=(struct chbk *)&privptr->channel[WRITE]; 1327 + p_ch = (struct chbk *)&privptr->channel[WRITE_CHANNEL]; 1328 1328 p_env =privptr->p_env; 1329 1329 claw_free_wrt_buf(dev); /* Clean up free chain if posible */ 1330 1330 /* scan the write queue to free any completed write packets */ ··· 1357 1357 claw_strt_out_IO(dev ); 1358 1358 claw_free_wrt_buf( dev ); 1359 1359 if (privptr->write_free_count==0) { 1360 - ch = &privptr->channel[WRITE]; 1360 + ch = &privptr->channel[WRITE_CHANNEL]; 1361 1361 atomic_inc(&skb->users); 1362 1362 skb_queue_tail(&ch->collect_queue, skb); 1363 1363 goto Done; ··· 1369 1369 } 1370 1370 /* tx lock */ 1371 1371 if (claw_test_and_setbit_busy(TB_TX,dev)) { /* set to busy */ 1372 - ch = &privptr->channel[WRITE]; 1372 + ch = &privptr->channel[WRITE_CHANNEL]; 1373 1373 atomic_inc(&skb->users); 1374 1374 skb_queue_tail(&ch->collect_queue, skb); 1375 1375 claw_strt_out_IO(dev ); ··· 1385 1385 privptr->p_write_free_chain == NULL ) { 1386 1386 1387 1387 claw_setbit_busy(TB_NOBUFFER,dev); 1388 - ch = &privptr->channel[WRITE]; 1388 + ch = &privptr->channel[WRITE_CHANNEL]; 1389 1389 atomic_inc(&skb->users); 1390 1390 skb_queue_tail(&ch->collect_queue, skb); 1391 1391 CLAW_DBF_TEXT(2, trace, "clawbusy"); ··· 1397 1397 while (len_of_data > 0) { 1398 1398 p_this_ccw=privptr->p_write_free_chain; /* get a block */ 1399 1399 if (p_this_ccw == NULL) { /* lost the race */ 1400 - ch = &privptr->channel[WRITE]; 1400 + ch = &privptr->channel[WRITE_CHANNEL]; 1401 1401 atomic_inc(&skb->users); 1402 1402 skb_queue_tail(&ch->collect_queue, skb); 1403 1403 goto Done2; ··· 2067 2067 *catch up to each other */ 2068 2068 privptr = dev->ml_priv; 2069 2069 p_env=privptr->p_env; 2070 - tdev = &privptr->channel[READ].cdev->dev; 2070 + tdev = &privptr->channel[READ_CHANNEL].cdev->dev; 2071 2071 memcpy( &temp_host_name, p_env->host_name, 8); 2072 2072 memcpy( &temp_ws_name, p_env->adapter_name , 8); 2073 2073 dev_info(tdev, "%s: CLAW device %.8s: " ··· 2245 2245 dev->name, temp_ws_name, 2246 2246 p_ctlbk->linkid); 2247 2247 privptr->active_link_ID = p_ctlbk->linkid; 2248 - p_ch = &privptr->channel[WRITE]; 2248 + p_ch = &privptr->channel[WRITE_CHANNEL]; 2249 2249 wake_up(&p_ch->wait); /* wake up claw_open ( WRITE) */ 2250 2250 break; 2251 2251 case CONNECTION_RESPONSE: ··· 2296 2296 "%s: Confirmed Now packing\n", dev->name); 2297 2297 p_env->packing = DO_PACKED; 2298 2298 } 2299 - p_ch = &privptr->channel[WRITE]; 2299 + p_ch = &privptr->channel[WRITE_CHANNEL]; 2300 2300 wake_up(&p_ch->wait); 2301 2301 } else { 2302 2302 dev_warn(tdev, "Activating %s failed because of" ··· 2556 2556 p_packd=NULL; 2557 2557 privptr = dev->ml_priv; 2558 2558 2559 - p_dev = &privptr->channel[READ].cdev->dev; 2559 + p_dev = &privptr->channel[READ_CHANNEL].cdev->dev; 2560 2560 p_env = privptr->p_env; 2561 2561 p_this_ccw=privptr->p_read_active_first; 2562 2562 while (p_this_ccw!=NULL && p_this_ccw->header.flag!=CLAW_PENDING) { ··· 2728 2728 struct ccwbk*p_ccwbk; 2729 2729 struct chbk *p_ch; 2730 2730 struct clawh *p_clawh; 2731 - p_ch=&privptr->channel[READ]; 2731 + p_ch = &privptr->channel[READ_CHANNEL]; 2732 2732 2733 2733 CLAW_DBF_TEXT(4, trace, "StRdNter"); 2734 2734 p_clawh=(struct clawh *)privptr->p_claw_signal_blk; ··· 2782 2782 return; 2783 2783 } 2784 2784 privptr = (struct claw_privbk *)dev->ml_priv; 2785 - p_ch=&privptr->channel[WRITE]; 2785 + p_ch = &privptr->channel[WRITE_CHANNEL]; 2786 2786 2787 2787 CLAW_DBF_TEXT(4, trace, "strt_io"); 2788 2788 p_first_ccw=privptr->p_write_active_first; ··· 2875 2875 if (dev->flags & IFF_RUNNING) 2876 2876 claw_release(dev); 2877 2877 if (privptr) { 2878 - privptr->channel[READ].ndev = NULL; /* say it's free */ 2878 + privptr->channel[READ_CHANNEL].ndev = NULL; /* say it's free */ 2879 2879 } 2880 2880 dev->ml_priv = NULL; 2881 2881 #ifdef MODULE ··· 2960 2960 struct ccw_dev_id dev_id; 2961 2961 2962 2962 dev_info(&cgdev->dev, "add for %s\n", 2963 - dev_name(&cgdev->cdev[READ]->dev)); 2963 + dev_name(&cgdev->cdev[READ_CHANNEL]->dev)); 2964 2964 CLAW_DBF_TEXT(2, setup, "new_dev"); 2965 2965 privptr = dev_get_drvdata(&cgdev->dev); 2966 - dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr); 2967 - dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr); 2966 + dev_set_drvdata(&cgdev->cdev[READ_CHANNEL]->dev, privptr); 2967 + dev_set_drvdata(&cgdev->cdev[WRITE_CHANNEL]->dev, privptr); 2968 2968 if (!privptr) 2969 2969 return -ENODEV; 2970 2970 p_env = privptr->p_env; 2971 - ccw_device_get_id(cgdev->cdev[READ], &dev_id); 2972 - p_env->devno[READ] = dev_id.devno; 2973 - ccw_device_get_id(cgdev->cdev[WRITE], &dev_id); 2974 - p_env->devno[WRITE] = dev_id.devno; 2971 + ccw_device_get_id(cgdev->cdev[READ_CHANNEL], &dev_id); 2972 + p_env->devno[READ_CHANNEL] = dev_id.devno; 2973 + ccw_device_get_id(cgdev->cdev[WRITE_CHANNEL], &dev_id); 2974 + p_env->devno[WRITE_CHANNEL] = dev_id.devno; 2975 2975 ret = add_channel(cgdev->cdev[0],0,privptr); 2976 2976 if (ret == 0) 2977 2977 ret = add_channel(cgdev->cdev[1],1,privptr); ··· 2980 2980 " failed with error code %d\n", ret); 2981 2981 goto out; 2982 2982 } 2983 - ret = ccw_device_set_online(cgdev->cdev[READ]); 2983 + ret = ccw_device_set_online(cgdev->cdev[READ_CHANNEL]); 2984 2984 if (ret != 0) { 2985 2985 dev_warn(&cgdev->dev, 2986 2986 "Setting the read subchannel online" 2987 2987 " failed with error code %d\n", ret); 2988 2988 goto out; 2989 2989 } 2990 - ret = ccw_device_set_online(cgdev->cdev[WRITE]); 2990 + ret = ccw_device_set_online(cgdev->cdev[WRITE_CHANNEL]); 2991 2991 if (ret != 0) { 2992 2992 dev_warn(&cgdev->dev, 2993 2993 "Setting the write subchannel online " ··· 3002 3002 } 3003 3003 dev->ml_priv = privptr; 3004 3004 dev_set_drvdata(&cgdev->dev, privptr); 3005 - dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr); 3006 - dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr); 3005 + dev_set_drvdata(&cgdev->cdev[READ_CHANNEL]->dev, privptr); 3006 + dev_set_drvdata(&cgdev->cdev[WRITE_CHANNEL]->dev, privptr); 3007 3007 /* sysfs magic */ 3008 3008 SET_NETDEV_DEV(dev, &cgdev->dev); 3009 3009 if (register_netdev(dev) != 0) { ··· 3021 3021 goto out; 3022 3022 } 3023 3023 } 3024 - privptr->channel[READ].ndev = dev; 3025 - privptr->channel[WRITE].ndev = dev; 3024 + privptr->channel[READ_CHANNEL].ndev = dev; 3025 + privptr->channel[WRITE_CHANNEL].ndev = dev; 3026 3026 privptr->p_env->ndev = dev; 3027 3027 3028 3028 dev_info(&cgdev->dev, "%s:readsize=%d writesize=%d " 3029 3029 "readbuffer=%d writebuffer=%d read=0x%04x write=0x%04x\n", 3030 3030 dev->name, p_env->read_size, 3031 3031 p_env->write_size, p_env->read_buffers, 3032 - p_env->write_buffers, p_env->devno[READ], 3033 - p_env->devno[WRITE]); 3032 + p_env->write_buffers, p_env->devno[READ_CHANNEL], 3033 + p_env->devno[WRITE_CHANNEL]); 3034 3034 dev_info(&cgdev->dev, "%s:host_name:%.8s, adapter_name " 3035 3035 ":%.8s api_type: %.8s\n", 3036 3036 dev->name, p_env->host_name, ··· 3072 3072 priv = dev_get_drvdata(&cgdev->dev); 3073 3073 if (!priv) 3074 3074 return -ENODEV; 3075 - ndev = priv->channel[READ].ndev; 3075 + ndev = priv->channel[READ_CHANNEL].ndev; 3076 3076 if (ndev) { 3077 3077 /* Close the device */ 3078 - dev_info(&cgdev->dev, "%s: shutting down \n", 3078 + dev_info(&cgdev->dev, "%s: shutting down\n", 3079 3079 ndev->name); 3080 3080 if (ndev->flags & IFF_RUNNING) 3081 3081 ret = claw_release(ndev); ··· 3083 3083 unregister_netdev(ndev); 3084 3084 ndev->ml_priv = NULL; /* cgdev data, not ndev's to free */ 3085 3085 claw_free_netdevice(ndev, 1); 3086 - priv->channel[READ].ndev = NULL; 3087 - priv->channel[WRITE].ndev = NULL; 3086 + priv->channel[READ_CHANNEL].ndev = NULL; 3087 + priv->channel[WRITE_CHANNEL].ndev = NULL; 3088 3088 priv->p_env->ndev = NULL; 3089 3089 } 3090 3090 ccw_device_set_offline(cgdev->cdev[1]); ··· 3115 3115 priv->channel[1].irb=NULL; 3116 3116 kfree(priv); 3117 3117 dev_set_drvdata(&cgdev->dev, NULL); 3118 - dev_set_drvdata(&cgdev->cdev[READ]->dev, NULL); 3119 - dev_set_drvdata(&cgdev->cdev[WRITE]->dev, NULL); 3118 + dev_set_drvdata(&cgdev->cdev[READ_CHANNEL]->dev, NULL); 3119 + dev_set_drvdata(&cgdev->cdev[WRITE_CHANNEL]->dev, NULL); 3120 3120 put_device(&cgdev->dev); 3121 3121 3122 3122 return;
+2 -2
drivers/s390/net/claw.h
··· 74 74 #define MAX_ENVELOPE_SIZE 65536 75 75 #define CLAW_DEFAULT_MTU_SIZE 4096 76 76 #define DEF_PACK_BUFSIZE 32768 77 - #define READ 0 78 - #define WRITE 1 77 + #define READ_CHANNEL 0 78 + #define WRITE_CHANNEL 1 79 79 80 80 #define TB_TX 0 /* sk buffer handling in process */ 81 81 #define TB_STOP 1 /* network device stop in process */
+31 -29
drivers/s390/net/ctcm_fsms.c
··· 454 454 if ((fsmstate == CTC_STATE_SETUPWAIT) && 455 455 (ch->protocol == CTCM_PROTO_OS390)) { 456 456 /* OS/390 resp. z/OS */ 457 - if (CHANNEL_DIRECTION(ch->flags) == READ) { 457 + if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { 458 458 *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; 459 459 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, 460 460 CTC_EVENT_TIMER, ch); ··· 472 472 * if in compatibility mode, since VM TCP delays the initial 473 473 * frame until it has some data to send. 474 474 */ 475 - if ((CHANNEL_DIRECTION(ch->flags) == WRITE) || 475 + if ((CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) || 476 476 (ch->protocol != CTCM_PROTO_S390)) 477 477 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); 478 478 479 479 *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; 480 480 ch->ccw[1].count = 2; /* Transfer only length */ 481 481 482 - fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == READ) 482 + fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) 483 483 ? CTC_STATE_RXINIT : CTC_STATE_TXINIT); 484 484 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 485 485 (unsigned long)ch, 0xff, 0); ··· 495 495 * reply from VM TCP which brings up the RX channel to it's 496 496 * final state. 497 497 */ 498 - if ((CHANNEL_DIRECTION(ch->flags) == READ) && 498 + if ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) && 499 499 (ch->protocol == CTCM_PROTO_S390)) { 500 500 struct net_device *dev = ch->netdev; 501 501 struct ctcm_priv *priv = dev->ml_priv; ··· 600 600 int rc; 601 601 602 602 CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, "%s(%s): %s", 603 - CTCM_FUNTAIL, ch->id, 604 - (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); 603 + CTCM_FUNTAIL, ch->id, 604 + (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX"); 605 605 606 606 if (ch->trans_skb != NULL) { 607 607 clear_normalized_cda(&ch->ccw[1]); 608 608 dev_kfree_skb(ch->trans_skb); 609 609 ch->trans_skb = NULL; 610 610 } 611 - if (CHANNEL_DIRECTION(ch->flags) == READ) { 611 + if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { 612 612 ch->ccw[1].cmd_code = CCW_CMD_READ; 613 613 ch->ccw[1].flags = CCW_FLAG_SLI; 614 614 ch->ccw[1].count = 0; ··· 622 622 "%s(%s): %s trans_skb alloc delayed " 623 623 "until first transfer", 624 624 CTCM_FUNTAIL, ch->id, 625 - (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); 625 + (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? 626 + "RX" : "TX"); 626 627 } 627 628 ch->ccw[0].cmd_code = CCW_CMD_PREPARE; 628 629 ch->ccw[0].flags = CCW_FLAG_SLI | CCW_FLAG_CC; ··· 721 720 722 721 ch->th_seg = 0x00; 723 722 ch->th_seq_num = 0x00; 724 - if (CHANNEL_DIRECTION(ch->flags) == READ) { 723 + if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { 725 724 skb_queue_purge(&ch->io_queue); 726 725 fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); 727 726 } else { ··· 800 799 fsm_newstate(fi, CTC_STATE_STARTRETRY); 801 800 fsm_deltimer(&ch->timer); 802 801 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); 803 - if (!IS_MPC(ch) && (CHANNEL_DIRECTION(ch->flags) == READ)) { 802 + if (!IS_MPC(ch) && 803 + (CHANNEL_DIRECTION(ch->flags) == CTCM_READ)) { 804 804 int rc = ccw_device_halt(ch->cdev, (unsigned long)ch); 805 805 if (rc != 0) 806 806 ctcm_ccw_check_rc(ch, rc, ··· 813 811 CTCM_DBF_TEXT_(ERROR, CTC_DBF_CRIT, 814 812 "%s(%s) : %s error during %s channel setup state=%s\n", 815 813 CTCM_FUNTAIL, dev->name, ctc_ch_event_names[event], 816 - (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX", 814 + (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX", 817 815 fsm_getstate_str(fi)); 818 816 819 - if (CHANNEL_DIRECTION(ch->flags) == READ) { 817 + if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { 820 818 fsm_newstate(fi, CTC_STATE_RXERR); 821 819 fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); 822 820 } else { ··· 947 945 fsm_event(priv->fsm, DEV_EVENT_TXDOWN, dev); 948 946 949 947 fsm_newstate(fi, CTC_STATE_DTERM); 950 - ch2 = priv->channel[WRITE]; 948 + ch2 = priv->channel[CTCM_WRITE]; 951 949 fsm_newstate(ch2->fsm, CTC_STATE_DTERM); 952 950 953 951 ccw_device_halt(ch->cdev, (unsigned long)ch); ··· 1076 1074 fsm_deltimer(&ch->timer); 1077 1075 CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, 1078 1076 "%s: %s: %s unrecoverable channel error", 1079 - CTCM_FUNTAIL, ch->id, rd == READ ? "RX" : "TX"); 1077 + CTCM_FUNTAIL, ch->id, rd == CTCM_READ ? "RX" : "TX"); 1080 1078 1081 1079 if (IS_MPC(ch)) { 1082 1080 priv->stats.tx_dropped++; 1083 1081 priv->stats.tx_errors++; 1084 1082 } 1085 - if (rd == READ) { 1083 + if (rd == CTCM_READ) { 1086 1084 fsm_newstate(fi, CTC_STATE_RXERR); 1087 1085 fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); 1088 1086 } else { ··· 1505 1503 switch (fsm_getstate(fi)) { 1506 1504 case CTC_STATE_STARTRETRY: 1507 1505 case CTC_STATE_SETUPWAIT: 1508 - if (CHANNEL_DIRECTION(ch->flags) == READ) { 1506 + if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { 1509 1507 ctcmpc_chx_rxidle(fi, event, arg); 1510 1508 } else { 1511 1509 fsm_newstate(fi, CTC_STATE_TXIDLE); ··· 1516 1514 break; 1517 1515 }; 1518 1516 1519 - fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == READ) 1517 + fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) 1520 1518 ? CTC_STATE_RXINIT : CTC_STATE_TXINIT); 1521 1519 1522 1520 done: ··· 1755 1753 struct net_device *dev = ach->netdev; 1756 1754 struct ctcm_priv *priv = dev->ml_priv; 1757 1755 struct mpc_group *grp = priv->mpcg; 1758 - struct channel *wch = priv->channel[WRITE]; 1759 - struct channel *rch = priv->channel[READ]; 1756 + struct channel *wch = priv->channel[CTCM_WRITE]; 1757 + struct channel *rch = priv->channel[CTCM_READ]; 1760 1758 struct sk_buff *skb; 1761 1759 struct th_sweep *header; 1762 1760 int rc = 0; ··· 2072 2070 fsm_newstate(fi, DEV_STATE_STARTWAIT_RXTX); 2073 2071 if (IS_MPC(priv)) 2074 2072 priv->mpcg->channels_terminating = 0; 2075 - for (direction = READ; direction <= WRITE; direction++) { 2073 + for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) { 2076 2074 struct channel *ch = priv->channel[direction]; 2077 2075 fsm_event(ch->fsm, CTC_EVENT_START, ch); 2078 2076 } ··· 2094 2092 CTCMY_DBF_DEV_NAME(SETUP, dev, ""); 2095 2093 2096 2094 fsm_newstate(fi, DEV_STATE_STOPWAIT_RXTX); 2097 - for (direction = READ; direction <= WRITE; direction++) { 2095 + for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) { 2098 2096 struct channel *ch = priv->channel[direction]; 2099 2097 fsm_event(ch->fsm, CTC_EVENT_STOP, ch); 2100 2098 ch->th_seq_num = 0x00; ··· 2185 2183 2186 2184 if (IS_MPC(priv)) { 2187 2185 if (event == DEV_EVENT_RXUP) 2188 - mpc_channel_action(priv->channel[READ], 2189 - READ, MPC_CHANNEL_ADD); 2186 + mpc_channel_action(priv->channel[CTCM_READ], 2187 + CTCM_READ, MPC_CHANNEL_ADD); 2190 2188 else 2191 - mpc_channel_action(priv->channel[WRITE], 2192 - WRITE, MPC_CHANNEL_ADD); 2189 + mpc_channel_action(priv->channel[CTCM_WRITE], 2190 + CTCM_WRITE, MPC_CHANNEL_ADD); 2193 2191 } 2194 2192 } 2195 2193 ··· 2241 2239 } 2242 2240 if (IS_MPC(priv)) { 2243 2241 if (event == DEV_EVENT_RXDOWN) 2244 - mpc_channel_action(priv->channel[READ], 2245 - READ, MPC_CHANNEL_REMOVE); 2242 + mpc_channel_action(priv->channel[CTCM_READ], 2243 + CTCM_READ, MPC_CHANNEL_REMOVE); 2246 2244 else 2247 - mpc_channel_action(priv->channel[WRITE], 2248 - WRITE, MPC_CHANNEL_REMOVE); 2245 + mpc_channel_action(priv->channel[CTCM_WRITE], 2246 + CTCM_WRITE, MPC_CHANNEL_REMOVE); 2249 2247 } 2250 2248 } 2251 2249
+41 -39
drivers/s390/net/ctcm_main.c
··· 267 267 else { 268 268 ch->flags |= CHANNEL_FLAGS_INUSE; 269 269 ch->flags &= ~CHANNEL_FLAGS_RWMASK; 270 - ch->flags |= (direction == WRITE) 270 + ch->flags |= (direction == CTCM_WRITE) 271 271 ? CHANNEL_FLAGS_WRITE : CHANNEL_FLAGS_READ; 272 272 fsm_newstate(ch->fsm, CTC_STATE_STOPPED); 273 273 } ··· 388 388 CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, 389 389 "%s(%s): %s trans_skb allocation error", 390 390 CTCM_FUNTAIL, ch->id, 391 - (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); 391 + (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? 392 + "RX" : "TX"); 392 393 return -ENOMEM; 393 394 } 394 395 ··· 400 399 CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, 401 400 "%s(%s): %s set norm_cda failed", 402 401 CTCM_FUNTAIL, ch->id, 403 - (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); 402 + (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? 403 + "RX" : "TX"); 404 404 return -ENOMEM; 405 405 } 406 406 ··· 605 603 606 604 priv = dev->ml_priv; 607 605 grp = priv->mpcg; 608 - ch = priv->channel[WRITE]; 606 + ch = priv->channel[CTCM_WRITE]; 609 607 610 608 /* sweep processing is not complete until response and request */ 611 609 /* has completed for all read channels in group */ 612 610 if (grp->in_sweep == 0) { 613 611 grp->in_sweep = 1; 614 - grp->sweep_rsp_pend_num = grp->active_channels[READ]; 615 - grp->sweep_req_pend_num = grp->active_channels[READ]; 612 + grp->sweep_rsp_pend_num = grp->active_channels[CTCM_READ]; 613 + grp->sweep_req_pend_num = grp->active_channels[CTCM_READ]; 616 614 } 617 615 618 616 sweep_skb = __dev_alloc_skb(MPC_BUFSIZE_DEFAULT, GFP_ATOMIC|GFP_DMA); ··· 913 911 return NETDEV_TX_BUSY; 914 912 915 913 dev->trans_start = jiffies; 916 - if (ctcm_transmit_skb(priv->channel[WRITE], skb) != 0) 914 + if (ctcm_transmit_skb(priv->channel[CTCM_WRITE], skb) != 0) 917 915 return NETDEV_TX_BUSY; 918 916 return NETDEV_TX_OK; 919 917 } ··· 996 994 } 997 995 998 996 dev->trans_start = jiffies; 999 - if (ctcmpc_transmit_skb(priv->channel[WRITE], skb) != 0) { 997 + if (ctcmpc_transmit_skb(priv->channel[CTCM_WRITE], skb) != 0) { 1000 998 CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR, 1001 999 "%s(%s): device error - dropped", 1002 1000 CTCM_FUNTAIL, dev->name); ··· 1037 1035 return -EINVAL; 1038 1036 1039 1037 priv = dev->ml_priv; 1040 - max_bufsize = priv->channel[READ]->max_bufsize; 1038 + max_bufsize = priv->channel[CTCM_READ]->max_bufsize; 1041 1039 1042 1040 if (IS_MPC(priv)) { 1043 1041 if (new_mtu > max_bufsize - TH_HEADER_LENGTH) ··· 1228 1226 priv = dev_get_drvdata(&cgdev->dev); 1229 1227 1230 1228 /* Try to extract channel from driver data. */ 1231 - if (priv->channel[READ]->cdev == cdev) 1232 - ch = priv->channel[READ]; 1233 - else if (priv->channel[WRITE]->cdev == cdev) 1234 - ch = priv->channel[WRITE]; 1229 + if (priv->channel[CTCM_READ]->cdev == cdev) 1230 + ch = priv->channel[CTCM_READ]; 1231 + else if (priv->channel[CTCM_WRITE]->cdev == cdev) 1232 + ch = priv->channel[CTCM_WRITE]; 1235 1233 else { 1236 1234 dev_err(&cdev->dev, 1237 1235 "%s: Internal error: Can't determine channel for " ··· 1589 1587 goto out_ccw2; 1590 1588 } 1591 1589 1592 - for (direction = READ; direction <= WRITE; direction++) { 1590 + for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) { 1593 1591 priv->channel[direction] = 1594 - channel_get(type, direction == READ ? read_id : write_id, 1595 - direction); 1592 + channel_get(type, direction == CTCM_READ ? 1593 + read_id : write_id, direction); 1596 1594 if (priv->channel[direction] == NULL) { 1597 - if (direction == WRITE) 1598 - channel_free(priv->channel[READ]); 1595 + if (direction == CTCM_WRITE) 1596 + channel_free(priv->channel[CTCM_READ]); 1599 1597 goto out_dev; 1600 1598 } 1601 1599 priv->channel[direction]->netdev = dev; ··· 1619 1617 1620 1618 dev_info(&dev->dev, 1621 1619 "setup OK : r/w = %s/%s, protocol : %d\n", 1622 - priv->channel[READ]->id, 1623 - priv->channel[WRITE]->id, priv->protocol); 1620 + priv->channel[CTCM_READ]->id, 1621 + priv->channel[CTCM_WRITE]->id, priv->protocol); 1624 1622 1625 1623 CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, 1626 1624 "setup(%s) OK : r/w = %s/%s, protocol : %d", dev->name, 1627 - priv->channel[READ]->id, 1628 - priv->channel[WRITE]->id, priv->protocol); 1625 + priv->channel[CTCM_READ]->id, 1626 + priv->channel[CTCM_WRITE]->id, priv->protocol); 1629 1627 1630 1628 return 0; 1631 1629 out_unregister: ··· 1637 1635 out_ccw1: 1638 1636 ccw_device_set_offline(cgdev->cdev[0]); 1639 1637 out_remove_channel2: 1640 - readc = channel_get(type, read_id, READ); 1638 + readc = channel_get(type, read_id, CTCM_READ); 1641 1639 channel_remove(readc); 1642 1640 out_remove_channel1: 1643 - writec = channel_get(type, write_id, WRITE); 1641 + writec = channel_get(type, write_id, CTCM_WRITE); 1644 1642 channel_remove(writec); 1645 1643 out_err_result: 1646 1644 return result; ··· 1662 1660 if (!priv) 1663 1661 return -ENODEV; 1664 1662 1665 - if (priv->channel[READ]) { 1666 - dev = priv->channel[READ]->netdev; 1663 + if (priv->channel[CTCM_READ]) { 1664 + dev = priv->channel[CTCM_READ]->netdev; 1667 1665 CTCM_DBF_DEV(SETUP, dev, ""); 1668 1666 /* Close the device */ 1669 1667 ctcm_close(dev); 1670 1668 dev->flags &= ~IFF_RUNNING; 1671 1669 ctcm_remove_attributes(&cgdev->dev); 1672 - channel_free(priv->channel[READ]); 1670 + channel_free(priv->channel[CTCM_READ]); 1673 1671 } else 1674 1672 dev = NULL; 1675 1673 1676 - if (priv->channel[WRITE]) 1677 - channel_free(priv->channel[WRITE]); 1674 + if (priv->channel[CTCM_WRITE]) 1675 + channel_free(priv->channel[CTCM_WRITE]); 1678 1676 1679 1677 if (dev) { 1680 1678 unregister_netdev(dev); ··· 1687 1685 ccw_device_set_offline(cgdev->cdev[1]); 1688 1686 ccw_device_set_offline(cgdev->cdev[0]); 1689 1687 1690 - if (priv->channel[READ]) 1691 - channel_remove(priv->channel[READ]); 1692 - if (priv->channel[WRITE]) 1693 - channel_remove(priv->channel[WRITE]); 1694 - priv->channel[READ] = priv->channel[WRITE] = NULL; 1688 + if (priv->channel[CTCM_READ]) 1689 + channel_remove(priv->channel[CTCM_READ]); 1690 + if (priv->channel[CTCM_WRITE]) 1691 + channel_remove(priv->channel[CTCM_WRITE]); 1692 + priv->channel[CTCM_READ] = priv->channel[CTCM_WRITE] = NULL; 1695 1693 1696 1694 return 0; 1697 1695 ··· 1722 1720 1723 1721 if (gdev->state == CCWGROUP_OFFLINE) 1724 1722 return 0; 1725 - netif_device_detach(priv->channel[READ]->netdev); 1726 - ctcm_close(priv->channel[READ]->netdev); 1723 + netif_device_detach(priv->channel[CTCM_READ]->netdev); 1724 + ctcm_close(priv->channel[CTCM_READ]->netdev); 1727 1725 if (!wait_event_timeout(priv->fsm->wait_q, 1728 1726 fsm_getstate(priv->fsm) == DEV_STATE_STOPPED, CTCM_TIME_5_SEC)) { 1729 - netif_device_attach(priv->channel[READ]->netdev); 1727 + netif_device_attach(priv->channel[CTCM_READ]->netdev); 1730 1728 return -EBUSY; 1731 1729 } 1732 1730 ccw_device_set_offline(gdev->cdev[1]); ··· 1747 1745 rc = ccw_device_set_online(gdev->cdev[0]); 1748 1746 if (rc) 1749 1747 goto err_out; 1750 - ctcm_open(priv->channel[READ]->netdev); 1748 + ctcm_open(priv->channel[CTCM_READ]->netdev); 1751 1749 err_out: 1752 - netif_device_attach(priv->channel[READ]->netdev); 1750 + netif_device_attach(priv->channel[CTCM_READ]->netdev); 1753 1751 return rc; 1754 1752 } 1755 1753
+2 -2
drivers/s390/net/ctcm_main.h
··· 111 111 112 112 #define CTCM_INITIAL_BLOCKLEN 2 113 113 114 - #define READ 0 115 - #define WRITE 1 114 + #define CTCM_READ 0 115 + #define CTCM_WRITE 1 116 116 117 117 #define CTCM_ID_SIZE 20+3 118 118
+34 -30
drivers/s390/net/ctcm_mpc.c
··· 419 419 return; 420 420 priv = dev->ml_priv; 421 421 grp = priv->mpcg; 422 - rch = priv->channel[READ]; 423 - wch = priv->channel[WRITE]; 422 + rch = priv->channel[CTCM_READ]; 423 + wch = priv->channel[CTCM_WRITE]; 424 424 425 425 CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_INFO, 426 426 "%s(%s): state=%s", ··· 578 578 "%s: %s: flowc = %d", 579 579 CTCM_FUNTAIL, dev->name, flowc); 580 580 581 - rch = priv->channel[READ]; 581 + rch = priv->channel[CTCM_READ]; 582 582 583 583 mpcg_state = fsm_getstate(grp->fsm); 584 584 switch (flowc) { ··· 622 622 struct net_device *dev = rch->netdev; 623 623 struct ctcm_priv *priv = dev->ml_priv; 624 624 struct mpc_group *grp = priv->mpcg; 625 - struct channel *ch = priv->channel[WRITE]; 625 + struct channel *ch = priv->channel[CTCM_WRITE]; 626 626 627 627 CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, ch, ch->id); 628 628 CTCM_D3_DUMP((char *)mpcginfo->sweep, TH_SWEEP_LENGTH); ··· 656 656 int rc = 0; 657 657 struct th_sweep *header; 658 658 struct sk_buff *sweep_skb; 659 - struct channel *ch = priv->channel[WRITE]; 659 + struct channel *ch = priv->channel[CTCM_WRITE]; 660 660 661 661 CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, rch, rch->id); 662 662 ··· 712 712 struct net_device *dev = rch->netdev; 713 713 struct ctcm_priv *priv = dev->ml_priv; 714 714 struct mpc_group *grp = priv->mpcg; 715 - struct channel *ch = priv->channel[WRITE]; 715 + struct channel *ch = priv->channel[CTCM_WRITE]; 716 716 717 717 if (do_debug) 718 718 CTCM_DBF_TEXT_(MPC_TRACE, CTC_DBF_DEBUG, ··· 721 721 if (grp->in_sweep == 0) { 722 722 grp->in_sweep = 1; 723 723 ctcm_test_and_set_busy(dev); 724 - grp->sweep_req_pend_num = grp->active_channels[READ]; 725 - grp->sweep_rsp_pend_num = grp->active_channels[READ]; 724 + grp->sweep_req_pend_num = grp->active_channels[CTCM_READ]; 725 + grp->sweep_rsp_pend_num = grp->active_channels[CTCM_READ]; 726 726 } 727 727 728 728 CTCM_D3_DUMP((char *)mpcginfo->sweep, TH_SWEEP_LENGTH); ··· 906 906 fsm_newstate(grp->fsm, MPCG_STATE_READY); 907 907 908 908 /* Put up a read on the channel */ 909 - ch = priv->channel[READ]; 909 + ch = priv->channel[CTCM_READ]; 910 910 ch->pdu_seq = 0; 911 911 CTCM_PR_DBGDATA("ctcmpc: %s() ToDCM_pdu_seq= %08x\n" , 912 912 __func__, ch->pdu_seq); 913 913 914 914 ctcmpc_chx_rxidle(ch->fsm, CTC_EVENT_START, ch); 915 915 /* Put the write channel in idle state */ 916 - ch = priv->channel[WRITE]; 916 + ch = priv->channel[CTCM_WRITE]; 917 917 if (ch->collect_len > 0) { 918 918 spin_lock(&ch->collect_lock); 919 919 ctcm_purge_skb_queue(&ch->collect_queue); ··· 960 960 "%s: %i / Grp:%s total_channels=%i, active_channels: " 961 961 "read=%i, write=%i\n", __func__, action, 962 962 fsm_getstate_str(grp->fsm), grp->num_channel_paths, 963 - grp->active_channels[READ], grp->active_channels[WRITE]); 963 + grp->active_channels[CTCM_READ], 964 + grp->active_channels[CTCM_WRITE]); 964 965 965 966 if ((action == MPC_CHANNEL_ADD) && (ch->in_mpcgroup == 0)) { 966 967 grp->num_channel_paths++; ··· 995 994 grp->xid_skb->data, 996 995 grp->xid_skb->len); 997 996 998 - ch->xid->xid2_dlc_type = ((CHANNEL_DIRECTION(ch->flags) == READ) 997 + ch->xid->xid2_dlc_type = 998 + ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) 999 999 ? XID2_READ_SIDE : XID2_WRITE_SIDE); 1000 1000 1001 - if (CHANNEL_DIRECTION(ch->flags) == WRITE) 1001 + if (CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) 1002 1002 ch->xid->xid2_buf_len = 0x00; 1003 1003 1004 1004 ch->xid_skb->data = ch->xid_skb_data; ··· 1008 1006 1009 1007 fsm_newstate(ch->fsm, CH_XID0_PENDING); 1010 1008 1011 - if ((grp->active_channels[READ] > 0) && 1012 - (grp->active_channels[WRITE] > 0) && 1009 + if ((grp->active_channels[CTCM_READ] > 0) && 1010 + (grp->active_channels[CTCM_WRITE] > 0) && 1013 1011 (fsm_getstate(grp->fsm) < MPCG_STATE_XID2INITW)) { 1014 1012 fsm_newstate(grp->fsm, MPCG_STATE_XID2INITW); 1015 1013 CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_NOTICE, ··· 1029 1027 if (grp->channels_terminating) 1030 1028 goto done; 1031 1029 1032 - if (((grp->active_channels[READ] == 0) && 1033 - (grp->active_channels[WRITE] > 0)) 1034 - || ((grp->active_channels[WRITE] == 0) && 1035 - (grp->active_channels[READ] > 0))) 1030 + if (((grp->active_channels[CTCM_READ] == 0) && 1031 + (grp->active_channels[CTCM_WRITE] > 0)) 1032 + || ((grp->active_channels[CTCM_WRITE] == 0) && 1033 + (grp->active_channels[CTCM_READ] > 0))) 1036 1034 fsm_event(grp->fsm, MPCG_EVENT_INOP, dev); 1037 1035 } 1038 1036 done: ··· 1040 1038 "exit %s: %i / Grp:%s total_channels=%i, active_channels: " 1041 1039 "read=%i, write=%i\n", __func__, action, 1042 1040 fsm_getstate_str(grp->fsm), grp->num_channel_paths, 1043 - grp->active_channels[READ], grp->active_channels[WRITE]); 1041 + grp->active_channels[CTCM_READ], 1042 + grp->active_channels[CTCM_WRITE]); 1044 1043 1045 1044 CTCM_PR_DEBUG("exit %s: ch=0x%p id=%s\n", __func__, ch, ch->id); 1046 1045 } ··· 1395 1392 (grp->port_persist == 0)) 1396 1393 fsm_deltimer(&priv->restart_timer); 1397 1394 1398 - wch = priv->channel[WRITE]; 1399 - rch = priv->channel[READ]; 1395 + wch = priv->channel[CTCM_WRITE]; 1396 + rch = priv->channel[CTCM_READ]; 1400 1397 1401 1398 switch (grp->saved_state) { 1402 1399 case MPCG_STATE_RESET: ··· 1483 1480 1484 1481 priv = dev->ml_priv; 1485 1482 grp = priv->mpcg; 1486 - wch = priv->channel[WRITE]; 1487 - rch = priv->channel[READ]; 1483 + wch = priv->channel[CTCM_WRITE]; 1484 + rch = priv->channel[CTCM_READ]; 1488 1485 1489 1486 switch (fsm_getstate(grp->fsm)) { 1490 1487 case MPCG_STATE_XID2INITW: ··· 1589 1586 CTCM_D3_DUMP((char *)xid, XID2_LENGTH); 1590 1587 1591 1588 /*the received direction should be the opposite of ours */ 1592 - if (((CHANNEL_DIRECTION(ch->flags) == READ) ? XID2_WRITE_SIDE : 1589 + if (((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? XID2_WRITE_SIDE : 1593 1590 XID2_READ_SIDE) != xid->xid2_dlc_type) { 1594 1591 rc = 2; 1595 1592 /* XID REJECTED: r/w channel pairing mismatch */ ··· 1915 1912 if (grp == NULL) 1916 1913 return; 1917 1914 1918 - for (direction = READ; direction <= WRITE; direction++) { 1915 + for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) { 1919 1916 struct channel *ch = priv->channel[direction]; 1920 1917 struct xid2 *thisxid = ch->xid; 1921 1918 ch->xid_skb->data = ch->xid_skb_data; ··· 2155 2152 return -ENOMEM; 2156 2153 } 2157 2154 2158 - *((__u32 *)skb_push(skb, 4)) = priv->channel[READ]->pdu_seq; 2159 - priv->channel[READ]->pdu_seq++; 2155 + *((__u32 *)skb_push(skb, 4)) = 2156 + priv->channel[CTCM_READ]->pdu_seq; 2157 + priv->channel[CTCM_READ]->pdu_seq++; 2160 2158 CTCM_PR_DBGDATA("ctcmpc: %s ToDCM_pdu_seq= %08x\n", 2161 - __func__, priv->channel[READ]->pdu_seq); 2159 + __func__, priv->channel[CTCM_READ]->pdu_seq); 2162 2160 2163 2161 /* receipt of CC03 resets anticipated sequence number on 2164 2162 receiving side */ 2165 - priv->channel[READ]->pdu_seq = 0x00; 2163 + priv->channel[CTCM_READ]->pdu_seq = 0x00; 2166 2164 skb_reset_mac_header(skb); 2167 2165 skb->dev = dev; 2168 2166 skb->protocol = htons(ETH_P_SNAP);
+10 -10
drivers/s390/net/ctcm_sysfs.c
··· 38 38 int bs1; 39 39 struct ctcm_priv *priv = dev_get_drvdata(dev); 40 40 41 - if (!(priv && priv->channel[READ] && 42 - (ndev = priv->channel[READ]->netdev))) { 41 + ndev = priv->channel[CTCM_READ]->netdev; 42 + if (!(priv && priv->channel[CTCM_READ] && ndev)) { 43 43 CTCM_DBF_TEXT(SETUP, CTC_DBF_ERROR, "bfnondev"); 44 44 return -ENODEV; 45 45 } ··· 55 55 (bs1 < (ndev->mtu + LL_HEADER_LENGTH + 2))) 56 56 goto einval; 57 57 58 - priv->channel[READ]->max_bufsize = bs1; 59 - priv->channel[WRITE]->max_bufsize = bs1; 58 + priv->channel[CTCM_READ]->max_bufsize = bs1; 59 + priv->channel[CTCM_WRITE]->max_bufsize = bs1; 60 60 if (!(ndev->flags & IFF_RUNNING)) 61 61 ndev->mtu = bs1 - LL_HEADER_LENGTH - 2; 62 - priv->channel[READ]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; 63 - priv->channel[WRITE]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; 62 + priv->channel[CTCM_READ]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; 63 + priv->channel[CTCM_WRITE]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; 64 64 65 65 CTCM_DBF_DEV(SETUP, ndev, buf); 66 66 return count; ··· 85 85 p += sprintf(p, " Device FSM state: %s\n", 86 86 fsm_getstate_str(priv->fsm)); 87 87 p += sprintf(p, " RX channel FSM state: %s\n", 88 - fsm_getstate_str(priv->channel[READ]->fsm)); 88 + fsm_getstate_str(priv->channel[CTCM_READ]->fsm)); 89 89 p += sprintf(p, " TX channel FSM state: %s\n", 90 - fsm_getstate_str(priv->channel[WRITE]->fsm)); 90 + fsm_getstate_str(priv->channel[CTCM_WRITE]->fsm)); 91 91 p += sprintf(p, " Max. TX buffer used: %ld\n", 92 92 priv->channel[WRITE]->prof.maxmulti); 93 93 p += sprintf(p, " Max. chained SKBs: %ld\n", ··· 102 102 priv->channel[WRITE]->prof.tx_time); 103 103 104 104 printk(KERN_INFO "Statistics for %s:\n%s", 105 - priv->channel[WRITE]->netdev->name, sbuf); 105 + priv->channel[CTCM_WRITE]->netdev->name, sbuf); 106 106 kfree(sbuf); 107 107 return; 108 108 } ··· 125 125 return -ENODEV; 126 126 /* Reset statistics */ 127 127 memset(&priv->channel[WRITE]->prof, 0, 128 - sizeof(priv->channel[WRITE]->prof)); 128 + sizeof(priv->channel[CTCM_WRITE]->prof)); 129 129 return count; 130 130 } 131 131
+1 -1
include/linux/etherdevice.h
··· 129 129 /** 130 130 * dev_hw_addr_random - Create random MAC and set device flag 131 131 * @dev: pointer to net_device structure 132 - * @addr: Pointer to a six-byte array containing the Ethernet address 132 + * @hwaddr: Pointer to a six-byte array containing the Ethernet address 133 133 * 134 134 * Generate random MAC to be used by a device and set addr_assign_type 135 135 * so the state can be read by sysfs and be used by udev.
+1 -1
include/linux/netpoll.h
··· 122 122 } 123 123 124 124 #else 125 - static inline int netpoll_rx(struct sk_buff *skb) 125 + static inline bool netpoll_rx(struct sk_buff *skb) 126 126 { 127 127 return 0; 128 128 }
+2 -2
include/net/bluetooth/l2cap.h
··· 33 33 #define L2CAP_DEFAULT_FLUSH_TO 0xffff 34 34 #define L2CAP_DEFAULT_TX_WINDOW 63 35 35 #define L2CAP_DEFAULT_MAX_TX 3 36 - #define L2CAP_DEFAULT_RETRANS_TO 1000 /* 1 second */ 36 + #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ 37 37 #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ 38 - #define L2CAP_DEFAULT_MAX_PDU_SIZE 672 38 + #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ 39 39 #define L2CAP_DEFAULT_ACK_TO 200 40 40 #define L2CAP_LOCAL_BUSY_TRIES 12 41 41
+3 -1
include/net/sock.h
··· 195 195 * @sk_priority: %SO_PRIORITY setting 196 196 * @sk_type: socket type (%SOCK_STREAM, etc) 197 197 * @sk_protocol: which protocol this socket belongs in this network family 198 - * @sk_peercred: %SO_PEERCRED setting 198 + * @sk_peer_pid: &struct pid for this socket's peer 199 + * @sk_peer_cred: %SO_PEERCRED setting 199 200 * @sk_rcvlowat: %SO_RCVLOWAT setting 200 201 * @sk_rcvtimeo: %SO_RCVTIMEO setting 201 202 * @sk_sndtimeo: %SO_SNDTIMEO setting ··· 212 211 * @sk_send_head: front of stuff to transmit 213 212 * @sk_security: used by security modules 214 213 * @sk_mark: generic packet mark 214 + * @sk_classid: this socket's cgroup classid 215 215 * @sk_write_pending: a write to stream socket waits to start 216 216 * @sk_state_change: callback to indicate change in the state of the sock 217 217 * @sk_data_ready: callback to indicate there is data to be processed
+5 -6
net/bluetooth/l2cap.c
··· 2705 2705 case L2CAP_MODE_ERTM: 2706 2706 pi->remote_tx_win = rfc.txwin_size; 2707 2707 pi->remote_max_tx = rfc.max_transmit; 2708 - if (rfc.max_pdu_size > pi->conn->mtu - 10) 2709 - rfc.max_pdu_size = le16_to_cpu(pi->conn->mtu - 10); 2708 + 2709 + if (le16_to_cpu(rfc.max_pdu_size) > pi->conn->mtu - 10) 2710 + rfc.max_pdu_size = cpu_to_le16(pi->conn->mtu - 10); 2710 2711 2711 2712 pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); 2712 2713 ··· 2724 2723 break; 2725 2724 2726 2725 case L2CAP_MODE_STREAMING: 2727 - if (rfc.max_pdu_size > pi->conn->mtu - 10) 2728 - rfc.max_pdu_size = le16_to_cpu(pi->conn->mtu - 10); 2726 + if (le16_to_cpu(rfc.max_pdu_size) > pi->conn->mtu - 10) 2727 + rfc.max_pdu_size = cpu_to_le16(pi->conn->mtu - 10); 2729 2728 2730 2729 pi->remote_mps = le16_to_cpu(rfc.max_pdu_size); 2731 2730 ··· 2807 2806 if (*result == L2CAP_CONF_SUCCESS) { 2808 2807 switch (rfc.mode) { 2809 2808 case L2CAP_MODE_ERTM: 2810 - pi->remote_tx_win = rfc.txwin_size; 2811 2809 pi->retrans_timeout = le16_to_cpu(rfc.retrans_timeout); 2812 2810 pi->monitor_timeout = le16_to_cpu(rfc.monitor_timeout); 2813 2811 pi->mps = le16_to_cpu(rfc.max_pdu_size); ··· 2862 2862 done: 2863 2863 switch (rfc.mode) { 2864 2864 case L2CAP_MODE_ERTM: 2865 - pi->remote_tx_win = rfc.txwin_size; 2866 2865 pi->retrans_timeout = le16_to_cpu(rfc.retrans_timeout); 2867 2866 pi->monitor_timeout = le16_to_cpu(rfc.monitor_timeout); 2868 2867 pi->mps = le16_to_cpu(rfc.max_pdu_size);
+1 -1
net/caif/cfpkt_skbuff.c
··· 9 9 #include <linux/hardirq.h> 10 10 #include <net/caif/cfpkt.h> 11 11 12 - #define PKT_PREFIX 16 12 + #define PKT_PREFIX 48 13 13 #define PKT_POSTFIX 2 14 14 #define PKT_LEN_WHEN_EXTENDING 128 15 15 #define PKT_ERROR(pkt, errmsg) do { \
+27 -14
net/can/bcm.c
··· 60 60 #include <net/sock.h> 61 61 #include <net/net_namespace.h> 62 62 63 + /* 64 + * To send multiple CAN frame content within TX_SETUP or to filter 65 + * CAN messages with multiplex index within RX_SETUP, the number of 66 + * different filters is limited to 256 due to the one byte index value. 67 + */ 68 + #define MAX_NFRAMES 256 69 + 63 70 /* use of last_frames[index].can_dlc */ 64 71 #define RX_RECV 0x40 /* received data for this element */ 65 72 #define RX_THR 0x80 /* element not been sent due to throttle feature */ ··· 96 89 struct list_head list; 97 90 int ifindex; 98 91 canid_t can_id; 99 - int flags; 92 + u32 flags; 100 93 unsigned long frames_abs, frames_filtered; 101 94 struct timeval ival1, ival2; 102 95 struct hrtimer timer, thrtimer; 103 96 struct tasklet_struct tsklet, thrtsklet; 104 97 ktime_t rx_stamp, kt_ival1, kt_ival2, kt_lastmsg; 105 98 int rx_ifindex; 106 - int count; 107 - int nframes; 108 - int currframe; 99 + u32 count; 100 + u32 nframes; 101 + u32 currframe; 109 102 struct can_frame *frames; 110 103 struct can_frame *last_frames; 111 104 struct can_frame sframe; ··· 182 175 183 176 seq_printf(m, "rx_op: %03X %-5s ", 184 177 op->can_id, bcm_proc_getifname(ifname, op->ifindex)); 185 - seq_printf(m, "[%d]%c ", op->nframes, 178 + seq_printf(m, "[%u]%c ", op->nframes, 186 179 (op->flags & RX_CHECK_DLC)?'d':' '); 187 180 if (op->kt_ival1.tv64) 188 181 seq_printf(m, "timeo=%lld ", ··· 205 198 206 199 list_for_each_entry(op, &bo->tx_ops, list) { 207 200 208 - seq_printf(m, "tx_op: %03X %s [%d] ", 201 + seq_printf(m, "tx_op: %03X %s [%u] ", 209 202 op->can_id, 210 203 bcm_proc_getifname(ifname, op->ifindex), 211 204 op->nframes); ··· 290 283 struct can_frame *firstframe; 291 284 struct sockaddr_can *addr; 292 285 struct sock *sk = op->sk; 293 - int datalen = head->nframes * CFSIZ; 286 + unsigned int datalen = head->nframes * CFSIZ; 294 287 int err; 295 288 296 289 skb = alloc_skb(sizeof(*head) + datalen, gfp_any()); ··· 475 468 * bcm_rx_cmp_to_index - (bit)compares the currently received data to formerly 476 469 * received data stored in op->last_frames[] 477 470 */ 478 - static void bcm_rx_cmp_to_index(struct bcm_op *op, int index, 471 + static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, 479 472 const struct can_frame *rxdata) 480 473 { 481 474 /* ··· 561 554 /* 562 555 * bcm_rx_do_flush - helper for bcm_rx_thr_flush 563 556 */ 564 - static inline int bcm_rx_do_flush(struct bcm_op *op, int update, int index) 557 + static inline int bcm_rx_do_flush(struct bcm_op *op, int update, 558 + unsigned int index) 565 559 { 566 560 if ((op->last_frames) && (op->last_frames[index].can_dlc & RX_THR)) { 567 561 if (update) ··· 583 575 int updated = 0; 584 576 585 577 if (op->nframes > 1) { 586 - int i; 578 + unsigned int i; 587 579 588 580 /* for MUX filter we start at index 1 */ 589 581 for (i = 1; i < op->nframes; i++) ··· 632 624 { 633 625 struct bcm_op *op = (struct bcm_op *)data; 634 626 const struct can_frame *rxframe = (struct can_frame *)skb->data; 635 - int i; 627 + unsigned int i; 636 628 637 629 /* disable timeout */ 638 630 hrtimer_cancel(&op->timer); ··· 830 822 { 831 823 struct bcm_sock *bo = bcm_sk(sk); 832 824 struct bcm_op *op; 833 - int i, err; 825 + unsigned int i; 826 + int err; 834 827 835 828 /* we need a real device to send frames */ 836 829 if (!ifindex) 837 830 return -ENODEV; 838 831 839 - /* we need at least one can_frame */ 840 - if (msg_head->nframes < 1) 832 + /* check nframes boundaries - we need at least one can_frame */ 833 + if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES) 841 834 return -EINVAL; 842 835 843 836 /* check the given can_id */ ··· 1001 992 /* ignore trailing garbage */ 1002 993 msg_head->nframes = 0; 1003 994 } 995 + 996 + /* the first element contains the mux-mask => MAX_NFRAMES + 1 */ 997 + if (msg_head->nframes > MAX_NFRAMES + 1) 998 + return -EINVAL; 1004 999 1005 1000 if ((msg_head->flags & RX_RTR_FRAME) && 1006 1001 ((msg_head->nframes != 1) ||
+1 -1
net/dsa/Kconfig
··· 1 1 menuconfig NET_DSA 2 2 bool "Distributed Switch Architecture support" 3 3 default n 4 - depends on EXPERIMENTAL && NET_ETHERNET && !S390 4 + depends on EXPERIMENTAL && NETDEVICES && !S390 5 5 select PHYLIB 6 6 ---help--- 7 7 This allows you to use hardware switch chips that use
+17 -5
net/sched/sch_api.c
··· 150 150 if (qops->enqueue == NULL) 151 151 qops->enqueue = noop_qdisc_ops.enqueue; 152 152 if (qops->peek == NULL) { 153 - if (qops->dequeue == NULL) { 153 + if (qops->dequeue == NULL) 154 154 qops->peek = noop_qdisc_ops.peek; 155 - } else { 156 - rc = -EINVAL; 157 - goto out; 158 - } 155 + else 156 + goto out_einval; 159 157 } 160 158 if (qops->dequeue == NULL) 161 159 qops->dequeue = noop_qdisc_ops.dequeue; 160 + 161 + if (qops->cl_ops) { 162 + const struct Qdisc_class_ops *cops = qops->cl_ops; 163 + 164 + if (!(cops->get && cops->put && cops->walk && cops->leaf)) 165 + goto out_einval; 166 + 167 + if (cops->tcf_chain && !(cops->bind_tcf && cops->unbind_tcf)) 168 + goto out_einval; 169 + } 162 170 163 171 qops->next = NULL; 164 172 *qp = qops; ··· 174 166 out: 175 167 write_unlock(&qdisc_mod_lock); 176 168 return rc; 169 + 170 + out_einval: 171 + rc = -EINVAL; 172 + goto out; 177 173 } 178 174 EXPORT_SYMBOL(register_qdisc); 179 175
+2 -2
net/sched/sch_atm.c
··· 418 418 } 419 419 420 420 ret = qdisc_enqueue(skb, flow->q); 421 - if (ret != 0) { 421 + if (ret != NET_XMIT_SUCCESS) { 422 422 drop: __maybe_unused 423 423 if (net_xmit_drop_count(ret)) { 424 424 sch->qstats.drops++; ··· 442 442 */ 443 443 if (flow == &p->link) { 444 444 sch->q.qlen++; 445 - return 0; 445 + return NET_XMIT_SUCCESS; 446 446 } 447 447 tasklet_schedule(&p->task); 448 448 return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
+13 -1
net/sched/sch_sfq.c
··· 334 334 if (++sch->q.qlen <= q->limit) { 335 335 sch->bstats.bytes += qdisc_pkt_len(skb); 336 336 sch->bstats.packets++; 337 - return 0; 337 + return NET_XMIT_SUCCESS; 338 338 } 339 339 340 340 sfq_drop(sch); ··· 508 508 return -1; 509 509 } 510 510 511 + static struct Qdisc *sfq_leaf(struct Qdisc *sch, unsigned long arg) 512 + { 513 + return NULL; 514 + } 515 + 511 516 static unsigned long sfq_get(struct Qdisc *sch, u32 classid) 512 517 { 513 518 return 0; ··· 522 517 u32 classid) 523 518 { 524 519 return 0; 520 + } 521 + 522 + static void sfq_put(struct Qdisc *q, unsigned long cl) 523 + { 525 524 } 526 525 527 526 static struct tcf_proto **sfq_find_tcf(struct Qdisc *sch, unsigned long cl) ··· 580 571 } 581 572 582 573 static const struct Qdisc_class_ops sfq_class_ops = { 574 + .leaf = sfq_leaf, 583 575 .get = sfq_get, 576 + .put = sfq_put, 584 577 .tcf_chain = sfq_find_tcf, 585 578 .bind_tcf = sfq_bind, 579 + .unbind_tcf = sfq_put, 586 580 .dump = sfq_dump_class, 587 581 .dump_stats = sfq_dump_class_stats, 588 582 .walk = sfq_walk,
+2 -2
net/sched/sch_tbf.c
··· 127 127 return qdisc_reshape_fail(skb, sch); 128 128 129 129 ret = qdisc_enqueue(skb, q->qdisc); 130 - if (ret != 0) { 130 + if (ret != NET_XMIT_SUCCESS) { 131 131 if (net_xmit_drop_count(ret)) 132 132 sch->qstats.drops++; 133 133 return ret; ··· 136 136 sch->q.qlen++; 137 137 sch->bstats.bytes += qdisc_pkt_len(skb); 138 138 sch->bstats.packets++; 139 - return 0; 139 + return NET_XMIT_SUCCESS; 140 140 } 141 141 142 142 static unsigned int tbf_drop(struct Qdisc* sch)
+1 -1
net/sched/sch_teql.c
··· 85 85 __skb_queue_tail(&q->q, skb); 86 86 sch->bstats.bytes += qdisc_pkt_len(skb); 87 87 sch->bstats.packets++; 88 - return 0; 88 + return NET_XMIT_SUCCESS; 89 89 } 90 90 91 91 kfree_skb(skb);
+7 -1
net/wireless/mlme.c
··· 843 843 return -EINVAL; 844 844 if (mgmt->u.action.category != WLAN_CATEGORY_PUBLIC) { 845 845 /* Verify that we are associated with the destination AP */ 846 + wdev_lock(wdev); 847 + 846 848 if (!wdev->current_bss || 847 849 memcmp(wdev->current_bss->pub.bssid, mgmt->bssid, 848 850 ETH_ALEN) != 0 || 849 851 (wdev->iftype == NL80211_IFTYPE_STATION && 850 852 memcmp(wdev->current_bss->pub.bssid, mgmt->da, 851 - ETH_ALEN) != 0)) 853 + ETH_ALEN) != 0)) { 854 + wdev_unlock(wdev); 852 855 return -ENOTCONN; 856 + } 857 + 858 + wdev_unlock(wdev); 853 859 } 854 860 855 861 if (memcmp(mgmt->sa, dev->dev_addr, ETH_ALEN) != 0)