aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-18 12:43:08 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-18 12:43:08 -0400
commitf1b0c8d3d3b5ff9c0b14bb2383a4bc38d8922bd1 (patch)
treeb7d9f439d5b99d8b03bf490d4b17156414e48d45 /drivers/net
parentd591b0a3ae25f587d0c4da1e1d1a425143590790 (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'linus' into x86/amd-iommu
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c59x.c5
-rw-r--r--drivers/net/Kconfig3
-rw-r--r--drivers/net/Makefile1
-rw-r--r--drivers/net/arm/etherh.c2
-rw-r--r--drivers/net/cxgb3/common.h5
-rw-r--r--drivers/net/cxgb3/cxgb3_ctl_defs.h1
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c7
-rw-r--r--drivers/net/cxgb3/t3_hw.c7
-rw-r--r--drivers/net/cxgb3/version.h2
-rw-r--r--drivers/net/e100.c2
-rw-r--r--drivers/net/e1000/e1000_ethtool.c2
-rw-r--r--drivers/net/e1000e/netdev.c3
-rw-r--r--drivers/net/ehea/ehea.h8
-rw-r--r--drivers/net/ehea/ehea_main.c42
-rw-r--r--drivers/net/fec_8xx/Kconfig20
-rw-r--r--drivers/net/fec_8xx/Makefile12
-rw-r--r--drivers/net/fec_8xx/fec_8xx-netta.c151
-rw-r--r--drivers/net/fec_8xx/fec_8xx.h220
-rw-r--r--drivers/net/fec_8xx/fec_main.c1264
-rw-r--r--drivers/net/fec_8xx/fec_mii.c418
-rw-r--r--drivers/net/forcedeth.c15
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c2
-rw-r--r--drivers/net/fs_enet/mac-fcc.c3
-rw-r--r--drivers/net/fs_enet/mac-scc.c2
-rw-r--r--drivers/net/fs_enet/mii-fec.c2
-rw-r--r--drivers/net/hamradio/dmascc.c2
-rw-r--r--drivers/net/ibm_newemac/core.c69
-rw-r--r--drivers/net/ibm_newemac/core.h85
-rw-r--r--drivers/net/ibm_newemac/debug.c52
-rw-r--r--drivers/net/ibm_newemac/emac.h101
-rw-r--r--drivers/net/ibm_newemac/rgmii.c6
-rw-r--r--drivers/net/igb/igb_main.c3
-rw-r--r--drivers/net/ipg.c16
-rw-r--r--drivers/net/irda/irda-usb.c12
-rw-r--r--drivers/net/irda/nsc-ircc.c1
-rw-r--r--drivers/net/irda/pxaficp_ir.c24
-rw-r--r--drivers/net/irda/via-ircc.c3
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c3
-rw-r--r--drivers/net/macb.c37
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--drivers/net/mlx4/fw.c28
-rw-r--r--drivers/net/mlx4/fw.h6
-rw-r--r--drivers/net/mlx4/main.c7
-rw-r--r--drivers/net/mlx4/mcg.c17
-rw-r--r--drivers/net/myri10ge/myri10ge.c11
-rw-r--r--drivers/net/netconsole.c10
-rw-r--r--drivers/net/netxen/netxen_nic_main.c18
-rw-r--r--drivers/net/pasemi_mac.c2
-rw-r--r--drivers/net/pcmcia/axnet_cs.c2
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c3
-rw-r--r--drivers/net/ppp_generic.c2
-rw-r--r--drivers/net/qla3xxx.c2
-rw-r--r--drivers/net/r6040.c2
-rw-r--r--drivers/net/s2io.c35
-rw-r--r--drivers/net/s2io.h4
-rw-r--r--drivers/net/tc35815.c4
-rw-r--r--drivers/net/tokenring/smctr.c56
-rw-r--r--drivers/net/tokenring/smctr.h2
-rw-r--r--drivers/net/tokenring/smctr_firmware.h978
-rw-r--r--drivers/net/tun.c19
-rw-r--r--drivers/net/ucc_geth.c2
-rw-r--r--drivers/net/ucc_geth_mii.c2
-rw-r--r--drivers/net/usb/kaweth.c43
-rw-r--r--drivers/net/usb/kawethfw.h557
-rw-r--r--drivers/net/wan/cosa.c22
-rw-r--r--drivers/net/wan/hdlc_fr.c1
-rw-r--r--drivers/net/wan/x25_asy.c3
-rw-r--r--drivers/net/wireless/atmel.c6
-rw-r--r--drivers/net/wireless/b43/leds.c3
-rw-r--r--drivers/net/wireless/b43/main.c12
-rw-r--r--drivers/net/wireless/b43legacy/dma.c2
-rw-r--r--drivers/net/wireless/b43legacy/main.c6
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c8
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c2
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c20
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c10
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c36
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c42
-rw-r--r--drivers/net/wireless/libertas/if_cs.c2
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c24
-rw-r--r--drivers/net/wireless/libertas/if_usb.c5
-rw-r--r--drivers/net/wireless/libertas/scan.c4
-rw-r--r--drivers/net/wireless/p54/p54usb.c5
-rw-r--r--drivers/net/wireless/prism54/islpci_eth.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c43
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h5
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c38
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c51
-rw-r--r--drivers/net/wireless/zd1201.c2
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c1
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c1
-rw-r--r--drivers/net/xen-netfront.c4
100 files changed, 833 insertions, 4016 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 2edda8cc7f99..aabad8ce7458 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -1768,9 +1768,10 @@ vortex_timer(unsigned long data)
1768 case XCVR_MII: case XCVR_NWAY: 1768 case XCVR_MII: case XCVR_NWAY:
1769 { 1769 {
1770 ok = 1; 1770 ok = 1;
1771 spin_lock_bh(&vp->lock); 1771 /* Interrupts are already disabled */
1772 spin_lock(&vp->lock);
1772 vortex_check_media(dev, 0); 1773 vortex_check_media(dev, 0);
1773 spin_unlock_bh(&vp->lock); 1774 spin_unlock(&vp->lock);
1774 } 1775 }
1775 break; 1776 break;
1776 default: /* Other media types handled by Tx timeouts. */ 1777 default: /* Other media types handled by Tx timeouts. */
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index f4182cfffe9d..2683ee32fc11 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -217,7 +217,7 @@ config MII
217 217
218config MACB 218config MACB
219 tristate "Atmel MACB support" 219 tristate "Atmel MACB support"
220 depends on AVR32 || ARCH_AT91SAM9260 || ARCH_AT91SAM9263 || ARCH_AT91CAP9 220 depends on AVR32 || ARCH_AT91SAM9260 || ARCH_AT91SAM9263 || ARCH_AT91SAM9G20 || ARCH_AT91CAP9
221 select PHYLIB 221 select PHYLIB
222 help 222 help
223 The Atmel MACB ethernet interface is found on many AT32 and AT91 223 The Atmel MACB ethernet interface is found on many AT32 and AT91
@@ -1884,7 +1884,6 @@ config NE_H8300
1884 Say Y here if you want to use the NE2000 compatible 1884 Say Y here if you want to use the NE2000 compatible
1885 controller on the Renesas H8/300 processor. 1885 controller on the Renesas H8/300 processor.
1886 1886
1887source "drivers/net/fec_8xx/Kconfig"
1888source "drivers/net/fs_enet/Kconfig" 1887source "drivers/net/fs_enet/Kconfig"
1889 1888
1890endif # NET_ETHERNET 1889endif # NET_ETHERNET
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index dcbfe8421154..9010e58da0f2 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -217,7 +217,6 @@ obj-$(CONFIG_SMC91X) += smc91x.o
217obj-$(CONFIG_SMC911X) += smc911x.o 217obj-$(CONFIG_SMC911X) += smc911x.o
218obj-$(CONFIG_BFIN_MAC) += bfin_mac.o 218obj-$(CONFIG_BFIN_MAC) += bfin_mac.o
219obj-$(CONFIG_DM9000) += dm9000.o 219obj-$(CONFIG_DM9000) += dm9000.o
220obj-$(CONFIG_FEC_8XX) += fec_8xx/
221obj-$(CONFIG_PASEMI_MAC) += pasemi_mac_driver.o 220obj-$(CONFIG_PASEMI_MAC) += pasemi_mac_driver.o
222pasemi_mac_driver-objs := pasemi_mac.o pasemi_mac_ethtool.o 221pasemi_mac_driver-objs := pasemi_mac.o pasemi_mac_ethtool.o
223obj-$(CONFIG_MLX4_CORE) += mlx4/ 222obj-$(CONFIG_MLX4_CORE) += mlx4/
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c
index 00081d2b9cd5..e9d15eccad08 100644
--- a/drivers/net/arm/etherh.c
+++ b/drivers/net/arm/etherh.c
@@ -647,7 +647,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
647 struct ei_device *ei_local; 647 struct ei_device *ei_local;
648 struct net_device *dev; 648 struct net_device *dev;
649 struct etherh_priv *eh; 649 struct etherh_priv *eh;
650 int i, ret; 650 int ret;
651 DECLARE_MAC_BUF(mac); 651 DECLARE_MAC_BUF(mac);
652 652
653 etherh_banner(); 653 etherh_banner();
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index 579bee42a5cb..8e8ebd788537 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -686,8 +686,9 @@ int t3_seeprom_write(struct adapter *adapter, u32 addr, __le32 data);
686int t3_seeprom_wp(struct adapter *adapter, int enable); 686int t3_seeprom_wp(struct adapter *adapter, int enable);
687int t3_get_tp_version(struct adapter *adapter, u32 *vers); 687int t3_get_tp_version(struct adapter *adapter, u32 *vers);
688int t3_check_tpsram_version(struct adapter *adapter, int *must_load); 688int t3_check_tpsram_version(struct adapter *adapter, int *must_load);
689int t3_check_tpsram(struct adapter *adapter, u8 *tp_ram, unsigned int size); 689int t3_check_tpsram(struct adapter *adapter, const u8 *tp_ram,
690int t3_set_proto_sram(struct adapter *adap, u8 *data); 690 unsigned int size);
691int t3_set_proto_sram(struct adapter *adap, const u8 *data);
691int t3_read_flash(struct adapter *adapter, unsigned int addr, 692int t3_read_flash(struct adapter *adapter, unsigned int addr,
692 unsigned int nwords, u32 *data, int byte_oriented); 693 unsigned int nwords, u32 *data, int byte_oriented);
693int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size); 694int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size);
diff --git a/drivers/net/cxgb3/cxgb3_ctl_defs.h b/drivers/net/cxgb3/cxgb3_ctl_defs.h
index 6c4f32066919..ed0ecd9679cb 100644
--- a/drivers/net/cxgb3/cxgb3_ctl_defs.h
+++ b/drivers/net/cxgb3/cxgb3_ctl_defs.h
@@ -54,6 +54,7 @@ enum {
54 RDMA_CQ_DISABLE = 16, 54 RDMA_CQ_DISABLE = 16,
55 RDMA_CTRL_QP_SETUP = 17, 55 RDMA_CTRL_QP_SETUP = 17,
56 RDMA_GET_MEM = 18, 56 RDMA_GET_MEM = 18,
57 RDMA_GET_MIB = 19,
57 58
58 GET_RX_PAGE_INFO = 50, 59 GET_RX_PAGE_INFO = 50,
59}; 60};
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index ff9c013ce535..cf2696873796 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -303,6 +303,12 @@ static int cxgb_rdma_ctl(struct adapter *adapter, unsigned int req, void *data)
303 spin_unlock_irq(&adapter->sge.reg_lock); 303 spin_unlock_irq(&adapter->sge.reg_lock);
304 break; 304 break;
305 } 305 }
306 case RDMA_GET_MIB: {
307 spin_lock(&adapter->stats_lock);
308 t3_tp_get_mib_stats(adapter, (struct tp_mib_stats *)data);
309 spin_unlock(&adapter->stats_lock);
310 break;
311 }
306 default: 312 default:
307 ret = -EOPNOTSUPP; 313 ret = -EOPNOTSUPP;
308 } 314 }
@@ -381,6 +387,7 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
381 case RDMA_CQ_DISABLE: 387 case RDMA_CQ_DISABLE:
382 case RDMA_CTRL_QP_SETUP: 388 case RDMA_CTRL_QP_SETUP:
383 case RDMA_GET_MEM: 389 case RDMA_GET_MEM:
390 case RDMA_GET_MIB:
384 if (!offload_running(adapter)) 391 if (!offload_running(adapter))
385 return -EAGAIN; 392 return -EAGAIN;
386 return cxgb_rdma_ctl(adapter, req, data); 393 return cxgb_rdma_ctl(adapter, req, data);
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index d405a932c73a..47d51788a462 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -923,7 +923,8 @@ int t3_check_tpsram_version(struct adapter *adapter, int *must_load)
923 * Checks if an adapter's tp sram is compatible with the driver. 923 * Checks if an adapter's tp sram is compatible with the driver.
924 * Returns 0 if the versions are compatible, a negative error otherwise. 924 * Returns 0 if the versions are compatible, a negative error otherwise.
925 */ 925 */
926int t3_check_tpsram(struct adapter *adapter, u8 *tp_sram, unsigned int size) 926int t3_check_tpsram(struct adapter *adapter, const u8 *tp_sram,
927 unsigned int size)
927{ 928{
928 u32 csum; 929 u32 csum;
929 unsigned int i; 930 unsigned int i;
@@ -2875,10 +2876,10 @@ static void ulp_config(struct adapter *adap, const struct tp_params *p)
2875 * 2876 *
2876 * Write the contents of the protocol SRAM. 2877 * Write the contents of the protocol SRAM.
2877 */ 2878 */
2878int t3_set_proto_sram(struct adapter *adap, u8 *data) 2879int t3_set_proto_sram(struct adapter *adap, const u8 *data)
2879{ 2880{
2880 int i; 2881 int i;
2881 __be32 *buf = (__be32 *)data; 2882 const __be32 *buf = (const __be32 *)data;
2882 2883
2883 for (i = 0; i < PROTO_SRAM_LINES; i++) { 2884 for (i = 0; i < PROTO_SRAM_LINES; i++) {
2884 t3_write_reg(adap, A_TP_EMBED_OP_FIELD5, be32_to_cpu(*buf++)); 2885 t3_write_reg(adap, A_TP_EMBED_OP_FIELD5, be32_to_cpu(*buf++));
diff --git a/drivers/net/cxgb3/version.h b/drivers/net/cxgb3/version.h
index a0177fc55e28..29db711303b9 100644
--- a/drivers/net/cxgb3/version.h
+++ b/drivers/net/cxgb3/version.h
@@ -38,7 +38,7 @@
38#define DRV_VERSION "1.0-ko" 38#define DRV_VERSION "1.0-ko"
39 39
40/* Firmware version */ 40/* Firmware version */
41#define FW_VERSION_MAJOR 6 41#define FW_VERSION_MAJOR 7
42#define FW_VERSION_MINOR 0 42#define FW_VERSION_MINOR 0
43#define FW_VERSION_MICRO 0 43#define FW_VERSION_MICRO 0
44#endif /* __CHELSIO_VERSION_H */ 44#endif /* __CHELSIO_VERSION_H */
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index f3cba5e24ec5..1037b1332312 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1803,6 +1803,8 @@ static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
1803 if (rx->prev->skb) { 1803 if (rx->prev->skb) {
1804 struct rfd *prev_rfd = (struct rfd *)rx->prev->skb->data; 1804 struct rfd *prev_rfd = (struct rfd *)rx->prev->skb->data;
1805 put_unaligned_le32(rx->dma_addr, &prev_rfd->link); 1805 put_unaligned_le32(rx->dma_addr, &prev_rfd->link);
1806 pci_dma_sync_single_for_device(nic->pdev, rx->prev->dma_addr,
1807 sizeof(struct rfd), PCI_DMA_TODEVICE);
1806 } 1808 }
1807 1809
1808 return 0; 1810 return 0;
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 701531e72e7b..a3f6a9c72ec8 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -347,7 +347,7 @@ e1000_set_tso(struct net_device *netdev, u32 data)
347 else 347 else
348 netdev->features &= ~NETIF_F_TSO; 348 netdev->features &= ~NETIF_F_TSO;
349 349
350 if (data) 350 if (data && (adapter->hw.mac_type > e1000_82547_rev_2))
351 netdev->features |= NETIF_F_TSO6; 351 netdev->features |= NETIF_F_TSO6;
352 else 352 else
353 netdev->features &= ~NETIF_F_TSO6; 353 netdev->features &= ~NETIF_F_TSO6;
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index cab1835173cd..648a87bbf467 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2535,7 +2535,8 @@ void e1000e_down(struct e1000_adapter *adapter)
2535 adapter->link_speed = 0; 2535 adapter->link_speed = 0;
2536 adapter->link_duplex = 0; 2536 adapter->link_duplex = 0;
2537 2537
2538 e1000e_reset(adapter); 2538 if (!pci_channel_offline(adapter->pdev))
2539 e1000e_reset(adapter);
2539 e1000_clean_tx_ring(adapter); 2540 e1000_clean_tx_ring(adapter);
2540 e1000_clean_rx_ring(adapter); 2541 e1000_clean_rx_ring(adapter);
2541 2542
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index fe872fbd671e..e01926b7b5b7 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -40,7 +40,7 @@
40#include <asm/io.h> 40#include <asm/io.h>
41 41
42#define DRV_NAME "ehea" 42#define DRV_NAME "ehea"
43#define DRV_VERSION "EHEA_0091" 43#define DRV_VERSION "EHEA_0092"
44 44
45/* eHEA capability flags */ 45/* eHEA capability flags */
46#define DLPAR_PORT_ADD_REM 1 46#define DLPAR_PORT_ADD_REM 1
@@ -452,7 +452,7 @@ struct ehea_bcmc_reg_entry {
452struct ehea_bcmc_reg_array { 452struct ehea_bcmc_reg_array {
453 struct ehea_bcmc_reg_entry *arr; 453 struct ehea_bcmc_reg_entry *arr;
454 int num_entries; 454 int num_entries;
455 struct mutex lock; 455 spinlock_t lock;
456}; 456};
457 457
458#define EHEA_PORT_UP 1 458#define EHEA_PORT_UP 1
@@ -478,6 +478,7 @@ struct ehea_port {
478 int num_add_tx_qps; 478 int num_add_tx_qps;
479 int num_mcs; 479 int num_mcs;
480 int resets; 480 int resets;
481 u64 flags;
481 u64 mac_addr; 482 u64 mac_addr;
482 u32 logical_port_id; 483 u32 logical_port_id;
483 u32 port_speed; 484 u32 port_speed;
@@ -501,7 +502,8 @@ struct port_res_cfg {
501}; 502};
502 503
503enum ehea_flag_bits { 504enum ehea_flag_bits {
504 __EHEA_STOP_XFER 505 __EHEA_STOP_XFER,
506 __EHEA_DISABLE_PORT_RESET
505}; 507};
506 508
507void ehea_set_ethtool_ops(struct net_device *netdev); 509void ehea_set_ethtool_ops(struct net_device *netdev);
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 075fd547421e..0920b796bd78 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -118,6 +118,7 @@ static struct of_device_id ehea_device_table[] = {
118 }, 118 },
119 {}, 119 {},
120}; 120};
121MODULE_DEVICE_TABLE(of, ehea_device_table);
121 122
122static struct of_platform_driver ehea_driver = { 123static struct of_platform_driver ehea_driver = {
123 .name = "ehea", 124 .name = "ehea",
@@ -137,6 +138,12 @@ void ehea_dump(void *adr, int len, char *msg)
137 } 138 }
138} 139}
139 140
141void ehea_schedule_port_reset(struct ehea_port *port)
142{
143 if (!test_bit(__EHEA_DISABLE_PORT_RESET, &port->flags))
144 schedule_work(&port->reset_task);
145}
146
140static void ehea_update_firmware_handles(void) 147static void ehea_update_firmware_handles(void)
141{ 148{
142 struct ehea_fw_handle_entry *arr = NULL; 149 struct ehea_fw_handle_entry *arr = NULL;
@@ -241,7 +248,7 @@ static void ehea_update_bcmc_registrations(void)
241 } 248 }
242 249
243 if (num_registrations) { 250 if (num_registrations) {
244 arr = kzalloc(num_registrations * sizeof(*arr), GFP_KERNEL); 251 arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC);
245 if (!arr) 252 if (!arr)
246 return; /* Keep the existing array */ 253 return; /* Keep the existing array */
247 } else 254 } else
@@ -301,7 +308,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)
301 308
302 memset(stats, 0, sizeof(*stats)); 309 memset(stats, 0, sizeof(*stats));
303 310
304 cb2 = kzalloc(PAGE_SIZE, GFP_KERNEL); 311 cb2 = kzalloc(PAGE_SIZE, GFP_ATOMIC);
305 if (!cb2) { 312 if (!cb2) {
306 ehea_error("no mem for cb2"); 313 ehea_error("no mem for cb2");
307 goto out; 314 goto out;
@@ -587,7 +594,7 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq,
587 "Resetting port.", pr->qp->init_attr.qp_nr); 594 "Resetting port.", pr->qp->init_attr.qp_nr);
588 ehea_dump(cqe, sizeof(*cqe), "CQE"); 595 ehea_dump(cqe, sizeof(*cqe), "CQE");
589 } 596 }
590 schedule_work(&pr->port->reset_task); 597 ehea_schedule_port_reset(pr->port);
591 return 1; 598 return 1;
592 } 599 }
593 600
@@ -616,7 +623,7 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
616 *tcph = tcp_hdr(skb); 623 *tcph = tcp_hdr(skb);
617 624
618 /* check if ip header and tcp header are complete */ 625 /* check if ip header and tcp header are complete */
619 if (iph->tot_len < ip_len + tcp_hdrlen(skb)) 626 if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb))
620 return -1; 627 return -1;
621 628
622 *hdr_flags = LRO_IPV4 | LRO_TCP; 629 *hdr_flags = LRO_IPV4 | LRO_TCP;
@@ -765,7 +772,7 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
765 ehea_error("Send Completion Error: Resetting port"); 772 ehea_error("Send Completion Error: Resetting port");
766 if (netif_msg_tx_err(pr->port)) 773 if (netif_msg_tx_err(pr->port))
767 ehea_dump(cqe, sizeof(*cqe), "Send CQE"); 774 ehea_dump(cqe, sizeof(*cqe), "Send CQE");
768 schedule_work(&pr->port->reset_task); 775 ehea_schedule_port_reset(pr->port);
769 break; 776 break;
770 } 777 }
771 778
@@ -885,7 +892,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
885 eqe = ehea_poll_eq(port->qp_eq); 892 eqe = ehea_poll_eq(port->qp_eq);
886 } 893 }
887 894
888 schedule_work(&port->reset_task); 895 ehea_schedule_port_reset(port);
889 896
890 return IRQ_HANDLED; 897 return IRQ_HANDLED;
891} 898}
@@ -1763,7 +1770,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
1763 1770
1764 memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len); 1771 memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len);
1765 1772
1766 mutex_lock(&ehea_bcmc_regs.lock); 1773 spin_lock(&ehea_bcmc_regs.lock);
1767 1774
1768 /* Deregister old MAC in pHYP */ 1775 /* Deregister old MAC in pHYP */
1769 if (port->state == EHEA_PORT_UP) { 1776 if (port->state == EHEA_PORT_UP) {
@@ -1785,7 +1792,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
1785 1792
1786out_upregs: 1793out_upregs:
1787 ehea_update_bcmc_registrations(); 1794 ehea_update_bcmc_registrations();
1788 mutex_unlock(&ehea_bcmc_regs.lock); 1795 spin_unlock(&ehea_bcmc_regs.lock);
1789out_free: 1796out_free:
1790 kfree(cb0); 1797 kfree(cb0);
1791out: 1798out:
@@ -1947,7 +1954,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
1947 } 1954 }
1948 ehea_promiscuous(dev, 0); 1955 ehea_promiscuous(dev, 0);
1949 1956
1950 mutex_lock(&ehea_bcmc_regs.lock); 1957 spin_lock(&ehea_bcmc_regs.lock);
1951 1958
1952 if (dev->flags & IFF_ALLMULTI) { 1959 if (dev->flags & IFF_ALLMULTI) {
1953 ehea_allmulti(dev, 1); 1960 ehea_allmulti(dev, 1);
@@ -1978,7 +1985,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
1978 } 1985 }
1979out: 1986out:
1980 ehea_update_bcmc_registrations(); 1987 ehea_update_bcmc_registrations();
1981 mutex_unlock(&ehea_bcmc_regs.lock); 1988 spin_unlock(&ehea_bcmc_regs.lock);
1982 return; 1989 return;
1983} 1990}
1984 1991
@@ -2497,7 +2504,7 @@ static int ehea_up(struct net_device *dev)
2497 } 2504 }
2498 } 2505 }
2499 2506
2500 mutex_lock(&ehea_bcmc_regs.lock); 2507 spin_lock(&ehea_bcmc_regs.lock);
2501 2508
2502 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC); 2509 ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
2503 if (ret) { 2510 if (ret) {
@@ -2520,7 +2527,7 @@ out:
2520 ehea_info("Failed starting %s. ret=%i", dev->name, ret); 2527 ehea_info("Failed starting %s. ret=%i", dev->name, ret);
2521 2528
2522 ehea_update_bcmc_registrations(); 2529 ehea_update_bcmc_registrations();
2523 mutex_unlock(&ehea_bcmc_regs.lock); 2530 spin_unlock(&ehea_bcmc_regs.lock);
2524 2531
2525 ehea_update_firmware_handles(); 2532 ehea_update_firmware_handles();
2526 mutex_unlock(&ehea_fw_handles.lock); 2533 mutex_unlock(&ehea_fw_handles.lock);
@@ -2575,7 +2582,7 @@ static int ehea_down(struct net_device *dev)
2575 2582
2576 mutex_lock(&ehea_fw_handles.lock); 2583 mutex_lock(&ehea_fw_handles.lock);
2577 2584
2578 mutex_lock(&ehea_bcmc_regs.lock); 2585 spin_lock(&ehea_bcmc_regs.lock);
2579 ehea_drop_multicast_list(dev); 2586 ehea_drop_multicast_list(dev);
2580 ehea_broadcast_reg_helper(port, H_DEREG_BCMC); 2587 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2581 2588
@@ -2584,7 +2591,7 @@ static int ehea_down(struct net_device *dev)
2584 port->state = EHEA_PORT_DOWN; 2591 port->state = EHEA_PORT_DOWN;
2585 2592
2586 ehea_update_bcmc_registrations(); 2593 ehea_update_bcmc_registrations();
2587 mutex_unlock(&ehea_bcmc_regs.lock); 2594 spin_unlock(&ehea_bcmc_regs.lock);
2588 2595
2589 ret = ehea_clean_all_portres(port); 2596 ret = ehea_clean_all_portres(port);
2590 if (ret) 2597 if (ret)
@@ -2605,13 +2612,14 @@ static int ehea_stop(struct net_device *dev)
2605 if (netif_msg_ifdown(port)) 2612 if (netif_msg_ifdown(port))
2606 ehea_info("disabling port %s", dev->name); 2613 ehea_info("disabling port %s", dev->name);
2607 2614
2615 set_bit(__EHEA_DISABLE_PORT_RESET, &port->flags);
2608 cancel_work_sync(&port->reset_task); 2616 cancel_work_sync(&port->reset_task);
2609
2610 mutex_lock(&port->port_lock); 2617 mutex_lock(&port->port_lock);
2611 netif_stop_queue(dev); 2618 netif_stop_queue(dev);
2612 port_napi_disable(port); 2619 port_napi_disable(port);
2613 ret = ehea_down(dev); 2620 ret = ehea_down(dev);
2614 mutex_unlock(&port->port_lock); 2621 mutex_unlock(&port->port_lock);
2622 clear_bit(__EHEA_DISABLE_PORT_RESET, &port->flags);
2615 return ret; 2623 return ret;
2616} 2624}
2617 2625
@@ -2941,7 +2949,7 @@ static void ehea_tx_watchdog(struct net_device *dev)
2941 2949
2942 if (netif_carrier_ok(dev) && 2950 if (netif_carrier_ok(dev) &&
2943 !test_bit(__EHEA_STOP_XFER, &ehea_driver_flags)) 2951 !test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))
2944 schedule_work(&port->reset_task); 2952 ehea_schedule_port_reset(port);
2945} 2953}
2946 2954
2947int ehea_sense_adapter_attr(struct ehea_adapter *adapter) 2955int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
@@ -3590,7 +3598,7 @@ int __init ehea_module_init(void)
3590 memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs)); 3598 memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));
3591 3599
3592 mutex_init(&ehea_fw_handles.lock); 3600 mutex_init(&ehea_fw_handles.lock);
3593 mutex_init(&ehea_bcmc_regs.lock); 3601 spin_lock_init(&ehea_bcmc_regs.lock);
3594 3602
3595 ret = check_module_parm(); 3603 ret = check_module_parm();
3596 if (ret) 3604 if (ret)
diff --git a/drivers/net/fec_8xx/Kconfig b/drivers/net/fec_8xx/Kconfig
deleted file mode 100644
index afb34ded26ee..000000000000
--- a/drivers/net/fec_8xx/Kconfig
+++ /dev/null
@@ -1,20 +0,0 @@
1config FEC_8XX
2 tristate "Motorola 8xx FEC driver"
3 depends on 8XX
4 select MII
5
6config FEC_8XX_GENERIC_PHY
7 bool "Support any generic PHY"
8 depends on FEC_8XX
9 default y
10
11config FEC_8XX_DM9161_PHY
12 bool "Support DM9161 PHY"
13 depends on FEC_8XX
14 default n
15
16config FEC_8XX_LXT971_PHY
17 bool "Support LXT971/LXT972 PHY"
18 depends on FEC_8XX
19 default n
20
diff --git a/drivers/net/fec_8xx/Makefile b/drivers/net/fec_8xx/Makefile
deleted file mode 100644
index 70c54f8c48e5..000000000000
--- a/drivers/net/fec_8xx/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
1#
2# Makefile for the Motorola 8xx FEC ethernet controller
3#
4
5obj-$(CONFIG_FEC_8XX) += fec_8xx.o
6
7fec_8xx-objs := fec_main.o fec_mii.o
8
9# the platform instantatiation objects
10ifeq ($(CONFIG_NETTA),y)
11fec_8xx-objs += fec_8xx-netta.o
12endif
diff --git a/drivers/net/fec_8xx/fec_8xx-netta.c b/drivers/net/fec_8xx/fec_8xx-netta.c
deleted file mode 100644
index 79deee222e28..000000000000
--- a/drivers/net/fec_8xx/fec_8xx-netta.c
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 * FEC instantatiation file for NETTA
3 */
4
5#include <linux/kernel.h>
6#include <linux/types.h>
7#include <linux/string.h>
8#include <linux/ptrace.h>
9#include <linux/errno.h>
10#include <linux/ioport.h>
11#include <linux/slab.h>
12#include <linux/interrupt.h>
13#include <linux/pci.h>
14#include <linux/init.h>
15#include <linux/delay.h>
16#include <linux/netdevice.h>
17#include <linux/etherdevice.h>
18#include <linux/skbuff.h>
19#include <linux/spinlock.h>
20#include <linux/mii.h>
21#include <linux/ethtool.h>
22#include <linux/bitops.h>
23
24#include <asm/8xx_immap.h>
25#include <asm/pgtable.h>
26#include <asm/mpc8xx.h>
27#include <asm/irq.h>
28#include <asm/uaccess.h>
29#include <asm/cpm1.h>
30
31#include "fec_8xx.h"
32
33/*************************************************/
34
35static struct fec_platform_info fec1_info = {
36 .fec_no = 0,
37 .use_mdio = 1,
38 .phy_addr = 8,
39 .fec_irq = SIU_LEVEL1,
40 .phy_irq = CPM_IRQ_OFFSET + CPMVEC_PIO_PC6,
41 .rx_ring = 128,
42 .tx_ring = 16,
43 .rx_copybreak = 240,
44 .use_napi = 1,
45 .napi_weight = 17,
46};
47
48static struct fec_platform_info fec2_info = {
49 .fec_no = 1,
50 .use_mdio = 1,
51 .phy_addr = 2,
52 .fec_irq = SIU_LEVEL3,
53 .phy_irq = CPM_IRQ_OFFSET + CPMVEC_PIO_PC7,
54 .rx_ring = 128,
55 .tx_ring = 16,
56 .rx_copybreak = 240,
57 .use_napi = 1,
58 .napi_weight = 17,
59};
60
61static struct net_device *fec1_dev;
62static struct net_device *fec2_dev;
63
64/* XXX custom u-boot & Linux startup needed */
65extern const char *__fw_getenv(const char *var);
66
67/* access ports */
68#define setbits32(_addr, _v) __fec_out32(&(_addr), __fec_in32(&(_addr)) | (_v))
69#define clrbits32(_addr, _v) __fec_out32(&(_addr), __fec_in32(&(_addr)) & ~(_v))
70
71#define setbits16(_addr, _v) __fec_out16(&(_addr), __fec_in16(&(_addr)) | (_v))
72#define clrbits16(_addr, _v) __fec_out16(&(_addr), __fec_in16(&(_addr)) & ~(_v))
73
74int fec_8xx_platform_init(void)
75{
76 immap_t *immap = (immap_t *)IMAP_ADDR;
77 bd_t *bd = (bd_t *) __res;
78 const char *s;
79 char *e;
80 int i;
81
82 /* use MDC for MII */
83 setbits16(immap->im_ioport.iop_pdpar, 0x0080);
84 clrbits16(immap->im_ioport.iop_pddir, 0x0080);
85
86 /* configure FEC1 pins */
87 setbits16(immap->im_ioport.iop_papar, 0xe810);
88 setbits16(immap->im_ioport.iop_padir, 0x0810);
89 clrbits16(immap->im_ioport.iop_padir, 0xe000);
90
91 setbits32(immap->im_cpm.cp_pbpar, 0x00000001);
92 clrbits32(immap->im_cpm.cp_pbdir, 0x00000001);
93
94 setbits32(immap->im_cpm.cp_cptr, 0x00000100);
95 clrbits32(immap->im_cpm.cp_cptr, 0x00000050);
96
97 clrbits16(immap->im_ioport.iop_pcpar, 0x0200);
98 clrbits16(immap->im_ioport.iop_pcdir, 0x0200);
99 clrbits16(immap->im_ioport.iop_pcso, 0x0200);
100 setbits16(immap->im_ioport.iop_pcint, 0x0200);
101
102 /* configure FEC2 pins */
103 setbits32(immap->im_cpm.cp_pepar, 0x00039620);
104 setbits32(immap->im_cpm.cp_pedir, 0x00039620);
105 setbits32(immap->im_cpm.cp_peso, 0x00031000);
106 clrbits32(immap->im_cpm.cp_peso, 0x00008620);
107
108 setbits32(immap->im_cpm.cp_cptr, 0x00000080);
109 clrbits32(immap->im_cpm.cp_cptr, 0x00000028);
110
111 clrbits16(immap->im_ioport.iop_pcpar, 0x0200);
112 clrbits16(immap->im_ioport.iop_pcdir, 0x0200);
113 clrbits16(immap->im_ioport.iop_pcso, 0x0200);
114 setbits16(immap->im_ioport.iop_pcint, 0x0200);
115
116 /* fill up */
117 fec1_info.sys_clk = bd->bi_intfreq;
118 fec2_info.sys_clk = bd->bi_intfreq;
119
120 s = __fw_getenv("ethaddr");
121 if (s != NULL) {
122 for (i = 0; i < 6; i++) {
123 fec1_info.macaddr[i] = simple_strtoul(s, &e, 16);
124 if (*e)
125 s = e + 1;
126 }
127 }
128
129 s = __fw_getenv("eth1addr");
130 if (s != NULL) {
131 for (i = 0; i < 6; i++) {
132 fec2_info.macaddr[i] = simple_strtoul(s, &e, 16);
133 if (*e)
134 s = e + 1;
135 }
136 }
137
138 fec_8xx_init_one(&fec1_info, &fec1_dev);
139 fec_8xx_init_one(&fec2_info, &fec2_dev);
140
141 return fec1_dev != NULL && fec2_dev != NULL ? 0 : -1;
142}
143
144void fec_8xx_platform_cleanup(void)
145{
146 if (fec2_dev != NULL)
147 fec_8xx_cleanup_one(fec2_dev);
148
149 if (fec1_dev != NULL)
150 fec_8xx_cleanup_one(fec1_dev);
151}
diff --git a/drivers/net/fec_8xx/fec_8xx.h b/drivers/net/fec_8xx/fec_8xx.h
deleted file mode 100644
index f3b1c6fbba8b..000000000000
--- a/drivers/net/fec_8xx/fec_8xx.h
+++ /dev/null
@@ -1,220 +0,0 @@
1#ifndef FEC_8XX_H
2#define FEC_8XX_H
3
4#include <linux/mii.h>
5#include <linux/netdevice.h>
6
7#include <linux/types.h>
8
9/* HW info */
10
11/* CRC polynomium used by the FEC for the multicast group filtering */
12#define FEC_CRC_POLY 0x04C11DB7
13
14#define MII_ADVERTISE_HALF (ADVERTISE_100HALF | \
15 ADVERTISE_10HALF | ADVERTISE_CSMA)
16#define MII_ADVERTISE_ALL (ADVERTISE_100FULL | \
17 ADVERTISE_10FULL | MII_ADVERTISE_HALF)
18
19/* Interrupt events/masks.
20*/
21#define FEC_ENET_HBERR 0x80000000U /* Heartbeat error */
22#define FEC_ENET_BABR 0x40000000U /* Babbling receiver */
23#define FEC_ENET_BABT 0x20000000U /* Babbling transmitter */
24#define FEC_ENET_GRA 0x10000000U /* Graceful stop complete */
25#define FEC_ENET_TXF 0x08000000U /* Full frame transmitted */
26#define FEC_ENET_TXB 0x04000000U /* A buffer was transmitted */
27#define FEC_ENET_RXF 0x02000000U /* Full frame received */
28#define FEC_ENET_RXB 0x01000000U /* A buffer was received */
29#define FEC_ENET_MII 0x00800000U /* MII interrupt */
30#define FEC_ENET_EBERR 0x00400000U /* SDMA bus error */
31
32#define FEC_ECNTRL_PINMUX 0x00000004
33#define FEC_ECNTRL_ETHER_EN 0x00000002
34#define FEC_ECNTRL_RESET 0x00000001
35
36#define FEC_RCNTRL_BC_REJ 0x00000010
37#define FEC_RCNTRL_PROM 0x00000008
38#define FEC_RCNTRL_MII_MODE 0x00000004
39#define FEC_RCNTRL_DRT 0x00000002
40#define FEC_RCNTRL_LOOP 0x00000001
41
42#define FEC_TCNTRL_FDEN 0x00000004
43#define FEC_TCNTRL_HBC 0x00000002
44#define FEC_TCNTRL_GTS 0x00000001
45
46/* values for MII phy_status */
47
48#define PHY_CONF_ANE 0x0001 /* 1 auto-negotiation enabled */
49#define PHY_CONF_LOOP 0x0002 /* 1 loopback mode enabled */
50#define PHY_CONF_SPMASK 0x00f0 /* mask for speed */
51#define PHY_CONF_10HDX 0x0010 /* 10 Mbit half duplex supported */
52#define PHY_CONF_10FDX 0x0020 /* 10 Mbit full duplex supported */
53#define PHY_CONF_100HDX 0x0040 /* 100 Mbit half duplex supported */
54#define PHY_CONF_100FDX 0x0080 /* 100 Mbit full duplex supported */
55
56#define PHY_STAT_LINK 0x0100 /* 1 up - 0 down */
57#define PHY_STAT_FAULT 0x0200 /* 1 remote fault */
58#define PHY_STAT_ANC 0x0400 /* 1 auto-negotiation complete */
59#define PHY_STAT_SPMASK 0xf000 /* mask for speed */
60#define PHY_STAT_10HDX 0x1000 /* 10 Mbit half duplex selected */
61#define PHY_STAT_10FDX 0x2000 /* 10 Mbit full duplex selected */
62#define PHY_STAT_100HDX 0x4000 /* 100 Mbit half duplex selected */
63#define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */
64
65typedef struct phy_info {
66 unsigned int id;
67 const char *name;
68 void (*startup) (struct net_device * dev);
69 void (*shutdown) (struct net_device * dev);
70 void (*ack_int) (struct net_device * dev);
71} phy_info_t;
72
73/* The FEC stores dest/src/type, data, and checksum for receive packets.
74 */
75#define MAX_MTU 1508 /* Allow fullsized pppoe packets over VLAN */
76#define MIN_MTU 46 /* this is data size */
77#define CRC_LEN 4
78
79#define PKT_MAXBUF_SIZE (MAX_MTU+ETH_HLEN+CRC_LEN)
80#define PKT_MINBUF_SIZE (MIN_MTU+ETH_HLEN+CRC_LEN)
81
82/* Must be a multiple of 4 */
83#define PKT_MAXBLR_SIZE ((PKT_MAXBUF_SIZE+3) & ~3)
84/* This is needed so that invalidate_xxx wont invalidate too much */
85#define ENET_RX_FRSIZE L1_CACHE_ALIGN(PKT_MAXBUF_SIZE)
86
87/* platform interface */
88
89struct fec_platform_info {
90 int fec_no; /* FEC index */
91 int use_mdio; /* use external MII */
92 int phy_addr; /* the phy address */
93 int fec_irq, phy_irq; /* the irq for the controller */
94 int rx_ring, tx_ring; /* number of buffers on rx */
95 int sys_clk; /* system clock */
96 __u8 macaddr[6]; /* mac address */
97 int rx_copybreak; /* limit we copy small frames */
98 int use_napi; /* use NAPI */
99 int napi_weight; /* NAPI weight */
100};
101
102/* forward declaration */
103struct fec;
104
105struct fec_enet_private {
106 spinlock_t lock; /* during all ops except TX pckt processing */
107 spinlock_t tx_lock; /* during fec_start_xmit and fec_tx */
108 struct net_device *dev;
109 struct napi_struct napi;
110 int fecno;
111 struct fec *fecp;
112 const struct fec_platform_info *fpi;
113 int rx_ring, tx_ring;
114 dma_addr_t ring_mem_addr;
115 void *ring_base;
116 struct sk_buff **rx_skbuff;
117 struct sk_buff **tx_skbuff;
118 cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */
119 cbd_t *tx_bd_base;
120 cbd_t *dirty_tx; /* ring entries to be free()ed. */
121 cbd_t *cur_rx;
122 cbd_t *cur_tx;
123 int tx_free;
124 struct net_device_stats stats;
125 struct timer_list phy_timer_list;
126 const struct phy_info *phy;
127 unsigned int fec_phy_speed;
128 __u32 msg_enable;
129 struct mii_if_info mii_if;
130};
131
132/***************************************************************************/
133
134void fec_restart(struct net_device *dev, int duplex, int speed);
135void fec_stop(struct net_device *dev);
136
137/***************************************************************************/
138
139int fec_mii_read(struct net_device *dev, int phy_id, int location);
140void fec_mii_write(struct net_device *dev, int phy_id, int location, int value);
141
142int fec_mii_phy_id_detect(struct net_device *dev);
143void fec_mii_startup(struct net_device *dev);
144void fec_mii_shutdown(struct net_device *dev);
145void fec_mii_ack_int(struct net_device *dev);
146
147void fec_mii_link_status_change_check(struct net_device *dev, int init_media);
148
149/***************************************************************************/
150
151#define FEC1_NO 0x00
152#define FEC2_NO 0x01
153#define FEC3_NO 0x02
154
155int fec_8xx_init_one(const struct fec_platform_info *fpi,
156 struct net_device **devp);
157int fec_8xx_cleanup_one(struct net_device *dev);
158
159/***************************************************************************/
160
161#define DRV_MODULE_NAME "fec_8xx"
162#define PFX DRV_MODULE_NAME ": "
163#define DRV_MODULE_VERSION "0.1"
164#define DRV_MODULE_RELDATE "May 6, 2004"
165
166/***************************************************************************/
167
168int fec_8xx_platform_init(void);
169void fec_8xx_platform_cleanup(void);
170
171/***************************************************************************/
172
173/* FEC access macros */
174#if defined(CONFIG_8xx)
175/* for a 8xx __raw_xxx's are sufficient */
176#define __fec_out32(addr, x) __raw_writel(x, addr)
177#define __fec_out16(addr, x) __raw_writew(x, addr)
178#define __fec_in32(addr) __raw_readl(addr)
179#define __fec_in16(addr) __raw_readw(addr)
180#else
181/* for others play it safe */
182#define __fec_out32(addr, x) out_be32(addr, x)
183#define __fec_out16(addr, x) out_be16(addr, x)
184#define __fec_in32(addr) in_be32(addr)
185#define __fec_in16(addr) in_be16(addr)
186#endif
187
188/* write */
189#define FW(_fecp, _reg, _v) __fec_out32(&(_fecp)->fec_ ## _reg, (_v))
190
191/* read */
192#define FR(_fecp, _reg) __fec_in32(&(_fecp)->fec_ ## _reg)
193
194/* set bits */
195#define FS(_fecp, _reg, _v) FW(_fecp, _reg, FR(_fecp, _reg) | (_v))
196
197/* clear bits */
198#define FC(_fecp, _reg, _v) FW(_fecp, _reg, FR(_fecp, _reg) & ~(_v))
199
200/* buffer descriptor access macros */
201
202/* write */
203#define CBDW_SC(_cbd, _sc) __fec_out16(&(_cbd)->cbd_sc, (_sc))
204#define CBDW_DATLEN(_cbd, _datlen) __fec_out16(&(_cbd)->cbd_datlen, (_datlen))
205#define CBDW_BUFADDR(_cbd, _bufaddr) __fec_out32(&(_cbd)->cbd_bufaddr, (_bufaddr))
206
207/* read */
208#define CBDR_SC(_cbd) __fec_in16(&(_cbd)->cbd_sc)
209#define CBDR_DATLEN(_cbd) __fec_in16(&(_cbd)->cbd_datlen)
210#define CBDR_BUFADDR(_cbd) __fec_in32(&(_cbd)->cbd_bufaddr)
211
212/* set bits */
213#define CBDS_SC(_cbd, _sc) CBDW_SC(_cbd, CBDR_SC(_cbd) | (_sc))
214
215/* clear bits */
216#define CBDC_SC(_cbd, _sc) CBDW_SC(_cbd, CBDR_SC(_cbd) & ~(_sc))
217
218/***************************************************************************/
219
220#endif
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c
deleted file mode 100644
index ca8d2e83ab03..000000000000
--- a/drivers/net/fec_8xx/fec_main.c
+++ /dev/null
@@ -1,1264 +0,0 @@
1/*
2 * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx.
3 *
4 * Copyright (c) 2003 Intracom S.A.
5 * by Pantelis Antoniou <panto@intracom.gr>
6 *
7 * Heavily based on original FEC driver by Dan Malek <dan@embeddededge.com>
8 * and modifications by Joakim Tjernlund <joakim.tjernlund@lumentis.se>
9 *
10 * Released under the GPL
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/types.h>
16#include <linux/string.h>
17#include <linux/ptrace.h>
18#include <linux/errno.h>
19#include <linux/ioport.h>
20#include <linux/slab.h>
21#include <linux/interrupt.h>
22#include <linux/init.h>
23#include <linux/delay.h>
24#include <linux/netdevice.h>
25#include <linux/etherdevice.h>
26#include <linux/skbuff.h>
27#include <linux/spinlock.h>
28#include <linux/mii.h>
29#include <linux/ethtool.h>
30#include <linux/bitops.h>
31#include <linux/dma-mapping.h>
32
33#include <asm/8xx_immap.h>
34#include <asm/pgtable.h>
35#include <asm/mpc8xx.h>
36#include <asm/irq.h>
37#include <asm/uaccess.h>
38#include <asm/cpm1.h>
39
40#include "fec_8xx.h"
41
42/*************************************************/
43
44#define FEC_MAX_MULTICAST_ADDRS 64
45
46/*************************************************/
47
48static char version[] __devinitdata =
49 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")" "\n";
50
51MODULE_AUTHOR("Pantelis Antoniou <panto@intracom.gr>");
52MODULE_DESCRIPTION("Motorola 8xx FEC ethernet driver");
53MODULE_LICENSE("GPL");
54
55int fec_8xx_debug = -1; /* -1 == use FEC_8XX_DEF_MSG_ENABLE as value */
56module_param(fec_8xx_debug, int, 0);
57MODULE_PARM_DESC(fec_8xx_debug,
58 "FEC 8xx bitmapped debugging message enable value");
59
60
61/*************************************************/
62
63/*
64 * Delay to wait for FEC reset command to complete (in us)
65 */
66#define FEC_RESET_DELAY 50
67
68/*****************************************************************************************/
69
70static void fec_whack_reset(fec_t * fecp)
71{
72 int i;
73
74 /*
75 * Whack a reset. We should wait for this.
76 */
77 FW(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_RESET);
78 for (i = 0;
79 (FR(fecp, ecntrl) & FEC_ECNTRL_RESET) != 0 && i < FEC_RESET_DELAY;
80 i++)
81 udelay(1);
82
83 if (i == FEC_RESET_DELAY)
84 printk(KERN_WARNING "FEC Reset timeout!\n");
85
86}
87
88/****************************************************************************/
89
90/*
91 * Transmitter timeout.
92 */
93#define TX_TIMEOUT (2*HZ)
94
95/****************************************************************************/
96
97/*
98 * Returns the CRC needed when filling in the hash table for
99 * multicast group filtering
100 * pAddr must point to a MAC address (6 bytes)
101 */
102static __u32 fec_mulicast_calc_crc(char *pAddr)
103{
104 u8 byte;
105 int byte_count;
106 int bit_count;
107 __u32 crc = 0xffffffff;
108 u8 msb;
109
110 for (byte_count = 0; byte_count < 6; byte_count++) {
111 byte = pAddr[byte_count];
112 for (bit_count = 0; bit_count < 8; bit_count++) {
113 msb = crc >> 31;
114 crc <<= 1;
115 if (msb ^ (byte & 0x1)) {
116 crc ^= FEC_CRC_POLY;
117 }
118 byte >>= 1;
119 }
120 }
121 return (crc);
122}
123
124/*
125 * Set or clear the multicast filter for this adaptor.
126 * Skeleton taken from sunlance driver.
127 * The CPM Ethernet implementation allows Multicast as well as individual
128 * MAC address filtering. Some of the drivers check to make sure it is
129 * a group multicast address, and discard those that are not. I guess I
130 * will do the same for now, but just remove the test if you want
131 * individual filtering as well (do the upper net layers want or support
132 * this kind of feature?).
133 */
134static void fec_set_multicast_list(struct net_device *dev)
135{
136 struct fec_enet_private *fep = netdev_priv(dev);
137 fec_t *fecp = fep->fecp;
138 struct dev_mc_list *pmc;
139 __u32 crc;
140 int temp;
141 __u32 csrVal;
142 int hash_index;
143 __u32 hthi, htlo;
144 unsigned long flags;
145
146
147 if ((dev->flags & IFF_PROMISC) != 0) {
148
149 spin_lock_irqsave(&fep->lock, flags);
150 FS(fecp, r_cntrl, FEC_RCNTRL_PROM);
151 spin_unlock_irqrestore(&fep->lock, flags);
152
153 /*
154 * Log any net taps.
155 */
156 printk(KERN_WARNING DRV_MODULE_NAME
157 ": %s: Promiscuous mode enabled.\n", dev->name);
158 return;
159
160 }
161
162 if ((dev->flags & IFF_ALLMULTI) != 0 ||
163 dev->mc_count > FEC_MAX_MULTICAST_ADDRS) {
164 /*
165 * Catch all multicast addresses, set the filter to all 1's.
166 */
167 hthi = 0xffffffffU;
168 htlo = 0xffffffffU;
169 } else {
170 hthi = 0;
171 htlo = 0;
172
173 /*
174 * Now populate the hash table
175 */
176 for (pmc = dev->mc_list; pmc != NULL; pmc = pmc->next) {
177 crc = fec_mulicast_calc_crc(pmc->dmi_addr);
178 temp = (crc & 0x3f) >> 1;
179 hash_index = ((temp & 0x01) << 4) |
180 ((temp & 0x02) << 2) |
181 ((temp & 0x04)) |
182 ((temp & 0x08) >> 2) |
183 ((temp & 0x10) >> 4);
184 csrVal = (1 << hash_index);
185 if (crc & 1)
186 hthi |= csrVal;
187 else
188 htlo |= csrVal;
189 }
190 }
191
192 spin_lock_irqsave(&fep->lock, flags);
193 FC(fecp, r_cntrl, FEC_RCNTRL_PROM);
194 FW(fecp, hash_table_high, hthi);
195 FW(fecp, hash_table_low, htlo);
196 spin_unlock_irqrestore(&fep->lock, flags);
197}
198
199static int fec_set_mac_address(struct net_device *dev, void *addr)
200{
201 struct sockaddr *mac = addr;
202 struct fec_enet_private *fep = netdev_priv(dev);
203 struct fec *fecp = fep->fecp;
204 int i;
205 __u32 addrhi, addrlo;
206 unsigned long flags;
207
208 /* Get pointer to SCC area in parameter RAM. */
209 for (i = 0; i < 6; i++)
210 dev->dev_addr[i] = mac->sa_data[i];
211
212 /*
213 * Set station address.
214 */
215 addrhi = ((__u32) dev->dev_addr[0] << 24) |
216 ((__u32) dev->dev_addr[1] << 16) |
217 ((__u32) dev->dev_addr[2] << 8) |
218 (__u32) dev->dev_addr[3];
219 addrlo = ((__u32) dev->dev_addr[4] << 24) |
220 ((__u32) dev->dev_addr[5] << 16);
221
222 spin_lock_irqsave(&fep->lock, flags);
223 FW(fecp, addr_low, addrhi);
224 FW(fecp, addr_high, addrlo);
225 spin_unlock_irqrestore(&fep->lock, flags);
226
227 return 0;
228}
229
230/*
231 * This function is called to start or restart the FEC during a link
232 * change. This only happens when switching between half and full
233 * duplex.
234 */
235void fec_restart(struct net_device *dev, int duplex, int speed)
236{
237#ifdef CONFIG_DUET
238 immap_t *immap = (immap_t *) IMAP_ADDR;
239 __u32 cptr;
240#endif
241 struct fec_enet_private *fep = netdev_priv(dev);
242 struct fec *fecp = fep->fecp;
243 const struct fec_platform_info *fpi = fep->fpi;
244 cbd_t *bdp;
245 struct sk_buff *skb;
246 int i;
247 __u32 addrhi, addrlo;
248
249 fec_whack_reset(fep->fecp);
250
251 /*
252 * Set station address.
253 */
254 addrhi = ((__u32) dev->dev_addr[0] << 24) |
255 ((__u32) dev->dev_addr[1] << 16) |
256 ((__u32) dev->dev_addr[2] << 8) |
257 (__u32) dev->dev_addr[3];
258 addrlo = ((__u32) dev->dev_addr[4] << 24) |
259 ((__u32) dev->dev_addr[5] << 16);
260 FW(fecp, addr_low, addrhi);
261 FW(fecp, addr_high, addrlo);
262
263 /*
264 * Reset all multicast.
265 */
266 FW(fecp, hash_table_high, 0);
267 FW(fecp, hash_table_low, 0);
268
269 /*
270 * Set maximum receive buffer size.
271 */
272 FW(fecp, r_buff_size, PKT_MAXBLR_SIZE);
273 FW(fecp, r_hash, PKT_MAXBUF_SIZE);
274
275 /*
276 * Set receive and transmit descriptor base.
277 */
278 FW(fecp, r_des_start, iopa((__u32) (fep->rx_bd_base)));
279 FW(fecp, x_des_start, iopa((__u32) (fep->tx_bd_base)));
280
281 fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
282 fep->tx_free = fep->tx_ring;
283 fep->cur_rx = fep->rx_bd_base;
284
285 /*
286 * Reset SKB receive buffers
287 */
288 for (i = 0; i < fep->rx_ring; i++) {
289 if ((skb = fep->rx_skbuff[i]) == NULL)
290 continue;
291 fep->rx_skbuff[i] = NULL;
292 dev_kfree_skb(skb);
293 }
294
295 /*
296 * Initialize the receive buffer descriptors.
297 */
298 for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {
299 skb = dev_alloc_skb(ENET_RX_FRSIZE);
300 if (skb == NULL) {
301 printk(KERN_WARNING DRV_MODULE_NAME
302 ": %s Memory squeeze, unable to allocate skb\n",
303 dev->name);
304 fep->stats.rx_dropped++;
305 break;
306 }
307 fep->rx_skbuff[i] = skb;
308 skb->dev = dev;
309 CBDW_BUFADDR(bdp, dma_map_single(NULL, skb->data,
310 L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),
311 DMA_FROM_DEVICE));
312 CBDW_DATLEN(bdp, 0); /* zero */
313 CBDW_SC(bdp, BD_ENET_RX_EMPTY |
314 ((i < fep->rx_ring - 1) ? 0 : BD_SC_WRAP));
315 }
316 /*
317 * if we failed, fillup remainder
318 */
319 for (; i < fep->rx_ring; i++, bdp++) {
320 fep->rx_skbuff[i] = NULL;
321 CBDW_SC(bdp, (i < fep->rx_ring - 1) ? 0 : BD_SC_WRAP);
322 }
323
324 /*
325 * Reset SKB transmit buffers.
326 */
327 for (i = 0; i < fep->tx_ring; i++) {
328 if ((skb = fep->tx_skbuff[i]) == NULL)
329 continue;
330 fep->tx_skbuff[i] = NULL;
331 dev_kfree_skb(skb);
332 }
333
334 /*
335 * ...and the same for transmit.
336 */
337 for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) {
338 fep->tx_skbuff[i] = NULL;
339 CBDW_BUFADDR(bdp, virt_to_bus(NULL));
340 CBDW_DATLEN(bdp, 0);
341 CBDW_SC(bdp, (i < fep->tx_ring - 1) ? 0 : BD_SC_WRAP);
342 }
343
344 /*
345 * Enable big endian and don't care about SDMA FC.
346 */
347 FW(fecp, fun_code, 0x78000000);
348
349 /*
350 * Set MII speed.
351 */
352 FW(fecp, mii_speed, fep->fec_phy_speed);
353
354 /*
355 * Clear any outstanding interrupt.
356 */
357 FW(fecp, ievent, 0xffc0);
358 FW(fecp, ivec, (fpi->fec_irq / 2) << 29);
359
360 /*
361 * adjust to speed (only for DUET & RMII)
362 */
363#ifdef CONFIG_DUET
364 cptr = in_be32(&immap->im_cpm.cp_cptr);
365 switch (fpi->fec_no) {
366 case 0:
367 /*
368 * check if in RMII mode
369 */
370 if ((cptr & 0x100) == 0)
371 break;
372
373 if (speed == 10)
374 cptr |= 0x0000010;
375 else if (speed == 100)
376 cptr &= ~0x0000010;
377 break;
378 case 1:
379 /*
380 * check if in RMII mode
381 */
382 if ((cptr & 0x80) == 0)
383 break;
384
385 if (speed == 10)
386 cptr |= 0x0000008;
387 else if (speed == 100)
388 cptr &= ~0x0000008;
389 break;
390 default:
391 break;
392 }
393 out_be32(&immap->im_cpm.cp_cptr, cptr);
394#endif
395
396 FW(fecp, r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */
397 /*
398 * adjust to duplex mode
399 */
400 if (duplex) {
401 FC(fecp, r_cntrl, FEC_RCNTRL_DRT);
402 FS(fecp, x_cntrl, FEC_TCNTRL_FDEN); /* FD enable */
403 } else {
404 FS(fecp, r_cntrl, FEC_RCNTRL_DRT);
405 FC(fecp, x_cntrl, FEC_TCNTRL_FDEN); /* FD disable */
406 }
407
408 /*
409 * Enable interrupts we wish to service.
410 */
411 FW(fecp, imask, FEC_ENET_TXF | FEC_ENET_TXB |
412 FEC_ENET_RXF | FEC_ENET_RXB);
413
414 /*
415 * And last, enable the transmit and receive processing.
416 */
417 FW(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN);
418 FW(fecp, r_des_active, 0x01000000);
419}
420
421void fec_stop(struct net_device *dev)
422{
423 struct fec_enet_private *fep = netdev_priv(dev);
424 fec_t *fecp = fep->fecp;
425 struct sk_buff *skb;
426 int i;
427
428 if ((FR(fecp, ecntrl) & FEC_ECNTRL_ETHER_EN) == 0)
429 return; /* already down */
430
431 FW(fecp, x_cntrl, 0x01); /* Graceful transmit stop */
432 for (i = 0; ((FR(fecp, ievent) & 0x10000000) == 0) &&
433 i < FEC_RESET_DELAY; i++)
434 udelay(1);
435
436 if (i == FEC_RESET_DELAY)
437 printk(KERN_WARNING DRV_MODULE_NAME
438 ": %s FEC timeout on graceful transmit stop\n",
439 dev->name);
440 /*
441 * Disable FEC. Let only MII interrupts.
442 */
443 FW(fecp, imask, 0);
444 FW(fecp, ecntrl, ~FEC_ECNTRL_ETHER_EN);
445
446 /*
447 * Reset SKB transmit buffers.
448 */
449 for (i = 0; i < fep->tx_ring; i++) {
450 if ((skb = fep->tx_skbuff[i]) == NULL)
451 continue;
452 fep->tx_skbuff[i] = NULL;
453 dev_kfree_skb(skb);
454 }
455
456 /*
457 * Reset SKB receive buffers
458 */
459 for (i = 0; i < fep->rx_ring; i++) {
460 if ((skb = fep->rx_skbuff[i]) == NULL)
461 continue;
462 fep->rx_skbuff[i] = NULL;
463 dev_kfree_skb(skb);
464 }
465}
466
467/* common receive function */
468static int fec_enet_rx_common(struct fec_enet_private *ep,
469 struct net_device *dev, int budget)
470{
471 fec_t *fecp = fep->fecp;
472 const struct fec_platform_info *fpi = fep->fpi;
473 cbd_t *bdp;
474 struct sk_buff *skb, *skbn, *skbt;
475 int received = 0;
476 __u16 pkt_len, sc;
477 int curidx;
478
479 /*
480 * First, grab all of the stats for the incoming packet.
481 * These get messed up if we get called due to a busy condition.
482 */
483 bdp = fep->cur_rx;
484
485 /* clear RX status bits for napi*/
486 if (fpi->use_napi)
487 FW(fecp, ievent, FEC_ENET_RXF | FEC_ENET_RXB);
488
489 while (((sc = CBDR_SC(bdp)) & BD_ENET_RX_EMPTY) == 0) {
490
491 curidx = bdp - fep->rx_bd_base;
492
493 /*
494 * Since we have allocated space to hold a complete frame,
495 * the last indicator should be set.
496 */
497 if ((sc & BD_ENET_RX_LAST) == 0)
498 printk(KERN_WARNING DRV_MODULE_NAME
499 ": %s rcv is not +last\n",
500 dev->name);
501
502 /*
503 * Check for errors.
504 */
505 if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_CL |
506 BD_ENET_RX_NO | BD_ENET_RX_CR | BD_ENET_RX_OV)) {
507 fep->stats.rx_errors++;
508 /* Frame too long or too short. */
509 if (sc & (BD_ENET_RX_LG | BD_ENET_RX_SH))
510 fep->stats.rx_length_errors++;
511 /* Frame alignment */
512 if (sc & (BD_ENET_RX_NO | BD_ENET_RX_CL))
513 fep->stats.rx_frame_errors++;
514 /* CRC Error */
515 if (sc & BD_ENET_RX_CR)
516 fep->stats.rx_crc_errors++;
517 /* FIFO overrun */
518 if (sc & BD_ENET_RX_OV)
519 fep->stats.rx_crc_errors++;
520
521 skbn = fep->rx_skbuff[curidx];
522 BUG_ON(skbn == NULL);
523
524 } else {
525 skb = fep->rx_skbuff[curidx];
526 BUG_ON(skb == NULL);
527
528 /*
529 * Process the incoming frame.
530 */
531 fep->stats.rx_packets++;
532 pkt_len = CBDR_DATLEN(bdp) - 4; /* remove CRC */
533 fep->stats.rx_bytes += pkt_len + 4;
534
535 if (pkt_len <= fpi->rx_copybreak) {
536 /* +2 to make IP header L1 cache aligned */
537 skbn = dev_alloc_skb(pkt_len + 2);
538 if (skbn != NULL) {
539 skb_reserve(skbn, 2); /* align IP header */
540 skb_copy_from_linear_data(skb,
541 skbn->data,
542 pkt_len);
543 /* swap */
544 skbt = skb;
545 skb = skbn;
546 skbn = skbt;
547 }
548 } else
549 skbn = dev_alloc_skb(ENET_RX_FRSIZE);
550
551 if (skbn != NULL) {
552 skb_put(skb, pkt_len); /* Make room */
553 skb->protocol = eth_type_trans(skb, dev);
554 received++;
555 if (!fpi->use_napi)
556 netif_rx(skb);
557 else
558 netif_receive_skb(skb);
559 } else {
560 printk(KERN_WARNING DRV_MODULE_NAME
561 ": %s Memory squeeze, dropping packet.\n",
562 dev->name);
563 fep->stats.rx_dropped++;
564 skbn = skb;
565 }
566 }
567
568 fep->rx_skbuff[curidx] = skbn;
569 CBDW_BUFADDR(bdp, dma_map_single(NULL, skbn->data,
570 L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),
571 DMA_FROM_DEVICE));
572 CBDW_DATLEN(bdp, 0);
573 CBDW_SC(bdp, (sc & ~BD_ENET_RX_STATS) | BD_ENET_RX_EMPTY);
574
575 /*
576 * Update BD pointer to next entry.
577 */
578 if ((sc & BD_ENET_RX_WRAP) == 0)
579 bdp++;
580 else
581 bdp = fep->rx_bd_base;
582
583 /*
584 * Doing this here will keep the FEC running while we process
585 * incoming frames. On a heavily loaded network, we should be
586 * able to keep up at the expense of system resources.
587 */
588 FW(fecp, r_des_active, 0x01000000);
589
590 if (received >= budget)
591 break;
592
593 }
594
595 fep->cur_rx = bdp;
596
597 if (fpi->use_napi) {
598 if (received < budget) {
599 netif_rx_complete(dev, &fep->napi);
600
601 /* enable RX interrupt bits */
602 FS(fecp, imask, FEC_ENET_RXF | FEC_ENET_RXB);
603 }
604 }
605
606 return received;
607}
608
609static void fec_enet_tx(struct net_device *dev)
610{
611 struct fec_enet_private *fep = netdev_priv(dev);
612 cbd_t *bdp;
613 struct sk_buff *skb;
614 int dirtyidx, do_wake;
615 __u16 sc;
616
617 spin_lock(&fep->lock);
618 bdp = fep->dirty_tx;
619
620 do_wake = 0;
621 while (((sc = CBDR_SC(bdp)) & BD_ENET_TX_READY) == 0) {
622
623 dirtyidx = bdp - fep->tx_bd_base;
624
625 if (fep->tx_free == fep->tx_ring)
626 break;
627
628 skb = fep->tx_skbuff[dirtyidx];
629
630 /*
631 * Check for errors.
632 */
633 if (sc & (BD_ENET_TX_HB | BD_ENET_TX_LC |
634 BD_ENET_TX_RL | BD_ENET_TX_UN | BD_ENET_TX_CSL)) {
635 fep->stats.tx_errors++;
636 if (sc & BD_ENET_TX_HB) /* No heartbeat */
637 fep->stats.tx_heartbeat_errors++;
638 if (sc & BD_ENET_TX_LC) /* Late collision */
639 fep->stats.tx_window_errors++;
640 if (sc & BD_ENET_TX_RL) /* Retrans limit */
641 fep->stats.tx_aborted_errors++;
642 if (sc & BD_ENET_TX_UN) /* Underrun */
643 fep->stats.tx_fifo_errors++;
644 if (sc & BD_ENET_TX_CSL) /* Carrier lost */
645 fep->stats.tx_carrier_errors++;
646 } else
647 fep->stats.tx_packets++;
648
649 if (sc & BD_ENET_TX_READY)
650 printk(KERN_WARNING DRV_MODULE_NAME
651 ": %s HEY! Enet xmit interrupt and TX_READY.\n",
652 dev->name);
653
654 /*
655 * Deferred means some collisions occurred during transmit,
656 * but we eventually sent the packet OK.
657 */
658 if (sc & BD_ENET_TX_DEF)
659 fep->stats.collisions++;
660
661 /*
662 * Free the sk buffer associated with this last transmit.
663 */
664 dev_kfree_skb_irq(skb);
665 fep->tx_skbuff[dirtyidx] = NULL;
666
667 /*
668 * Update pointer to next buffer descriptor to be transmitted.
669 */
670 if ((sc & BD_ENET_TX_WRAP) == 0)
671 bdp++;
672 else
673 bdp = fep->tx_bd_base;
674
675 /*
676 * Since we have freed up a buffer, the ring is no longer
677 * full.
678 */
679 if (!fep->tx_free++)
680 do_wake = 1;
681 }
682
683 fep->dirty_tx = bdp;
684
685 spin_unlock(&fep->lock);
686
687 if (do_wake && netif_queue_stopped(dev))
688 netif_wake_queue(dev);
689}
690
691/*
692 * The interrupt handler.
693 * This is called from the MPC core interrupt.
694 */
695static irqreturn_t
696fec_enet_interrupt(int irq, void *dev_id)
697{
698 struct net_device *dev = dev_id;
699 struct fec_enet_private *fep;
700 const struct fec_platform_info *fpi;
701 fec_t *fecp;
702 __u32 int_events;
703 __u32 int_events_napi;
704
705 if (unlikely(dev == NULL))
706 return IRQ_NONE;
707
708 fep = netdev_priv(dev);
709 fecp = fep->fecp;
710 fpi = fep->fpi;
711
712 /*
713 * Get the interrupt events that caused us to be here.
714 */
715 while ((int_events = FR(fecp, ievent) & FR(fecp, imask)) != 0) {
716
717 if (!fpi->use_napi)
718 FW(fecp, ievent, int_events);
719 else {
720 int_events_napi = int_events & ~(FEC_ENET_RXF | FEC_ENET_RXB);
721 FW(fecp, ievent, int_events_napi);
722 }
723
724 if ((int_events & (FEC_ENET_HBERR | FEC_ENET_BABR |
725 FEC_ENET_BABT | FEC_ENET_EBERR)) != 0)
726 printk(KERN_WARNING DRV_MODULE_NAME
727 ": %s FEC ERROR(s) 0x%x\n",
728 dev->name, int_events);
729
730 if ((int_events & FEC_ENET_RXF) != 0) {
731 if (!fpi->use_napi)
732 fec_enet_rx_common(fep, dev, ~0);
733 else {
734 if (netif_rx_schedule_prep(dev, &fep->napi)) {
735 /* disable rx interrupts */
736 FC(fecp, imask, FEC_ENET_RXF | FEC_ENET_RXB);
737 __netif_rx_schedule(dev, &fep->napi);
738 } else {
739 printk(KERN_ERR DRV_MODULE_NAME
740 ": %s driver bug! interrupt while in poll!\n",
741 dev->name);
742 FC(fecp, imask, FEC_ENET_RXF | FEC_ENET_RXB);
743 }
744 }
745 }
746
747 if ((int_events & FEC_ENET_TXF) != 0)
748 fec_enet_tx(dev);
749 }
750
751 return IRQ_HANDLED;
752}
753
754/* This interrupt occurs when the PHY detects a link change. */
755static irqreturn_t
756fec_mii_link_interrupt(int irq, void *dev_id)
757{
758 struct net_device *dev = dev_id;
759 struct fec_enet_private *fep;
760 const struct fec_platform_info *fpi;
761
762 if (unlikely(dev == NULL))
763 return IRQ_NONE;
764
765 fep = netdev_priv(dev);
766 fpi = fep->fpi;
767
768 if (!fpi->use_mdio)
769 return IRQ_NONE;
770
771 /*
772 * Acknowledge the interrupt if possible. If we have not
773 * found the PHY yet we can't process or acknowledge the
774 * interrupt now. Instead we ignore this interrupt for now,
775 * which we can do since it is edge triggered. It will be
776 * acknowledged later by fec_enet_open().
777 */
778 if (!fep->phy)
779 return IRQ_NONE;
780
781 fec_mii_ack_int(dev);
782 fec_mii_link_status_change_check(dev, 0);
783
784 return IRQ_HANDLED;
785}
786
787
788/**********************************************************************************/
789
790static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
791{
792 struct fec_enet_private *fep = netdev_priv(dev);
793 fec_t *fecp = fep->fecp;
794 cbd_t *bdp;
795 int curidx;
796 unsigned long flags;
797
798 spin_lock_irqsave(&fep->tx_lock, flags);
799
800 /*
801 * Fill in a Tx ring entry
802 */
803 bdp = fep->cur_tx;
804
805 if (!fep->tx_free || (CBDR_SC(bdp) & BD_ENET_TX_READY)) {
806 netif_stop_queue(dev);
807 spin_unlock_irqrestore(&fep->tx_lock, flags);
808
809 /*
810 * Ooops. All transmit buffers are full. Bail out.
811 * This should not happen, since the tx queue should be stopped.
812 */
813 printk(KERN_WARNING DRV_MODULE_NAME
814 ": %s tx queue full!.\n", dev->name);
815 return 1;
816 }
817
818 curidx = bdp - fep->tx_bd_base;
819 /*
820 * Clear all of the status flags.
821 */
822 CBDC_SC(bdp, BD_ENET_TX_STATS);
823
824 /*
825 * Save skb pointer.
826 */
827 fep->tx_skbuff[curidx] = skb;
828
829 fep->stats.tx_bytes += skb->len;
830
831 /*
832 * Push the data cache so the CPM does not get stale memory data.
833 */
834 CBDW_BUFADDR(bdp, dma_map_single(NULL, skb->data,
835 skb->len, DMA_TO_DEVICE));
836 CBDW_DATLEN(bdp, skb->len);
837
838 dev->trans_start = jiffies;
839
840 /*
841 * If this was the last BD in the ring, start at the beginning again.
842 */
843 if ((CBDR_SC(bdp) & BD_ENET_TX_WRAP) == 0)
844 fep->cur_tx++;
845 else
846 fep->cur_tx = fep->tx_bd_base;
847
848 if (!--fep->tx_free)
849 netif_stop_queue(dev);
850
851 /*
852 * Trigger transmission start
853 */
854 CBDS_SC(bdp, BD_ENET_TX_READY | BD_ENET_TX_INTR |
855 BD_ENET_TX_LAST | BD_ENET_TX_TC);
856 FW(fecp, x_des_active, 0x01000000);
857
858 spin_unlock_irqrestore(&fep->tx_lock, flags);
859
860 return 0;
861}
862
863static void fec_timeout(struct net_device *dev)
864{
865 struct fec_enet_private *fep = netdev_priv(dev);
866
867 fep->stats.tx_errors++;
868
869 if (fep->tx_free)
870 netif_wake_queue(dev);
871
872 /* check link status again */
873 fec_mii_link_status_change_check(dev, 0);
874}
875
876static int fec_enet_open(struct net_device *dev)
877{
878 struct fec_enet_private *fep = netdev_priv(dev);
879 const struct fec_platform_info *fpi = fep->fpi;
880 unsigned long flags;
881
882 napi_enable(&fep->napi);
883
884 /* Install our interrupt handler. */
885 if (request_irq(fpi->fec_irq, fec_enet_interrupt, 0, "fec", dev) != 0) {
886 printk(KERN_ERR DRV_MODULE_NAME
887 ": %s Could not allocate FEC IRQ!", dev->name);
888 napi_disable(&fep->napi);
889 return -EINVAL;
890 }
891
892 /* Install our phy interrupt handler */
893 if (fpi->phy_irq != -1 &&
894 request_irq(fpi->phy_irq, fec_mii_link_interrupt, 0, "fec-phy",
895 dev) != 0) {
896 printk(KERN_ERR DRV_MODULE_NAME
897 ": %s Could not allocate PHY IRQ!", dev->name);
898 free_irq(fpi->fec_irq, dev);
899 napi_disable(&fep->napi);
900 return -EINVAL;
901 }
902
903 if (fpi->use_mdio) {
904 fec_mii_startup(dev);
905 netif_carrier_off(dev);
906 fec_mii_link_status_change_check(dev, 1);
907 } else {
908 spin_lock_irqsave(&fep->lock, flags);
909 fec_restart(dev, 1, 100); /* XXX this sucks */
910 spin_unlock_irqrestore(&fep->lock, flags);
911
912 netif_carrier_on(dev);
913 netif_start_queue(dev);
914 }
915 return 0;
916}
917
918static int fec_enet_close(struct net_device *dev)
919{
920 struct fec_enet_private *fep = netdev_priv(dev);
921 const struct fec_platform_info *fpi = fep->fpi;
922 unsigned long flags;
923
924 netif_stop_queue(dev);
925 napi_disable(&fep->napi);
926 netif_carrier_off(dev);
927
928 if (fpi->use_mdio)
929 fec_mii_shutdown(dev);
930
931 spin_lock_irqsave(&fep->lock, flags);
932 fec_stop(dev);
933 spin_unlock_irqrestore(&fep->lock, flags);
934
935 /* release any irqs */
936 if (fpi->phy_irq != -1)
937 free_irq(fpi->phy_irq, dev);
938 free_irq(fpi->fec_irq, dev);
939
940 return 0;
941}
942
943static struct net_device_stats *fec_enet_get_stats(struct net_device *dev)
944{
945 struct fec_enet_private *fep = netdev_priv(dev);
946 return &fep->stats;
947}
948
949static int fec_enet_poll(struct napi_struct *napi, int budget)
950{
951 struct fec_enet_private *fep = container_of(napi, struct fec_enet_private, napi);
952 struct net_device *dev = fep->dev;
953
954 return fec_enet_rx_common(fep, dev, budget);
955}
956
957/*************************************************************************/
958
959static void fec_get_drvinfo(struct net_device *dev,
960 struct ethtool_drvinfo *info)
961{
962 strcpy(info->driver, DRV_MODULE_NAME);
963 strcpy(info->version, DRV_MODULE_VERSION);
964}
965
966static int fec_get_regs_len(struct net_device *dev)
967{
968 return sizeof(fec_t);
969}
970
971static void fec_get_regs(struct net_device *dev, struct ethtool_regs *regs,
972 void *p)
973{
974 struct fec_enet_private *fep = netdev_priv(dev);
975 unsigned long flags;
976
977 if (regs->len < sizeof(fec_t))
978 return;
979
980 regs->version = 0;
981 spin_lock_irqsave(&fep->lock, flags);
982 memcpy_fromio(p, fep->fecp, sizeof(fec_t));
983 spin_unlock_irqrestore(&fep->lock, flags);
984}
985
986static int fec_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
987{
988 struct fec_enet_private *fep = netdev_priv(dev);
989 unsigned long flags;
990 int rc;
991
992 spin_lock_irqsave(&fep->lock, flags);
993 rc = mii_ethtool_gset(&fep->mii_if, cmd);
994 spin_unlock_irqrestore(&fep->lock, flags);
995
996 return rc;
997}
998
999static int fec_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1000{
1001 struct fec_enet_private *fep = netdev_priv(dev);
1002 unsigned long flags;
1003 int rc;
1004
1005 spin_lock_irqsave(&fep->lock, flags);
1006 rc = mii_ethtool_sset(&fep->mii_if, cmd);
1007 spin_unlock_irqrestore(&fep->lock, flags);
1008
1009 return rc;
1010}
1011
1012static int fec_nway_reset(struct net_device *dev)
1013{
1014 struct fec_enet_private *fep = netdev_priv(dev);
1015 return mii_nway_restart(&fep->mii_if);
1016}
1017
1018static __u32 fec_get_msglevel(struct net_device *dev)
1019{
1020 struct fec_enet_private *fep = netdev_priv(dev);
1021 return fep->msg_enable;
1022}
1023
1024static void fec_set_msglevel(struct net_device *dev, __u32 value)
1025{
1026 struct fec_enet_private *fep = netdev_priv(dev);
1027 fep->msg_enable = value;
1028}
1029
1030static const struct ethtool_ops fec_ethtool_ops = {
1031 .get_drvinfo = fec_get_drvinfo,
1032 .get_regs_len = fec_get_regs_len,
1033 .get_settings = fec_get_settings,
1034 .set_settings = fec_set_settings,
1035 .nway_reset = fec_nway_reset,
1036 .get_link = ethtool_op_get_link,
1037 .get_msglevel = fec_get_msglevel,
1038 .set_msglevel = fec_set_msglevel,
1039 .set_tx_csum = ethtool_op_set_tx_csum, /* local! */
1040 .set_sg = ethtool_op_set_sg,
1041 .get_regs = fec_get_regs,
1042};
1043
1044static int fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1045{
1046 struct fec_enet_private *fep = netdev_priv(dev);
1047 struct mii_ioctl_data *mii = (struct mii_ioctl_data *)&rq->ifr_data;
1048 unsigned long flags;
1049 int rc;
1050
1051 if (!netif_running(dev))
1052 return -EINVAL;
1053
1054 spin_lock_irqsave(&fep->lock, flags);
1055 rc = generic_mii_ioctl(&fep->mii_if, mii, cmd, NULL);
1056 spin_unlock_irqrestore(&fep->lock, flags);
1057 return rc;
1058}
1059
1060int fec_8xx_init_one(const struct fec_platform_info *fpi,
1061 struct net_device **devp)
1062{
1063 immap_t *immap = (immap_t *) IMAP_ADDR;
1064 static int fec_8xx_version_printed = 0;
1065 struct net_device *dev = NULL;
1066 struct fec_enet_private *fep = NULL;
1067 fec_t *fecp = NULL;
1068 int i;
1069 int err = 0;
1070 int registered = 0;
1071 __u32 siel;
1072
1073 *devp = NULL;
1074
1075 switch (fpi->fec_no) {
1076 case 0:
1077 fecp = &((immap_t *) IMAP_ADDR)->im_cpm.cp_fec;
1078 break;
1079#ifdef CONFIG_DUET
1080 case 1:
1081 fecp = &((immap_t *) IMAP_ADDR)->im_cpm.cp_fec2;
1082 break;
1083#endif
1084 default:
1085 return -EINVAL;
1086 }
1087
1088 if (fec_8xx_version_printed++ == 0)
1089 printk(KERN_INFO "%s", version);
1090
1091 i = sizeof(*fep) + (sizeof(struct sk_buff **) *
1092 (fpi->rx_ring + fpi->tx_ring));
1093
1094 dev = alloc_etherdev(i);
1095 if (!dev) {
1096 err = -ENOMEM;
1097 goto err;
1098 }
1099
1100 fep = netdev_priv(dev);
1101 fep->dev = dev;
1102
1103 /* partial reset of FEC */
1104 fec_whack_reset(fecp);
1105
1106 /* point rx_skbuff, tx_skbuff */
1107 fep->rx_skbuff = (struct sk_buff **)&fep[1];
1108 fep->tx_skbuff = fep->rx_skbuff + fpi->rx_ring;
1109
1110 fep->fecp = fecp;
1111 fep->fpi = fpi;
1112
1113 /* init locks */
1114 spin_lock_init(&fep->lock);
1115 spin_lock_init(&fep->tx_lock);
1116
1117 /*
1118 * Set the Ethernet address.
1119 */
1120 for (i = 0; i < 6; i++)
1121 dev->dev_addr[i] = fpi->macaddr[i];
1122
1123 fep->ring_base = dma_alloc_coherent(NULL,
1124 (fpi->tx_ring + fpi->rx_ring) *
1125 sizeof(cbd_t), &fep->ring_mem_addr,
1126 GFP_KERNEL);
1127 if (fep->ring_base == NULL) {
1128 printk(KERN_ERR DRV_MODULE_NAME
1129 ": %s dma alloc failed.\n", dev->name);
1130 err = -ENOMEM;
1131 goto err;
1132 }
1133
1134 /*
1135 * Set receive and transmit descriptor base.
1136 */
1137 fep->rx_bd_base = fep->ring_base;
1138 fep->tx_bd_base = fep->rx_bd_base + fpi->rx_ring;
1139
1140 /* initialize ring size variables */
1141 fep->tx_ring = fpi->tx_ring;
1142 fep->rx_ring = fpi->rx_ring;
1143
1144 /* SIU interrupt */
1145 if (fpi->phy_irq != -1 &&
1146 (fpi->phy_irq >= SIU_IRQ0 && fpi->phy_irq < SIU_LEVEL7)) {
1147
1148 siel = in_be32(&immap->im_siu_conf.sc_siel);
1149 if ((fpi->phy_irq & 1) == 0)
1150 siel |= (0x80000000 >> fpi->phy_irq);
1151 else
1152 siel &= ~(0x80000000 >> (fpi->phy_irq & ~1));
1153 out_be32(&immap->im_siu_conf.sc_siel, siel);
1154 }
1155
1156 /*
1157 * The FEC Ethernet specific entries in the device structure.
1158 */
1159 dev->open = fec_enet_open;
1160 dev->hard_start_xmit = fec_enet_start_xmit;
1161 dev->tx_timeout = fec_timeout;
1162 dev->watchdog_timeo = TX_TIMEOUT;
1163 dev->stop = fec_enet_close;
1164 dev->get_stats = fec_enet_get_stats;
1165 dev->set_multicast_list = fec_set_multicast_list;
1166 dev->set_mac_address = fec_set_mac_address;
1167 netif_napi_add(dev, &fec->napi,
1168 fec_enet_poll, fpi->napi_weight);
1169
1170 dev->ethtool_ops = &fec_ethtool_ops;
1171 dev->do_ioctl = fec_ioctl;
1172
1173 fep->fec_phy_speed =
1174 ((((fpi->sys_clk + 4999999) / 2500000) / 2) & 0x3F) << 1;
1175
1176 init_timer(&fep->phy_timer_list);
1177
1178 /* partial reset of FEC so that only MII works */
1179 FW(fecp, mii_speed, fep->fec_phy_speed);
1180 FW(fecp, ievent, 0xffc0);
1181 FW(fecp, ivec, (fpi->fec_irq / 2) << 29);
1182 FW(fecp, imask, 0);
1183 FW(fecp, r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */
1184 FW(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN);
1185
1186 netif_carrier_off(dev);
1187
1188 err = register_netdev(dev);
1189 if (err != 0)
1190 goto err;
1191 registered = 1;
1192
1193 if (fpi->use_mdio) {
1194 fep->mii_if.dev = dev;
1195 fep->mii_if.mdio_read = fec_mii_read;
1196 fep->mii_if.mdio_write = fec_mii_write;
1197 fep->mii_if.phy_id_mask = 0x1f;
1198 fep->mii_if.reg_num_mask = 0x1f;
1199 fep->mii_if.phy_id = fec_mii_phy_id_detect(dev);
1200 }
1201
1202 *devp = dev;
1203
1204 return 0;
1205
1206 err:
1207 if (dev != NULL) {
1208 if (fecp != NULL)
1209 fec_whack_reset(fecp);
1210
1211 if (registered)
1212 unregister_netdev(dev);
1213
1214 if (fep != NULL) {
1215 if (fep->ring_base)
1216 dma_free_coherent(NULL,
1217 (fpi->tx_ring +
1218 fpi->rx_ring) *
1219 sizeof(cbd_t), fep->ring_base,
1220 fep->ring_mem_addr);
1221 }
1222 free_netdev(dev);
1223 }
1224 return err;
1225}
1226
1227int fec_8xx_cleanup_one(struct net_device *dev)
1228{
1229 struct fec_enet_private *fep = netdev_priv(dev);
1230 fec_t *fecp = fep->fecp;
1231 const struct fec_platform_info *fpi = fep->fpi;
1232
1233 fec_whack_reset(fecp);
1234
1235 unregister_netdev(dev);
1236
1237 dma_free_coherent(NULL, (fpi->tx_ring + fpi->rx_ring) * sizeof(cbd_t),
1238 fep->ring_base, fep->ring_mem_addr);
1239
1240 free_netdev(dev);
1241
1242 return 0;
1243}
1244
1245/**************************************************************************************/
1246/**************************************************************************************/
1247/**************************************************************************************/
1248
1249static int __init fec_8xx_init(void)
1250{
1251 return fec_8xx_platform_init();
1252}
1253
1254static void __exit fec_8xx_cleanup(void)
1255{
1256 fec_8xx_platform_cleanup();
1257}
1258
1259/**************************************************************************************/
1260/**************************************************************************************/
1261/**************************************************************************************/
1262
1263module_init(fec_8xx_init);
1264module_exit(fec_8xx_cleanup);
diff --git a/drivers/net/fec_8xx/fec_mii.c b/drivers/net/fec_8xx/fec_mii.c
deleted file mode 100644
index 3b6ca29d31f2..000000000000
--- a/drivers/net/fec_8xx/fec_mii.c
+++ /dev/null
@@ -1,418 +0,0 @@
1/*
2 * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx.
3 *
4 * Copyright (c) 2003 Intracom S.A.
5 * by Pantelis Antoniou <panto@intracom.gr>
6 *
7 * Heavily based on original FEC driver by Dan Malek <dan@embeddededge.com>
8 * and modifications by Joakim Tjernlund <joakim.tjernlund@lumentis.se>
9 *
10 * Released under the GPL
11 */
12
13#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/ptrace.h>
18#include <linux/errno.h>
19#include <linux/ioport.h>
20#include <linux/slab.h>
21#include <linux/interrupt.h>
22#include <linux/init.h>
23#include <linux/delay.h>
24#include <linux/netdevice.h>
25#include <linux/etherdevice.h>
26#include <linux/skbuff.h>
27#include <linux/spinlock.h>
28#include <linux/mii.h>
29#include <linux/ethtool.h>
30#include <linux/bitops.h>
31
32#include <asm/8xx_immap.h>
33#include <asm/pgtable.h>
34#include <asm/mpc8xx.h>
35#include <asm/irq.h>
36#include <asm/uaccess.h>
37#include <asm/cpm1.h>
38
39/*************************************************/
40
41#include "fec_8xx.h"
42
43/*************************************************/
44
45/* Make MII read/write commands for the FEC.
46*/
47#define mk_mii_read(REG) (0x60020000 | ((REG & 0x1f) << 18))
48#define mk_mii_write(REG, VAL) (0x50020000 | ((REG & 0x1f) << 18) | (VAL & 0xffff))
49#define mk_mii_end 0
50
51/*************************************************/
52
53/* XXX both FECs use the MII interface of FEC1 */
54static DEFINE_SPINLOCK(fec_mii_lock);
55
56#define FEC_MII_LOOPS 10000
57
58int fec_mii_read(struct net_device *dev, int phy_id, int location)
59{
60 struct fec_enet_private *fep = netdev_priv(dev);
61 fec_t *fecp;
62 int i, ret = -1;
63 unsigned long flags;
64
65 /* XXX MII interface is only connected to FEC1 */
66 fecp = &((immap_t *) IMAP_ADDR)->im_cpm.cp_fec;
67
68 spin_lock_irqsave(&fec_mii_lock, flags);
69
70 if ((FR(fecp, r_cntrl) & FEC_RCNTRL_MII_MODE) == 0) {
71 FS(fecp, r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */
72 FS(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN);
73 FW(fecp, ievent, FEC_ENET_MII);
74 }
75
76 /* Add PHY address to register command. */
77 FW(fecp, mii_speed, fep->fec_phy_speed);
78 FW(fecp, mii_data, (phy_id << 23) | mk_mii_read(location));
79
80 for (i = 0; i < FEC_MII_LOOPS; i++)
81 if ((FR(fecp, ievent) & FEC_ENET_MII) != 0)
82 break;
83
84 if (i < FEC_MII_LOOPS) {
85 FW(fecp, ievent, FEC_ENET_MII);
86 ret = FR(fecp, mii_data) & 0xffff;
87 }
88
89 spin_unlock_irqrestore(&fec_mii_lock, flags);
90
91 return ret;
92}
93
94void fec_mii_write(struct net_device *dev, int phy_id, int location, int value)
95{
96 struct fec_enet_private *fep = netdev_priv(dev);
97 fec_t *fecp;
98 unsigned long flags;
99 int i;
100
101 /* XXX MII interface is only connected to FEC1 */
102 fecp = &((immap_t *) IMAP_ADDR)->im_cpm.cp_fec;
103
104 spin_lock_irqsave(&fec_mii_lock, flags);
105
106 if ((FR(fecp, r_cntrl) & FEC_RCNTRL_MII_MODE) == 0) {
107 FS(fecp, r_cntrl, FEC_RCNTRL_MII_MODE); /* MII enable */
108 FS(fecp, ecntrl, FEC_ECNTRL_PINMUX | FEC_ECNTRL_ETHER_EN);
109 FW(fecp, ievent, FEC_ENET_MII);
110 }
111
112 /* Add PHY address to register command. */
113 FW(fecp, mii_speed, fep->fec_phy_speed); /* always adapt mii speed */
114 FW(fecp, mii_data, (phy_id << 23) | mk_mii_write(location, value));
115
116 for (i = 0; i < FEC_MII_LOOPS; i++)
117 if ((FR(fecp, ievent) & FEC_ENET_MII) != 0)
118 break;
119
120 if (i < FEC_MII_LOOPS)
121 FW(fecp, ievent, FEC_ENET_MII);
122
123 spin_unlock_irqrestore(&fec_mii_lock, flags);
124}
125
126/*************************************************/
127
128#ifdef CONFIG_FEC_8XX_GENERIC_PHY
129
130/*
131 * Generic PHY support.
132 * Should work for all PHYs, but link change is detected by polling
133 */
134
135static void generic_timer_callback(unsigned long data)
136{
137 struct net_device *dev = (struct net_device *)data;
138 struct fec_enet_private *fep = netdev_priv(dev);
139
140 fep->phy_timer_list.expires = jiffies + HZ / 2;
141
142 add_timer(&fep->phy_timer_list);
143
144 fec_mii_link_status_change_check(dev, 0);
145}
146
147static void generic_startup(struct net_device *dev)
148{
149 struct fec_enet_private *fep = netdev_priv(dev);
150
151 fep->phy_timer_list.expires = jiffies + HZ / 2; /* every 500ms */
152 fep->phy_timer_list.data = (unsigned long)dev;
153 fep->phy_timer_list.function = generic_timer_callback;
154 add_timer(&fep->phy_timer_list);
155}
156
157static void generic_shutdown(struct net_device *dev)
158{
159 struct fec_enet_private *fep = netdev_priv(dev);
160
161 del_timer_sync(&fep->phy_timer_list);
162}
163
164#endif
165
166#ifdef CONFIG_FEC_8XX_DM9161_PHY
167
168/* ------------------------------------------------------------------------- */
169/* The Davicom DM9161 is used on the NETTA board */
170
171/* register definitions */
172
173#define MII_DM9161_ACR 16 /* Aux. Config Register */
174#define MII_DM9161_ACSR 17 /* Aux. Config/Status Register */
175#define MII_DM9161_10TCSR 18 /* 10BaseT Config/Status Reg. */
176#define MII_DM9161_INTR 21 /* Interrupt Register */
177#define MII_DM9161_RECR 22 /* Receive Error Counter Reg. */
178#define MII_DM9161_DISCR 23 /* Disconnect Counter Register */
179
180static void dm9161_startup(struct net_device *dev)
181{
182 struct fec_enet_private *fep = netdev_priv(dev);
183
184 fec_mii_write(dev, fep->mii_if.phy_id, MII_DM9161_INTR, 0x0000);
185}
186
187static void dm9161_ack_int(struct net_device *dev)
188{
189 struct fec_enet_private *fep = netdev_priv(dev);
190
191 fec_mii_read(dev, fep->mii_if.phy_id, MII_DM9161_INTR);
192}
193
194static void dm9161_shutdown(struct net_device *dev)
195{
196 struct fec_enet_private *fep = netdev_priv(dev);
197
198 fec_mii_write(dev, fep->mii_if.phy_id, MII_DM9161_INTR, 0x0f00);
199}
200
201#endif
202
203#ifdef CONFIG_FEC_8XX_LXT971_PHY
204
205/* Support for LXT971/972 PHY */
206
207#define MII_LXT971_PCR 16 /* Port Control Register */
208#define MII_LXT971_SR2 17 /* Status Register 2 */
209#define MII_LXT971_IER 18 /* Interrupt Enable Register */
210#define MII_LXT971_ISR 19 /* Interrupt Status Register */
211#define MII_LXT971_LCR 20 /* LED Control Register */
212#define MII_LXT971_TCR 30 /* Transmit Control Register */
213
214static void lxt971_startup(struct net_device *dev)
215{
216 struct fec_enet_private *fep = netdev_priv(dev);
217
218 fec_mii_write(dev, fep->mii_if.phy_id, MII_LXT971_IER, 0x00F2);
219}
220
221static void lxt971_ack_int(struct net_device *dev)
222{
223 struct fec_enet_private *fep = netdev_priv(dev);
224
225 fec_mii_read(dev, fep->mii_if.phy_id, MII_LXT971_ISR);
226}
227
228static void lxt971_shutdown(struct net_device *dev)
229{
230 struct fec_enet_private *fep = netdev_priv(dev);
231
232 fec_mii_write(dev, fep->mii_if.phy_id, MII_LXT971_IER, 0x0000);
233}
234#endif
235
236/**********************************************************************************/
237
238static const struct phy_info phy_info[] = {
239#ifdef CONFIG_FEC_8XX_DM9161_PHY
240 {
241 .id = 0x00181b88,
242 .name = "DM9161",
243 .startup = dm9161_startup,
244 .ack_int = dm9161_ack_int,
245 .shutdown = dm9161_shutdown,
246 },
247#endif
248#ifdef CONFIG_FEC_8XX_LXT971_PHY
249 {
250 .id = 0x0001378e,
251 .name = "LXT971/972",
252 .startup = lxt971_startup,
253 .ack_int = lxt971_ack_int,
254 .shutdown = lxt971_shutdown,
255 },
256#endif
257#ifdef CONFIG_FEC_8XX_GENERIC_PHY
258 {
259 .id = 0,
260 .name = "GENERIC",
261 .startup = generic_startup,
262 .shutdown = generic_shutdown,
263 },
264#endif
265};
266
267/**********************************************************************************/
268
269int fec_mii_phy_id_detect(struct net_device *dev)
270{
271 struct fec_enet_private *fep = netdev_priv(dev);
272 const struct fec_platform_info *fpi = fep->fpi;
273 int i, r, start, end, phytype, physubtype;
274 const struct phy_info *phy;
275 int phy_hwid, phy_id;
276
277 /* if no MDIO */
278 if (fpi->use_mdio == 0)
279 return -1;
280
281 phy_hwid = -1;
282 fep->phy = NULL;
283
284 /* auto-detect? */
285 if (fpi->phy_addr == -1) {
286 start = 0;
287 end = 32;
288 } else { /* direct */
289 start = fpi->phy_addr;
290 end = start + 1;
291 }
292
293 for (phy_id = start; phy_id < end; phy_id++) {
294 r = fec_mii_read(dev, phy_id, MII_PHYSID1);
295 if (r == -1 || (phytype = (r & 0xffff)) == 0xffff)
296 continue;
297 r = fec_mii_read(dev, phy_id, MII_PHYSID2);
298 if (r == -1 || (physubtype = (r & 0xffff)) == 0xffff)
299 continue;
300 phy_hwid = (phytype << 16) | physubtype;
301 if (phy_hwid != -1)
302 break;
303 }
304
305 if (phy_hwid == -1) {
306 printk(KERN_ERR DRV_MODULE_NAME
307 ": %s No PHY detected!\n", dev->name);
308 return -1;
309 }
310
311 for (i = 0, phy = phy_info; i < ARRAY_SIZE(phy_info); i++, phy++)
312 if (phy->id == (phy_hwid >> 4) || phy->id == 0)
313 break;
314
315 if (i >= ARRAY_SIZE(phy_info)) {
316 printk(KERN_ERR DRV_MODULE_NAME
317 ": %s PHY id 0x%08x is not supported!\n",
318 dev->name, phy_hwid);
319 return -1;
320 }
321
322 fep->phy = phy;
323
324 printk(KERN_INFO DRV_MODULE_NAME
325 ": %s Phy @ 0x%x, type %s (0x%08x)\n",
326 dev->name, phy_id, fep->phy->name, phy_hwid);
327
328 return phy_id;
329}
330
331void fec_mii_startup(struct net_device *dev)
332{
333 struct fec_enet_private *fep = netdev_priv(dev);
334 const struct fec_platform_info *fpi = fep->fpi;
335
336 if (!fpi->use_mdio || fep->phy == NULL)
337 return;
338
339 if (fep->phy->startup == NULL)
340 return;
341
342 (*fep->phy->startup) (dev);
343}
344
345void fec_mii_shutdown(struct net_device *dev)
346{
347 struct fec_enet_private *fep = netdev_priv(dev);
348 const struct fec_platform_info *fpi = fep->fpi;
349
350 if (!fpi->use_mdio || fep->phy == NULL)
351 return;
352
353 if (fep->phy->shutdown == NULL)
354 return;
355
356 (*fep->phy->shutdown) (dev);
357}
358
359void fec_mii_ack_int(struct net_device *dev)
360{
361 struct fec_enet_private *fep = netdev_priv(dev);
362 const struct fec_platform_info *fpi = fep->fpi;
363
364 if (!fpi->use_mdio || fep->phy == NULL)
365 return;
366
367 if (fep->phy->ack_int == NULL)
368 return;
369
370 (*fep->phy->ack_int) (dev);
371}
372
373/* helper function */
374static int mii_negotiated(struct mii_if_info *mii)
375{
376 int advert, lpa, val;
377
378 if (!mii_link_ok(mii))
379 return 0;
380
381 val = (*mii->mdio_read) (mii->dev, mii->phy_id, MII_BMSR);
382 if ((val & BMSR_ANEGCOMPLETE) == 0)
383 return 0;
384
385 advert = (*mii->mdio_read) (mii->dev, mii->phy_id, MII_ADVERTISE);
386 lpa = (*mii->mdio_read) (mii->dev, mii->phy_id, MII_LPA);
387
388 return mii_nway_result(advert & lpa);
389}
390
391void fec_mii_link_status_change_check(struct net_device *dev, int init_media)
392{
393 struct fec_enet_private *fep = netdev_priv(dev);
394 unsigned int media;
395 unsigned long flags;
396
397 if (mii_check_media(&fep->mii_if, netif_msg_link(fep), init_media) == 0)
398 return;
399
400 media = mii_negotiated(&fep->mii_if);
401
402 if (netif_carrier_ok(dev)) {
403 spin_lock_irqsave(&fep->lock, flags);
404 fec_restart(dev, !!(media & ADVERTISE_FULL),
405 (media & (ADVERTISE_100FULL | ADVERTISE_100HALF)) ?
406 100 : 10);
407 spin_unlock_irqrestore(&fep->lock, flags);
408
409 netif_start_queue(dev);
410 } else {
411 netif_stop_queue(dev);
412
413 spin_lock_irqsave(&fep->lock, flags);
414 fec_stop(dev);
415 spin_unlock_irqrestore(&fep->lock, flags);
416
417 }
418}
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 2cb244763292..20d4fe96a81c 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -4194,12 +4194,23 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
4194 4194
4195 netif_carrier_off(dev); 4195 netif_carrier_off(dev);
4196 if (netif_running(dev)) { 4196 if (netif_running(dev)) {
4197 unsigned long flags;
4198
4197 nv_disable_irq(dev); 4199 nv_disable_irq(dev);
4198 netif_tx_lock_bh(dev); 4200 netif_tx_lock_bh(dev);
4199 spin_lock(&np->lock); 4201 /* with plain spinlock lockdep complains */
4202 spin_lock_irqsave(&np->lock, flags);
4200 /* stop engines */ 4203 /* stop engines */
4204 /* FIXME:
4205 * this can take some time, and interrupts are disabled
4206 * due to spin_lock_irqsave, but let's hope no daemon
4207 * is going to change the settings very often...
4208 * Worst case:
4209 * NV_RXSTOP_DELAY1MAX + NV_TXSTOP_DELAY1MAX
4210 * + some minor delays, which is up to a second approximately
4211 */
4201 nv_stop_rxtx(dev); 4212 nv_stop_rxtx(dev);
4202 spin_unlock(&np->lock); 4213 spin_unlock_irqrestore(&np->lock, flags);
4203 netif_tx_unlock_bh(dev); 4214 netif_tx_unlock_bh(dev);
4204 } 4215 }
4205 4216
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index a5baaf59ff66..352574a3f056 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -43,7 +43,7 @@
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44 44
45#ifdef CONFIG_PPC_CPM_NEW_BINDING 45#ifdef CONFIG_PPC_CPM_NEW_BINDING
46#include <asm/of_platform.h> 46#include <linux/of_platform.h>
47#endif 47#endif
48 48
49#include "fs_enet.h" 49#include "fs_enet.h"
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c
index e36321152d50..8268b3535b30 100644
--- a/drivers/net/fs_enet/mac-fcc.c
+++ b/drivers/net/fs_enet/mac-fcc.c
@@ -463,6 +463,9 @@ static void restart(struct net_device *dev)
463 else 463 else
464 C32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB); 464 C32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB);
465 465
466 /* Restore multicast and promiscuous settings */
467 set_multicast_list(dev);
468
466 S32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT); 469 S32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
467} 470}
468 471
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index d7ca31945c82..e3557eca7b6d 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -44,7 +44,7 @@
44#endif 44#endif
45 45
46#ifdef CONFIG_PPC_CPM_NEW_BINDING 46#ifdef CONFIG_PPC_CPM_NEW_BINDING
47#include <asm/of_platform.h> 47#include <linux/of_platform.h>
48#endif 48#endif
49 49
50#include "fs_enet.h" 50#include "fs_enet.h"
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c
index f0014cfbb275..8f6a43b0e0ff 100644
--- a/drivers/net/fs_enet/mii-fec.c
+++ b/drivers/net/fs_enet/mii-fec.c
@@ -37,7 +37,7 @@
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38 38
39#ifdef CONFIG_PPC_CPM_NEW_BINDING 39#ifdef CONFIG_PPC_CPM_NEW_BINDING
40#include <asm/of_platform.h> 40#include <linux/of_platform.h>
41#endif 41#endif
42 42
43#include "fs_enet.h" 43#include "fs_enet.h"
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c
index 0b94833e23f7..e8cfadefa4b6 100644
--- a/drivers/net/hamradio/dmascc.c
+++ b/drivers/net/hamradio/dmascc.c
@@ -1077,8 +1077,6 @@ static inline void rx_off(struct scc_priv *priv)
1077 1077
1078static void start_timer(struct scc_priv *priv, int t, int r15) 1078static void start_timer(struct scc_priv *priv, int t, int r15)
1079{ 1079{
1080 unsigned long flags;
1081
1082 outb(priv->tmr_mode, priv->tmr_ctrl); 1080 outb(priv->tmr_mode, priv->tmr_ctrl);
1083 if (t == 0) { 1081 if (t == 0) {
1084 tm_isr(priv); 1082 tm_isr(priv);
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index 5d2108c5ac7c..61af02b4c9d8 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -363,25 +363,31 @@ static int emac_reset(struct emac_instance *dev)
363 363
364static void emac_hash_mc(struct emac_instance *dev) 364static void emac_hash_mc(struct emac_instance *dev)
365{ 365{
366 struct emac_regs __iomem *p = dev->emacp; 366 const int regs = EMAC_XAHT_REGS(dev);
367 u16 gaht[4] = { 0 }; 367 u32 *gaht_base = emac_gaht_base(dev);
368 u32 gaht_temp[regs];
368 struct dev_mc_list *dmi; 369 struct dev_mc_list *dmi;
370 int i;
369 371
370 DBG(dev, "hash_mc %d" NL, dev->ndev->mc_count); 372 DBG(dev, "hash_mc %d" NL, dev->ndev->mc_count);
371 373
374 memset(gaht_temp, 0, sizeof (gaht_temp));
375
372 for (dmi = dev->ndev->mc_list; dmi; dmi = dmi->next) { 376 for (dmi = dev->ndev->mc_list; dmi; dmi = dmi->next) {
373 int bit; 377 int slot, reg, mask;
374 DBG2(dev, "mc %02x:%02x:%02x:%02x:%02x:%02x" NL, 378 DBG2(dev, "mc %02x:%02x:%02x:%02x:%02x:%02x" NL,
375 dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2], 379 dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2],
376 dmi->dmi_addr[3], dmi->dmi_addr[4], dmi->dmi_addr[5]); 380 dmi->dmi_addr[3], dmi->dmi_addr[4], dmi->dmi_addr[5]);
377 381
378 bit = 63 - (ether_crc(ETH_ALEN, dmi->dmi_addr) >> 26); 382 slot = EMAC_XAHT_CRC_TO_SLOT(dev, ether_crc(ETH_ALEN, dmi->dmi_addr));
379 gaht[bit >> 4] |= 0x8000 >> (bit & 0x0f); 383 reg = EMAC_XAHT_SLOT_TO_REG(dev, slot);
384 mask = EMAC_XAHT_SLOT_TO_MASK(dev, slot);
385
386 gaht_temp[reg] |= mask;
380 } 387 }
381 out_be32(&p->gaht1, gaht[0]); 388
382 out_be32(&p->gaht2, gaht[1]); 389 for (i = 0; i < regs; i++)
383 out_be32(&p->gaht3, gaht[2]); 390 out_be32(gaht_base + i, gaht_temp[i]);
384 out_be32(&p->gaht4, gaht[3]);
385} 391}
386 392
387static inline u32 emac_iff2rmr(struct net_device *ndev) 393static inline u32 emac_iff2rmr(struct net_device *ndev)
@@ -398,7 +404,8 @@ static inline u32 emac_iff2rmr(struct net_device *ndev)
398 404
399 if (ndev->flags & IFF_PROMISC) 405 if (ndev->flags & IFF_PROMISC)
400 r |= EMAC_RMR_PME; 406 r |= EMAC_RMR_PME;
401 else if (ndev->flags & IFF_ALLMULTI || ndev->mc_count > 32) 407 else if (ndev->flags & IFF_ALLMULTI ||
408 (ndev->mc_count > EMAC_XAHT_SLOTS(dev)))
402 r |= EMAC_RMR_PMME; 409 r |= EMAC_RMR_PMME;
403 else if (ndev->mc_count > 0) 410 else if (ndev->mc_count > 0)
404 r |= EMAC_RMR_MAE; 411 r |= EMAC_RMR_MAE;
@@ -542,7 +549,7 @@ static int emac_configure(struct emac_instance *dev)
542 /* Put some arbitrary OUI, Manuf & Rev IDs so we can 549 /* Put some arbitrary OUI, Manuf & Rev IDs so we can
543 * identify this GPCS PHY later. 550 * identify this GPCS PHY later.
544 */ 551 */
545 out_be32(&p->ipcr, 0xdeadbeef); 552 out_be32(&p->u1.emac4.ipcr, 0xdeadbeef);
546 } else 553 } else
547 mr1 |= EMAC_MR1_MF_1000; 554 mr1 |= EMAC_MR1_MF_1000;
548 555
@@ -1636,6 +1643,12 @@ static int emac_poll_rx(void *param, int budget)
1636 goto next; 1643 goto next;
1637 } 1644 }
1638 1645
1646 if (len < ETH_HLEN) {
1647 ++dev->estats.rx_dropped_stack;
1648 emac_recycle_rx_skb(dev, slot, len);
1649 goto next;
1650 }
1651
1639 if (len && len < EMAC_RX_COPY_THRESH) { 1652 if (len && len < EMAC_RX_COPY_THRESH) {
1640 struct sk_buff *copy_skb = 1653 struct sk_buff *copy_skb =
1641 alloc_skb(len + EMAC_RX_SKB_HEADROOM + 2, GFP_ATOMIC); 1654 alloc_skb(len + EMAC_RX_SKB_HEADROOM + 2, GFP_ATOMIC);
@@ -2015,10 +2028,10 @@ static int emac_get_regs_len(struct emac_instance *dev)
2015{ 2028{
2016 if (emac_has_feature(dev, EMAC_FTR_EMAC4)) 2029 if (emac_has_feature(dev, EMAC_FTR_EMAC4))
2017 return sizeof(struct emac_ethtool_regs_subhdr) + 2030 return sizeof(struct emac_ethtool_regs_subhdr) +
2018 EMAC4_ETHTOOL_REGS_SIZE; 2031 EMAC4_ETHTOOL_REGS_SIZE(dev);
2019 else 2032 else
2020 return sizeof(struct emac_ethtool_regs_subhdr) + 2033 return sizeof(struct emac_ethtool_regs_subhdr) +
2021 EMAC_ETHTOOL_REGS_SIZE; 2034 EMAC_ETHTOOL_REGS_SIZE(dev);
2022} 2035}
2023 2036
2024static int emac_ethtool_get_regs_len(struct net_device *ndev) 2037static int emac_ethtool_get_regs_len(struct net_device *ndev)
@@ -2045,12 +2058,12 @@ static void *emac_dump_regs(struct emac_instance *dev, void *buf)
2045 hdr->index = dev->cell_index; 2058 hdr->index = dev->cell_index;
2046 if (emac_has_feature(dev, EMAC_FTR_EMAC4)) { 2059 if (emac_has_feature(dev, EMAC_FTR_EMAC4)) {
2047 hdr->version = EMAC4_ETHTOOL_REGS_VER; 2060 hdr->version = EMAC4_ETHTOOL_REGS_VER;
2048 memcpy_fromio(hdr + 1, dev->emacp, EMAC4_ETHTOOL_REGS_SIZE); 2061 memcpy_fromio(hdr + 1, dev->emacp, EMAC4_ETHTOOL_REGS_SIZE(dev));
2049 return ((void *)(hdr + 1) + EMAC4_ETHTOOL_REGS_SIZE); 2062 return ((void *)(hdr + 1) + EMAC4_ETHTOOL_REGS_SIZE(dev));
2050 } else { 2063 } else {
2051 hdr->version = EMAC_ETHTOOL_REGS_VER; 2064 hdr->version = EMAC_ETHTOOL_REGS_VER;
2052 memcpy_fromio(hdr + 1, dev->emacp, EMAC_ETHTOOL_REGS_SIZE); 2065 memcpy_fromio(hdr + 1, dev->emacp, EMAC_ETHTOOL_REGS_SIZE(dev));
2053 return ((void *)(hdr + 1) + EMAC_ETHTOOL_REGS_SIZE); 2066 return ((void *)(hdr + 1) + EMAC_ETHTOOL_REGS_SIZE(dev));
2054 } 2067 }
2055} 2068}
2056 2069
@@ -2540,7 +2553,9 @@ static int __devinit emac_init_config(struct emac_instance *dev)
2540 } 2553 }
2541 2554
2542 /* Check EMAC version */ 2555 /* Check EMAC version */
2543 if (of_device_is_compatible(np, "ibm,emac4")) { 2556 if (of_device_is_compatible(np, "ibm,emac4sync")) {
2557 dev->features |= (EMAC_FTR_EMAC4 | EMAC_FTR_EMAC4SYNC);
2558 } else if (of_device_is_compatible(np, "ibm,emac4")) {
2544 dev->features |= EMAC_FTR_EMAC4; 2559 dev->features |= EMAC_FTR_EMAC4;
2545 if (of_device_is_compatible(np, "ibm,emac-440gx")) 2560 if (of_device_is_compatible(np, "ibm,emac-440gx"))
2546 dev->features |= EMAC_FTR_440GX_PHY_CLK_FIX; 2561 dev->features |= EMAC_FTR_440GX_PHY_CLK_FIX;
@@ -2601,6 +2616,15 @@ static int __devinit emac_init_config(struct emac_instance *dev)
2601 } 2616 }
2602 memcpy(dev->ndev->dev_addr, p, 6); 2617 memcpy(dev->ndev->dev_addr, p, 6);
2603 2618
2619 /* IAHT and GAHT filter parameterization */
2620 if (emac_has_feature(dev, EMAC_FTR_EMAC4SYNC)) {
2621 dev->xaht_slots_shift = EMAC4SYNC_XAHT_SLOTS_SHIFT;
2622 dev->xaht_width_shift = EMAC4SYNC_XAHT_WIDTH_SHIFT;
2623 } else {
2624 dev->xaht_slots_shift = EMAC4_XAHT_SLOTS_SHIFT;
2625 dev->xaht_width_shift = EMAC4_XAHT_WIDTH_SHIFT;
2626 }
2627
2604 DBG(dev, "features : 0x%08x / 0x%08x\n", dev->features, EMAC_FTRS_POSSIBLE); 2628 DBG(dev, "features : 0x%08x / 0x%08x\n", dev->features, EMAC_FTRS_POSSIBLE);
2605 DBG(dev, "tx_fifo_size : %d (%d gige)\n", dev->tx_fifo_size, dev->tx_fifo_size_gige); 2629 DBG(dev, "tx_fifo_size : %d (%d gige)\n", dev->tx_fifo_size, dev->tx_fifo_size_gige);
2606 DBG(dev, "rx_fifo_size : %d (%d gige)\n", dev->rx_fifo_size, dev->rx_fifo_size_gige); 2630 DBG(dev, "rx_fifo_size : %d (%d gige)\n", dev->rx_fifo_size, dev->rx_fifo_size_gige);
@@ -2672,7 +2696,8 @@ static int __devinit emac_probe(struct of_device *ofdev,
2672 goto err_irq_unmap; 2696 goto err_irq_unmap;
2673 } 2697 }
2674 // TODO : request_mem_region 2698 // TODO : request_mem_region
2675 dev->emacp = ioremap(dev->rsrc_regs.start, sizeof(struct emac_regs)); 2699 dev->emacp = ioremap(dev->rsrc_regs.start,
2700 dev->rsrc_regs.end - dev->rsrc_regs.start + 1);
2676 if (dev->emacp == NULL) { 2701 if (dev->emacp == NULL) {
2677 printk(KERN_ERR "%s: Can't map device registers!\n", 2702 printk(KERN_ERR "%s: Can't map device registers!\n",
2678 np->full_name); 2703 np->full_name);
@@ -2719,6 +2744,8 @@ static int __devinit emac_probe(struct of_device *ofdev,
2719 /* Clean rings */ 2744 /* Clean rings */
2720 memset(dev->tx_desc, 0, NUM_TX_BUFF * sizeof(struct mal_descriptor)); 2745 memset(dev->tx_desc, 0, NUM_TX_BUFF * sizeof(struct mal_descriptor));
2721 memset(dev->rx_desc, 0, NUM_RX_BUFF * sizeof(struct mal_descriptor)); 2746 memset(dev->rx_desc, 0, NUM_RX_BUFF * sizeof(struct mal_descriptor));
2747 memset(dev->tx_skb, 0, NUM_TX_BUFF * sizeof(struct sk_buff *));
2748 memset(dev->rx_skb, 0, NUM_RX_BUFF * sizeof(struct sk_buff *));
2722 2749
2723 /* Attach to ZMII, if needed */ 2750 /* Attach to ZMII, if needed */
2724 if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII) && 2751 if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII) &&
@@ -2884,6 +2911,10 @@ static struct of_device_id emac_match[] =
2884 .type = "network", 2911 .type = "network",
2885 .compatible = "ibm,emac4", 2912 .compatible = "ibm,emac4",
2886 }, 2913 },
2914 {
2915 .type = "network",
2916 .compatible = "ibm,emac4sync",
2917 },
2887 {}, 2918 {},
2888}; 2919};
2889 2920
diff --git a/drivers/net/ibm_newemac/core.h b/drivers/net/ibm_newemac/core.h
index 1683db9870a4..6545e69d12c3 100644
--- a/drivers/net/ibm_newemac/core.h
+++ b/drivers/net/ibm_newemac/core.h
@@ -33,8 +33,8 @@
33#include <linux/netdevice.h> 33#include <linux/netdevice.h>
34#include <linux/dma-mapping.h> 34#include <linux/dma-mapping.h>
35#include <linux/spinlock.h> 35#include <linux/spinlock.h>
36#include <linux/of_platform.h>
36 37
37#include <asm/of_platform.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/dcr.h> 39#include <asm/dcr.h>
40 40
@@ -235,6 +235,10 @@ struct emac_instance {
235 u32 fifo_entry_size; 235 u32 fifo_entry_size;
236 u32 mal_burst_size; /* move to MAL ? */ 236 u32 mal_burst_size; /* move to MAL ? */
237 237
238 /* IAHT and GAHT filter parameterization */
239 u32 xaht_slots_shift;
240 u32 xaht_width_shift;
241
238 /* Descriptor management 242 /* Descriptor management
239 */ 243 */
240 struct mal_descriptor *tx_desc; 244 struct mal_descriptor *tx_desc;
@@ -309,6 +313,10 @@ struct emac_instance {
309 * Set if we need phy clock workaround for 440ep or 440gr 313 * Set if we need phy clock workaround for 440ep or 440gr
310 */ 314 */
311#define EMAC_FTR_440EP_PHY_CLK_FIX 0x00000100 315#define EMAC_FTR_440EP_PHY_CLK_FIX 0x00000100
316/*
317 * The 405EX and 460EX contain the EMAC4SYNC core
318 */
319#define EMAC_FTR_EMAC4SYNC 0x00000200
312 320
313 321
314/* Right now, we don't quite handle the always/possible masks on the 322/* Right now, we don't quite handle the always/possible masks on the
@@ -320,7 +328,8 @@ enum {
320 328
321 EMAC_FTRS_POSSIBLE = 329 EMAC_FTRS_POSSIBLE =
322#ifdef CONFIG_IBM_NEW_EMAC_EMAC4 330#ifdef CONFIG_IBM_NEW_EMAC_EMAC4
323 EMAC_FTR_EMAC4 | EMAC_FTR_HAS_NEW_STACR | 331 EMAC_FTR_EMAC4 | EMAC_FTR_EMAC4SYNC |
332 EMAC_FTR_HAS_NEW_STACR |
324 EMAC_FTR_STACR_OC_INVERT | EMAC_FTR_440GX_PHY_CLK_FIX | 333 EMAC_FTR_STACR_OC_INVERT | EMAC_FTR_440GX_PHY_CLK_FIX |
325#endif 334#endif
326#ifdef CONFIG_IBM_NEW_EMAC_TAH 335#ifdef CONFIG_IBM_NEW_EMAC_TAH
@@ -342,6 +351,71 @@ static inline int emac_has_feature(struct emac_instance *dev,
342 (EMAC_FTRS_POSSIBLE & dev->features & feature); 351 (EMAC_FTRS_POSSIBLE & dev->features & feature);
343} 352}
344 353
354/*
355 * Various instances of the EMAC core have varying 1) number of
356 * address match slots, 2) width of the registers for handling address
357 * match slots, 3) number of registers for handling address match
358 * slots and 4) base offset for those registers.
359 *
360 * These macros and inlines handle these differences based on
361 * parameters supplied by the device structure which are, in turn,
362 * initialized based on the "compatible" entry in the device tree.
363 */
364
365#define EMAC4_XAHT_SLOTS_SHIFT 6
366#define EMAC4_XAHT_WIDTH_SHIFT 4
367
368#define EMAC4SYNC_XAHT_SLOTS_SHIFT 8
369#define EMAC4SYNC_XAHT_WIDTH_SHIFT 5
370
371#define EMAC_XAHT_SLOTS(dev) (1 << (dev)->xaht_slots_shift)
372#define EMAC_XAHT_WIDTH(dev) (1 << (dev)->xaht_width_shift)
373#define EMAC_XAHT_REGS(dev) (1 << ((dev)->xaht_slots_shift - \
374 (dev)->xaht_width_shift))
375
376#define EMAC_XAHT_CRC_TO_SLOT(dev, crc) \
377 ((EMAC_XAHT_SLOTS(dev) - 1) - \
378 ((crc) >> ((sizeof (u32) * BITS_PER_BYTE) - \
379 (dev)->xaht_slots_shift)))
380
381#define EMAC_XAHT_SLOT_TO_REG(dev, slot) \
382 ((slot) >> (dev)->xaht_width_shift)
383
384#define EMAC_XAHT_SLOT_TO_MASK(dev, slot) \
385 ((u32)(1 << (EMAC_XAHT_WIDTH(dev) - 1)) >> \
386 ((slot) & (u32)(EMAC_XAHT_WIDTH(dev) - 1)))
387
388static inline u32 *emac_xaht_base(struct emac_instance *dev)
389{
390 struct emac_regs __iomem *p = dev->emacp;
391 int offset;
392
393 /* The first IAHT entry always is the base of the block of
394 * IAHT and GAHT registers.
395 */
396 if (emac_has_feature(dev, EMAC_FTR_EMAC4SYNC))
397 offset = offsetof(struct emac_regs, u1.emac4sync.iaht1);
398 else
399 offset = offsetof(struct emac_regs, u0.emac4.iaht1);
400
401 return ((u32 *)((ptrdiff_t)p + offset));
402}
403
404static inline u32 *emac_gaht_base(struct emac_instance *dev)
405{
406 /* GAHT registers always come after an identical number of
407 * IAHT registers.
408 */
409 return (emac_xaht_base(dev) + EMAC_XAHT_REGS(dev));
410}
411
412static inline u32 *emac_iaht_base(struct emac_instance *dev)
413{
414 /* IAHT registers always come before an identical number of
415 * GAHT registers.
416 */
417 return (emac_xaht_base(dev));
418}
345 419
346/* Ethtool get_regs complex data. 420/* Ethtool get_regs complex data.
347 * We want to get not just EMAC registers, but also MAL, ZMII, RGMII, TAH 421 * We want to get not just EMAC registers, but also MAL, ZMII, RGMII, TAH
@@ -366,4 +440,11 @@ struct emac_ethtool_regs_subhdr {
366 u32 index; 440 u32 index;
367}; 441};
368 442
443#define EMAC_ETHTOOL_REGS_VER 0
444#define EMAC_ETHTOOL_REGS_SIZE(dev) ((dev)->rsrc_regs.end - \
445 (dev)->rsrc_regs.start + 1)
446#define EMAC4_ETHTOOL_REGS_VER 1
447#define EMAC4_ETHTOOL_REGS_SIZE(dev) ((dev)->rsrc_regs.end - \
448 (dev)->rsrc_regs.start + 1)
449
369#endif /* __IBM_NEWEMAC_CORE_H */ 450#endif /* __IBM_NEWEMAC_CORE_H */
diff --git a/drivers/net/ibm_newemac/debug.c b/drivers/net/ibm_newemac/debug.c
index 86b756a30784..775c850a425a 100644
--- a/drivers/net/ibm_newemac/debug.c
+++ b/drivers/net/ibm_newemac/debug.c
@@ -67,29 +67,55 @@ static void emac_desc_dump(struct emac_instance *p)
67static void emac_mac_dump(struct emac_instance *dev) 67static void emac_mac_dump(struct emac_instance *dev)
68{ 68{
69 struct emac_regs __iomem *p = dev->emacp; 69 struct emac_regs __iomem *p = dev->emacp;
70 const int xaht_regs = EMAC_XAHT_REGS(dev);
71 u32 *gaht_base = emac_gaht_base(dev);
72 u32 *iaht_base = emac_iaht_base(dev);
73 int emac4sync = emac_has_feature(dev, EMAC_FTR_EMAC4SYNC);
74 int n;
70 75
71 printk("** EMAC %s registers **\n" 76 printk("** EMAC %s registers **\n"
72 "MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n" 77 "MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n"
73 "RMR = 0x%08x ISR = 0x%08x ISER = 0x%08x\n" 78 "RMR = 0x%08x ISR = 0x%08x ISER = 0x%08x\n"
74 "IAR = %04x%08x VTPID = 0x%04x VTCI = 0x%04x\n" 79 "IAR = %04x%08x VTPID = 0x%04x VTCI = 0x%04x\n",
75 "IAHT: 0x%04x 0x%04x 0x%04x 0x%04x "
76 "GAHT: 0x%04x 0x%04x 0x%04x 0x%04x\n"
77 "LSA = %04x%08x IPGVR = 0x%04x\n"
78 "STACR = 0x%08x TRTR = 0x%08x RWMR = 0x%08x\n"
79 "OCTX = 0x%08x OCRX = 0x%08x IPCR = 0x%08x\n",
80 dev->ofdev->node->full_name, in_be32(&p->mr0), in_be32(&p->mr1), 80 dev->ofdev->node->full_name, in_be32(&p->mr0), in_be32(&p->mr1),
81 in_be32(&p->tmr0), in_be32(&p->tmr1), 81 in_be32(&p->tmr0), in_be32(&p->tmr1),
82 in_be32(&p->rmr), in_be32(&p->isr), in_be32(&p->iser), 82 in_be32(&p->rmr), in_be32(&p->isr), in_be32(&p->iser),
83 in_be32(&p->iahr), in_be32(&p->ialr), in_be32(&p->vtpid), 83 in_be32(&p->iahr), in_be32(&p->ialr), in_be32(&p->vtpid),
84 in_be32(&p->vtci), 84 in_be32(&p->vtci)
85 in_be32(&p->iaht1), in_be32(&p->iaht2), in_be32(&p->iaht3), 85 );
86 in_be32(&p->iaht4), 86
87 in_be32(&p->gaht1), in_be32(&p->gaht2), in_be32(&p->gaht3), 87 if (emac4sync)
88 in_be32(&p->gaht4), 88 printk("MAR = %04x%08x MMAR = %04x%08x\n",
89 in_be32(&p->u0.emac4sync.mahr),
90 in_be32(&p->u0.emac4sync.malr),
91 in_be32(&p->u0.emac4sync.mmahr),
92 in_be32(&p->u0.emac4sync.mmalr)
93 );
94
95 for (n = 0; n < xaht_regs; n++)
96 printk("IAHT%02d = 0x%08x\n", n + 1, in_be32(iaht_base + n));
97
98 for (n = 0; n < xaht_regs; n++)
99 printk("GAHT%02d = 0x%08x\n", n + 1, in_be32(gaht_base + n));
100
101 printk("LSA = %04x%08x IPGVR = 0x%04x\n"
102 "STACR = 0x%08x TRTR = 0x%08x RWMR = 0x%08x\n"
103 "OCTX = 0x%08x OCRX = 0x%08x\n",
89 in_be32(&p->lsah), in_be32(&p->lsal), in_be32(&p->ipgvr), 104 in_be32(&p->lsah), in_be32(&p->lsal), in_be32(&p->ipgvr),
90 in_be32(&p->stacr), in_be32(&p->trtr), in_be32(&p->rwmr), 105 in_be32(&p->stacr), in_be32(&p->trtr), in_be32(&p->rwmr),
91 in_be32(&p->octx), in_be32(&p->ocrx), in_be32(&p->ipcr) 106 in_be32(&p->octx), in_be32(&p->ocrx)
92 ); 107 );
108
109 if (!emac4sync) {
110 printk("IPCR = 0x%08x\n",
111 in_be32(&p->u1.emac4.ipcr)
112 );
113 } else {
114 printk("REVID = 0x%08x TPC = 0x%08x\n",
115 in_be32(&p->u1.emac4sync.revid),
116 in_be32(&p->u1.emac4sync.tpc)
117 );
118 }
93 119
94 emac_desc_dump(dev); 120 emac_desc_dump(dev);
95} 121}
diff --git a/drivers/net/ibm_newemac/emac.h b/drivers/net/ibm_newemac/emac.h
index 91cb096ab405..0afc2cf5c52b 100644
--- a/drivers/net/ibm_newemac/emac.h
+++ b/drivers/net/ibm_newemac/emac.h
@@ -27,37 +27,80 @@
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29 29
30/* EMAC registers Write Access rules */ 30/* EMAC registers Write Access rules */
31struct emac_regs { 31struct emac_regs {
32 u32 mr0; /* special */ 32 /* Common registers across all EMAC implementations. */
33 u32 mr1; /* Reset */ 33 u32 mr0; /* Special */
34 u32 tmr0; /* special */ 34 u32 mr1; /* Reset */
35 u32 tmr1; /* special */ 35 u32 tmr0; /* Special */
36 u32 rmr; /* Reset */ 36 u32 tmr1; /* Special */
37 u32 isr; /* Always */ 37 u32 rmr; /* Reset */
38 u32 iser; /* Reset */ 38 u32 isr; /* Always */
39 u32 iahr; /* Reset, R, T */ 39 u32 iser; /* Reset */
40 u32 ialr; /* Reset, R, T */ 40 u32 iahr; /* Reset, R, T */
41 u32 vtpid; /* Reset, R, T */ 41 u32 ialr; /* Reset, R, T */
42 u32 vtci; /* Reset, R, T */ 42 u32 vtpid; /* Reset, R, T */
43 u32 ptr; /* Reset, T */ 43 u32 vtci; /* Reset, R, T */
44 u32 iaht1; /* Reset, R */ 44 u32 ptr; /* Reset, T */
45 u32 iaht2; /* Reset, R */ 45 union {
46 u32 iaht3; /* Reset, R */ 46 /* Registers unique to EMAC4 implementations */
47 u32 iaht4; /* Reset, R */ 47 struct {
48 u32 gaht1; /* Reset, R */ 48 u32 iaht1; /* Reset, R */
49 u32 gaht2; /* Reset, R */ 49 u32 iaht2; /* Reset, R */
50 u32 gaht3; /* Reset, R */ 50 u32 iaht3; /* Reset, R */
51 u32 gaht4; /* Reset, R */ 51 u32 iaht4; /* Reset, R */
52 u32 gaht1; /* Reset, R */
53 u32 gaht2; /* Reset, R */
54 u32 gaht3; /* Reset, R */
55 u32 gaht4; /* Reset, R */
56 } emac4;
57 /* Registers unique to EMAC4SYNC implementations */
58 struct {
59 u32 mahr; /* Reset, R, T */
60 u32 malr; /* Reset, R, T */
61 u32 mmahr; /* Reset, R, T */
62 u32 mmalr; /* Reset, R, T */
63 u32 rsvd0[4];
64 } emac4sync;
65 } u0;
66 /* Common registers across all EMAC implementations. */
52 u32 lsah; 67 u32 lsah;
53 u32 lsal; 68 u32 lsal;
54 u32 ipgvr; /* Reset, T */ 69 u32 ipgvr; /* Reset, T */
55 u32 stacr; /* special */ 70 u32 stacr; /* Special */
56 u32 trtr; /* special */ 71 u32 trtr; /* Special */
57 u32 rwmr; /* Reset */ 72 u32 rwmr; /* Reset */
58 u32 octx; 73 u32 octx;
59 u32 ocrx; 74 u32 ocrx;
60 u32 ipcr; 75 union {
76 /* Registers unique to EMAC4 implementations */
77 struct {
78 u32 ipcr;
79 } emac4;
80 /* Registers unique to EMAC4SYNC implementations */
81 struct {
82 u32 rsvd1;
83 u32 revid;
84 u32 rsvd2[2];
85 u32 iaht1; /* Reset, R */
86 u32 iaht2; /* Reset, R */
87 u32 iaht3; /* Reset, R */
88 u32 iaht4; /* Reset, R */
89 u32 iaht5; /* Reset, R */
90 u32 iaht6; /* Reset, R */
91 u32 iaht7; /* Reset, R */
92 u32 iaht8; /* Reset, R */
93 u32 gaht1; /* Reset, R */
94 u32 gaht2; /* Reset, R */
95 u32 gaht3; /* Reset, R */
96 u32 gaht4; /* Reset, R */
97 u32 gaht5; /* Reset, R */
98 u32 gaht6; /* Reset, R */
99 u32 gaht7; /* Reset, R */
100 u32 gaht8; /* Reset, R */
101 u32 tpc; /* Reset, T */
102 } emac4sync;
103 } u1;
61}; 104};
62 105
63/* 106/*
@@ -73,12 +116,6 @@ struct emac_regs {
73#define PHY_MODE_RTBI 7 116#define PHY_MODE_RTBI 7
74#define PHY_MODE_SGMII 8 117#define PHY_MODE_SGMII 8
75 118
76
77#define EMAC_ETHTOOL_REGS_VER 0
78#define EMAC_ETHTOOL_REGS_SIZE (sizeof(struct emac_regs) - sizeof(u32))
79#define EMAC4_ETHTOOL_REGS_VER 1
80#define EMAC4_ETHTOOL_REGS_SIZE sizeof(struct emac_regs)
81
82/* EMACx_MR0 */ 119/* EMACx_MR0 */
83#define EMAC_MR0_RXI 0x80000000 120#define EMAC_MR0_RXI 0x80000000
84#define EMAC_MR0_TXI 0x40000000 121#define EMAC_MR0_TXI 0x40000000
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c
index e32da3de2695..1d5379de6900 100644
--- a/drivers/net/ibm_newemac/rgmii.c
+++ b/drivers/net/ibm_newemac/rgmii.c
@@ -39,6 +39,7 @@
39#define RGMII_FER_RGMII(idx) (0x5 << ((idx) * 4)) 39#define RGMII_FER_RGMII(idx) (0x5 << ((idx) * 4))
40#define RGMII_FER_TBI(idx) (0x6 << ((idx) * 4)) 40#define RGMII_FER_TBI(idx) (0x6 << ((idx) * 4))
41#define RGMII_FER_GMII(idx) (0x7 << ((idx) * 4)) 41#define RGMII_FER_GMII(idx) (0x7 << ((idx) * 4))
42#define RGMII_FER_MII(idx) RGMII_FER_GMII(idx)
42 43
43/* RGMIIx_SSR */ 44/* RGMIIx_SSR */
44#define RGMII_SSR_MASK(idx) (0x7 << ((idx) * 8)) 45#define RGMII_SSR_MASK(idx) (0x7 << ((idx) * 8))
@@ -49,6 +50,7 @@
49static inline int rgmii_valid_mode(int phy_mode) 50static inline int rgmii_valid_mode(int phy_mode)
50{ 51{
51 return phy_mode == PHY_MODE_GMII || 52 return phy_mode == PHY_MODE_GMII ||
53 phy_mode == PHY_MODE_MII ||
52 phy_mode == PHY_MODE_RGMII || 54 phy_mode == PHY_MODE_RGMII ||
53 phy_mode == PHY_MODE_TBI || 55 phy_mode == PHY_MODE_TBI ||
54 phy_mode == PHY_MODE_RTBI; 56 phy_mode == PHY_MODE_RTBI;
@@ -63,6 +65,8 @@ static inline const char *rgmii_mode_name(int mode)
63 return "TBI"; 65 return "TBI";
64 case PHY_MODE_GMII: 66 case PHY_MODE_GMII:
65 return "GMII"; 67 return "GMII";
68 case PHY_MODE_MII:
69 return "MII";
66 case PHY_MODE_RTBI: 70 case PHY_MODE_RTBI:
67 return "RTBI"; 71 return "RTBI";
68 default: 72 default:
@@ -79,6 +83,8 @@ static inline u32 rgmii_mode_mask(int mode, int input)
79 return RGMII_FER_TBI(input); 83 return RGMII_FER_TBI(input);
80 case PHY_MODE_GMII: 84 case PHY_MODE_GMII:
81 return RGMII_FER_GMII(input); 85 return RGMII_FER_GMII(input);
86 case PHY_MODE_MII:
87 return RGMII_FER_MII(input);
82 case PHY_MODE_RTBI: 88 case PHY_MODE_RTBI:
83 return RGMII_FER_RTBI(input); 89 return RGMII_FER_RTBI(input);
84 default: 90 default:
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index ae398f04c7b4..e79a26a886c8 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -718,7 +718,8 @@ void igb_down(struct igb_adapter *adapter)
718 adapter->link_speed = 0; 718 adapter->link_speed = 0;
719 adapter->link_duplex = 0; 719 adapter->link_duplex = 0;
720 720
721 igb_reset(adapter); 721 if (!pci_channel_offline(adapter->pdev))
722 igb_reset(adapter);
722 igb_clean_all_tx_rings(adapter); 723 igb_clean_all_tx_rings(adapter);
723 igb_clean_all_rx_rings(adapter); 724 igb_clean_all_rx_rings(adapter);
724} 725}
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index 679a0826780e..2c03f4e2ccc4 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -1271,7 +1271,7 @@ static void ipg_nic_rx_with_end(struct net_device *dev,
1271 1271
1272 framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN; 1272 framelen = le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFRAMELEN;
1273 1273
1274 endframeLen = framelen - jumbo->current_size; 1274 endframelen = framelen - jumbo->current_size;
1275 /* 1275 /*
1276 if (framelen > IPG_RXFRAG_SIZE) 1276 if (framelen > IPG_RXFRAG_SIZE)
1277 framelen=IPG_RXFRAG_SIZE; 1277 framelen=IPG_RXFRAG_SIZE;
@@ -1279,8 +1279,8 @@ static void ipg_nic_rx_with_end(struct net_device *dev,
1279 if (framelen > IPG_RXSUPPORT_SIZE) 1279 if (framelen > IPG_RXSUPPORT_SIZE)
1280 dev_kfree_skb_irq(jumbo->skb); 1280 dev_kfree_skb_irq(jumbo->skb);
1281 else { 1281 else {
1282 memcpy(skb_put(jumbo->skb, endframeLen), 1282 memcpy(skb_put(jumbo->skb, endframelen),
1283 skb->data, endframeLen); 1283 skb->data, endframelen);
1284 1284
1285 jumbo->skb->protocol = 1285 jumbo->skb->protocol =
1286 eth_type_trans(jumbo->skb, dev); 1286 eth_type_trans(jumbo->skb, dev);
@@ -1352,16 +1352,16 @@ static int ipg_nic_rx(struct net_device *dev)
1352 1352
1353 switch (ipg_nic_rx_check_frame_type(dev)) { 1353 switch (ipg_nic_rx_check_frame_type(dev)) {
1354 case FRAME_WITH_START_WITH_END: 1354 case FRAME_WITH_START_WITH_END:
1355 ipg_nic_rx_with_start_and_end(dev, tp, rxfd, entry); 1355 ipg_nic_rx_with_start_and_end(dev, sp, rxfd, entry);
1356 break; 1356 break;
1357 case FRAME_WITH_START: 1357 case FRAME_WITH_START:
1358 ipg_nic_rx_with_start(dev, tp, rxfd, entry); 1358 ipg_nic_rx_with_start(dev, sp, rxfd, entry);
1359 break; 1359 break;
1360 case FRAME_WITH_END: 1360 case FRAME_WITH_END:
1361 ipg_nic_rx_with_end(dev, tp, rxfd, entry); 1361 ipg_nic_rx_with_end(dev, sp, rxfd, entry);
1362 break; 1362 break;
1363 case FRAME_NO_START_NO_END: 1363 case FRAME_NO_START_NO_END:
1364 ipg_nic_rx_no_start_no_end(dev, tp, rxfd, entry); 1364 ipg_nic_rx_no_start_no_end(dev, sp, rxfd, entry);
1365 break; 1365 break;
1366 } 1366 }
1367 } 1367 }
@@ -1808,7 +1808,7 @@ static int ipg_nic_open(struct net_device *dev)
1808 /* initialize JUMBO Frame control variable */ 1808 /* initialize JUMBO Frame control variable */
1809 sp->jumbo.found_start = 0; 1809 sp->jumbo.found_start = 0;
1810 sp->jumbo.current_size = 0; 1810 sp->jumbo.current_size = 0;
1811 sp->jumbo.skb = 0; 1811 sp->jumbo.skb = NULL;
1812 dev->mtu = IPG_TXFRAG_SIZE; 1812 dev->mtu = IPG_TXFRAG_SIZE;
1813#endif 1813#endif
1814 1814
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 6f50ed7b183f..18b471cd1447 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -1024,7 +1024,7 @@ static int irda_usb_is_receiving(struct irda_usb_cb *self)
1024 * Upload firmware code to SigmaTel 421X IRDA-USB dongle 1024 * Upload firmware code to SigmaTel 421X IRDA-USB dongle
1025 */ 1025 */
1026static int stir421x_fw_upload(struct irda_usb_cb *self, 1026static int stir421x_fw_upload(struct irda_usb_cb *self,
1027 unsigned char *patch, 1027 const unsigned char *patch,
1028 const unsigned int patch_len) 1028 const unsigned int patch_len)
1029{ 1029{
1030 int ret = -ENOMEM; 1030 int ret = -ENOMEM;
@@ -1073,11 +1073,11 @@ static int stir421x_fw_upload(struct irda_usb_cb *self,
1073 */ 1073 */
1074static int stir421x_patch_device(struct irda_usb_cb *self) 1074static int stir421x_patch_device(struct irda_usb_cb *self)
1075{ 1075{
1076 unsigned int i; 1076 unsigned int i;
1077 int ret; 1077 int ret;
1078 char stir421x_fw_name[11]; 1078 char stir421x_fw_name[11];
1079 const struct firmware *fw; 1079 const struct firmware *fw;
1080 unsigned char *fw_version_ptr; /* pointer to version string */ 1080 const unsigned char *fw_version_ptr; /* pointer to version string */
1081 unsigned long fw_version = 0; 1081 unsigned long fw_version = 0;
1082 1082
1083 /* 1083 /*
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index a7714da7c283..effc1ce8179a 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -152,6 +152,7 @@ static chipio_t pnp_info;
152static const struct pnp_device_id nsc_ircc_pnp_table[] = { 152static const struct pnp_device_id nsc_ircc_pnp_table[] = {
153 { .id = "NSC6001", .driver_data = 0 }, 153 { .id = "NSC6001", .driver_data = 0 },
154 { .id = "IBM0071", .driver_data = 0 }, 154 { .id = "IBM0071", .driver_data = 0 },
155 { .id = "HWPC224", .driver_data = 0 },
155 { } 156 { }
156}; 157};
157 158
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index d5c2d27f3ea4..f76b0b6c277d 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -13,16 +13,8 @@
13 * 13 *
14 */ 14 */
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/types.h>
17#include <linux/init.h>
18#include <linux/errno.h>
19#include <linux/netdevice.h> 16#include <linux/netdevice.h>
20#include <linux/slab.h>
21#include <linux/rtnetlink.h>
22#include <linux/interrupt.h>
23#include <linux/dma-mapping.h>
24#include <linux/platform_device.h> 17#include <linux/platform_device.h>
25#include <linux/pm.h>
26#include <linux/clk.h> 18#include <linux/clk.h>
27 19
28#include <net/irda/irda.h> 20#include <net/irda/irda.h>
@@ -30,17 +22,9 @@
30#include <net/irda/wrapper.h> 22#include <net/irda/wrapper.h>
31#include <net/irda/irda_device.h> 23#include <net/irda/irda_device.h>
32 24
33#include <asm/irq.h>
34#include <asm/dma.h> 25#include <asm/dma.h>
35#include <asm/delay.h>
36#include <asm/hardware.h>
37#include <asm/arch/irda.h> 26#include <asm/arch/irda.h>
38#include <asm/arch/pxa-regs.h> 27#include <asm/arch/pxa-regs.h>
39#include <asm/arch/pxa2xx-gpio.h>
40
41#ifdef CONFIG_MACH_MAINSTONE
42#include <asm/arch/mainstone.h>
43#endif
44 28
45#define IrSR_RXPL_NEG_IS_ZERO (1<<4) 29#define IrSR_RXPL_NEG_IS_ZERO (1<<4)
46#define IrSR_RXPL_POS_IS_ZERO 0x0 30#define IrSR_RXPL_POS_IS_ZERO 0x0
@@ -163,10 +147,6 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
163 /* set board transceiver to SIR mode */ 147 /* set board transceiver to SIR mode */
164 si->pdata->transceiver_mode(si->dev, IR_SIRMODE); 148 si->pdata->transceiver_mode(si->dev, IR_SIRMODE);
165 149
166 /* configure GPIO46/47 */
167 pxa_gpio_mode(GPIO46_STRXD_MD);
168 pxa_gpio_mode(GPIO47_STTXD_MD);
169
170 /* enable the STUART clock */ 150 /* enable the STUART clock */
171 pxa_irda_enable_sirclk(si); 151 pxa_irda_enable_sirclk(si);
172 } 152 }
@@ -201,10 +181,6 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
201 /* set board transceiver to FIR mode */ 181 /* set board transceiver to FIR mode */
202 si->pdata->transceiver_mode(si->dev, IR_FIRMODE); 182 si->pdata->transceiver_mode(si->dev, IR_FIRMODE);
203 183
204 /* configure GPIO46/47 */
205 pxa_gpio_mode(GPIO46_ICPRXD_MD);
206 pxa_gpio_mode(GPIO47_ICPTXD_MD);
207
208 /* enable the FICP clock */ 184 /* enable the FICP clock */
209 pxa_irda_enable_firclk(si); 185 pxa_irda_enable_firclk(si);
210 186
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 58e128784585..04ad3573b159 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -1546,6 +1546,7 @@ static int via_ircc_net_open(struct net_device *dev)
1546 IRDA_WARNING("%s, unable to allocate dma2=%d\n", 1546 IRDA_WARNING("%s, unable to allocate dma2=%d\n",
1547 driver_name, self->io.dma2); 1547 driver_name, self->io.dma2);
1548 free_irq(self->io.irq, self); 1548 free_irq(self->io.irq, self);
1549 free_dma(self->io.dma);
1549 return -EAGAIN; 1550 return -EAGAIN;
1550 } 1551 }
1551 } 1552 }
@@ -1606,6 +1607,8 @@ static int via_ircc_net_close(struct net_device *dev)
1606 EnAllInt(iobase, OFF); 1607 EnAllInt(iobase, OFF);
1607 free_irq(self->io.irq, dev); 1608 free_irq(self->io.irq, dev);
1608 free_dma(self->io.dma); 1609 free_dma(self->io.dma);
1610 if (self->io.dma2 != self->io.dma)
1611 free_dma(self->io.dma2);
1609 1612
1610 return 0; 1613 return 0;
1611} 1614}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 7b859220c255..8f0460901153 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1969,7 +1969,8 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
1969 netif_carrier_off(netdev); 1969 netif_carrier_off(netdev);
1970 netif_stop_queue(netdev); 1970 netif_stop_queue(netdev);
1971 1971
1972 ixgbe_reset(adapter); 1972 if (!pci_channel_offline(adapter->pdev))
1973 ixgbe_reset(adapter);
1973 ixgbe_clean_all_tx_rings(adapter); 1974 ixgbe_clean_all_tx_rings(adapter);
1974 ixgbe_clean_all_rx_rings(adapter); 1975 ixgbe_clean_all_rx_rings(adapter);
1975 1976
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 92dccd43bdca..0a5745a854c7 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1277,8 +1277,45 @@ static int __exit macb_remove(struct platform_device *pdev)
1277 return 0; 1277 return 0;
1278} 1278}
1279 1279
1280#ifdef CONFIG_PM
1281static int macb_suspend(struct platform_device *pdev, pm_message_t state)
1282{
1283 struct net_device *netdev = platform_get_drvdata(pdev);
1284 struct macb *bp = netdev_priv(netdev);
1285
1286 netif_device_detach(netdev);
1287
1288#ifndef CONFIG_ARCH_AT91
1289 clk_disable(bp->hclk);
1290#endif
1291 clk_disable(bp->pclk);
1292
1293 return 0;
1294}
1295
1296static int macb_resume(struct platform_device *pdev)
1297{
1298 struct net_device *netdev = platform_get_drvdata(pdev);
1299 struct macb *bp = netdev_priv(netdev);
1300
1301 clk_enable(bp->pclk);
1302#ifndef CONFIG_ARCH_AT91
1303 clk_enable(bp->hclk);
1304#endif
1305
1306 netif_device_attach(netdev);
1307
1308 return 0;
1309}
1310#else
1311#define macb_suspend NULL
1312#define macb_resume NULL
1313#endif
1314
1280static struct platform_driver macb_driver = { 1315static struct platform_driver macb_driver = {
1281 .remove = __exit_p(macb_remove), 1316 .remove = __exit_p(macb_remove),
1317 .suspend = macb_suspend,
1318 .resume = macb_resume,
1282 .driver = { 1319 .driver = {
1283 .name = "macb", 1320 .name = "macb",
1284 .owner = THIS_MODULE, 1321 .owner = THIS_MODULE,
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index c36a03ae9bfb..860d75d81f82 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -20,7 +20,7 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/string.h> 22#include <linux/string.h>
23#include <linux/list.h> 23#include <linux/rculist.h>
24#include <linux/notifier.h> 24#include <linux/notifier.h>
25#include <linux/netdevice.h> 25#include <linux/netdevice.h>
26#include <linux/etherdevice.h> 26#include <linux/etherdevice.h>
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c
index d82f2751d2c7..2b5006b9be67 100644
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -101,6 +101,34 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u32 flags)
101 mlx4_dbg(dev, " %s\n", fname[i]); 101 mlx4_dbg(dev, " %s\n", fname[i]);
102} 102}
103 103
104int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
105{
106 struct mlx4_cmd_mailbox *mailbox;
107 u32 *inbox;
108 int err = 0;
109
110#define MOD_STAT_CFG_IN_SIZE 0x100
111
112#define MOD_STAT_CFG_PG_SZ_M_OFFSET 0x002
113#define MOD_STAT_CFG_PG_SZ_OFFSET 0x003
114
115 mailbox = mlx4_alloc_cmd_mailbox(dev);
116 if (IS_ERR(mailbox))
117 return PTR_ERR(mailbox);
118 inbox = mailbox->buf;
119
120 memset(inbox, 0, MOD_STAT_CFG_IN_SIZE);
121
122 MLX4_PUT(inbox, cfg->log_pg_sz, MOD_STAT_CFG_PG_SZ_OFFSET);
123 MLX4_PUT(inbox, cfg->log_pg_sz_m, MOD_STAT_CFG_PG_SZ_M_OFFSET);
124
125 err = mlx4_cmd(dev, mailbox->dma, 0, 0, MLX4_CMD_MOD_STAT_CFG,
126 MLX4_CMD_TIME_CLASS_A);
127
128 mlx4_free_cmd_mailbox(dev, mailbox);
129 return err;
130}
131
104int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) 132int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
105{ 133{
106 struct mlx4_cmd_mailbox *mailbox; 134 struct mlx4_cmd_mailbox *mailbox;
diff --git a/drivers/net/mlx4/fw.h b/drivers/net/mlx4/fw.h
index 306cb9b0242d..a0e046c149b7 100644
--- a/drivers/net/mlx4/fw.h
+++ b/drivers/net/mlx4/fw.h
@@ -38,6 +38,11 @@
38#include "mlx4.h" 38#include "mlx4.h"
39#include "icm.h" 39#include "icm.h"
40 40
41struct mlx4_mod_stat_cfg {
42 u8 log_pg_sz;
43 u8 log_pg_sz_m;
44};
45
41struct mlx4_dev_cap { 46struct mlx4_dev_cap {
42 int max_srq_sz; 47 int max_srq_sz;
43 int max_qp_sz; 48 int max_qp_sz;
@@ -162,5 +167,6 @@ int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages);
162int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm); 167int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
163int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev); 168int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
164int mlx4_NOP(struct mlx4_dev *dev); 169int mlx4_NOP(struct mlx4_dev *dev);
170int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg);
165 171
166#endif /* MLX4_FW_H */ 172#endif /* MLX4_FW_H */
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index a6aa49fc1d68..d3736013fe9b 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -485,6 +485,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
485 struct mlx4_priv *priv = mlx4_priv(dev); 485 struct mlx4_priv *priv = mlx4_priv(dev);
486 struct mlx4_adapter adapter; 486 struct mlx4_adapter adapter;
487 struct mlx4_dev_cap dev_cap; 487 struct mlx4_dev_cap dev_cap;
488 struct mlx4_mod_stat_cfg mlx4_cfg;
488 struct mlx4_profile profile; 489 struct mlx4_profile profile;
489 struct mlx4_init_hca_param init_hca; 490 struct mlx4_init_hca_param init_hca;
490 u64 icm_size; 491 u64 icm_size;
@@ -502,6 +503,12 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
502 return err; 503 return err;
503 } 504 }
504 505
506 mlx4_cfg.log_pg_sz_m = 1;
507 mlx4_cfg.log_pg_sz = 0;
508 err = mlx4_MOD_STAT_CFG(dev, &mlx4_cfg);
509 if (err)
510 mlx4_warn(dev, "Failed to override log_pg_sz parameter\n");
511
505 err = mlx4_dev_cap(dev, &dev_cap); 512 err = mlx4_dev_cap(dev, &dev_cap);
506 if (err) { 513 if (err) {
507 mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n"); 514 mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n");
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index 57f7f1f0d4ec..b4b57870ddfd 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -38,6 +38,9 @@
38 38
39#include "mlx4.h" 39#include "mlx4.h"
40 40
41#define MGM_QPN_MASK 0x00FFFFFF
42#define MGM_BLCK_LB_BIT 30
43
41struct mlx4_mgm { 44struct mlx4_mgm {
42 __be32 next_gid_index; 45 __be32 next_gid_index;
43 __be32 members_count; 46 __be32 members_count;
@@ -153,7 +156,8 @@ static int find_mgm(struct mlx4_dev *dev,
153 return err; 156 return err;
154} 157}
155 158
156int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]) 159int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
160 int block_mcast_loopback)
157{ 161{
158 struct mlx4_priv *priv = mlx4_priv(dev); 162 struct mlx4_priv *priv = mlx4_priv(dev);
159 struct mlx4_cmd_mailbox *mailbox; 163 struct mlx4_cmd_mailbox *mailbox;
@@ -202,13 +206,18 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
202 } 206 }
203 207
204 for (i = 0; i < members_count; ++i) 208 for (i = 0; i < members_count; ++i)
205 if (mgm->qp[i] == cpu_to_be32(qp->qpn)) { 209 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qp->qpn) {
206 mlx4_dbg(dev, "QP %06x already a member of MGM\n", qp->qpn); 210 mlx4_dbg(dev, "QP %06x already a member of MGM\n", qp->qpn);
207 err = 0; 211 err = 0;
208 goto out; 212 goto out;
209 } 213 }
210 214
211 mgm->qp[members_count++] = cpu_to_be32(qp->qpn); 215 if (block_mcast_loopback)
216 mgm->qp[members_count++] = cpu_to_be32((qp->qpn & MGM_QPN_MASK) |
217 (1 << MGM_BLCK_LB_BIT));
218 else
219 mgm->qp[members_count++] = cpu_to_be32(qp->qpn & MGM_QPN_MASK);
220
212 mgm->members_count = cpu_to_be32(members_count); 221 mgm->members_count = cpu_to_be32(members_count);
213 222
214 err = mlx4_WRITE_MCG(dev, index, mailbox); 223 err = mlx4_WRITE_MCG(dev, index, mailbox);
@@ -283,7 +292,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
283 292
284 members_count = be32_to_cpu(mgm->members_count); 293 members_count = be32_to_cpu(mgm->members_count);
285 for (loc = -1, i = 0; i < members_count; ++i) 294 for (loc = -1, i = 0; i < members_count; ++i)
286 if (mgm->qp[i] == cpu_to_be32(qp->qpn)) 295 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qp->qpn)
287 loc = i; 296 loc = i;
288 297
289 if (loc == -1) { 298 if (loc == -1) {
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index e0d76c75aea0..823bb6d35334 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -529,6 +529,7 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
529 unsigned crc, reread_crc; 529 unsigned crc, reread_crc;
530 const struct firmware *fw; 530 const struct firmware *fw;
531 struct device *dev = &mgp->pdev->dev; 531 struct device *dev = &mgp->pdev->dev;
532 unsigned char *fw_readback;
532 struct mcp_gen_header *hdr; 533 struct mcp_gen_header *hdr;
533 size_t hdr_offset; 534 size_t hdr_offset;
534 int status; 535 int status;
@@ -571,9 +572,15 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
571 mb(); 572 mb();
572 readb(mgp->sram); 573 readb(mgp->sram);
573 } 574 }
575 fw_readback = vmalloc(fw->size);
576 if (!fw_readback) {
577 status = -ENOMEM;
578 goto abort_with_fw;
579 }
574 /* corruption checking is good for parity recovery and buggy chipset */ 580 /* corruption checking is good for parity recovery and buggy chipset */
575 memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); 581 memcpy_fromio(fw_readback, mgp->sram + MYRI10GE_FW_OFFSET, fw->size);
576 reread_crc = crc32(~0, fw->data, fw->size); 582 reread_crc = crc32(~0, fw_readback, fw->size);
583 vfree(fw_readback);
577 if (crc != reread_crc) { 584 if (crc != reread_crc) {
578 dev_err(dev, "CRC failed(fw-len=%u), got 0x%x (expect 0x%x)\n", 585 dev_err(dev, "CRC failed(fw-len=%u), got 0x%x (expect 0x%x)\n",
579 (unsigned)fw->size, reread_crc, crc); 586 (unsigned)fw->size, reread_crc, crc);
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 665341e43055..387a13395015 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -585,8 +585,9 @@ static struct config_item_type netconsole_target_type = {
585 * Group operations and type for netconsole_subsys. 585 * Group operations and type for netconsole_subsys.
586 */ 586 */
587 587
588static struct config_item *make_netconsole_target(struct config_group *group, 588static int make_netconsole_target(struct config_group *group,
589 const char *name) 589 const char *name,
590 struct config_item **new_item)
590{ 591{
591 unsigned long flags; 592 unsigned long flags;
592 struct netconsole_target *nt; 593 struct netconsole_target *nt;
@@ -598,7 +599,7 @@ static struct config_item *make_netconsole_target(struct config_group *group,
598 nt = kzalloc(sizeof(*nt), GFP_KERNEL); 599 nt = kzalloc(sizeof(*nt), GFP_KERNEL);
599 if (!nt) { 600 if (!nt) {
600 printk(KERN_ERR "netconsole: failed to allocate memory\n"); 601 printk(KERN_ERR "netconsole: failed to allocate memory\n");
601 return NULL; 602 return -ENOMEM;
602 } 603 }
603 604
604 nt->np.name = "netconsole"; 605 nt->np.name = "netconsole";
@@ -615,7 +616,8 @@ static struct config_item *make_netconsole_target(struct config_group *group,
615 list_add(&nt->list, &target_list); 616 list_add(&nt->list, &target_list);
616 spin_unlock_irqrestore(&target_list_lock, flags); 617 spin_unlock_irqrestore(&target_list_lock, flags);
617 618
618 return &nt->item; 619 *new_item = &nt->item;
620 return 0;
619} 621}
620 622
621static void drop_netconsole_target(struct config_group *group, 623static void drop_netconsole_target(struct config_group *group,
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 6797ed069f1f..63cd67b931e7 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -71,14 +71,18 @@ static irqreturn_t netxen_intr(int irq, void *data);
71static irqreturn_t netxen_msi_intr(int irq, void *data); 71static irqreturn_t netxen_msi_intr(int irq, void *data);
72 72
73/* PCI Device ID Table */ 73/* PCI Device ID Table */
74#define ENTRY(device) \
75 {PCI_DEVICE(0x4040, (device)), \
76 .class = PCI_CLASS_NETWORK_ETHERNET << 8, .class_mask = ~0}
77
74static struct pci_device_id netxen_pci_tbl[] __devinitdata = { 78static struct pci_device_id netxen_pci_tbl[] __devinitdata = {
75 {PCI_DEVICE(0x4040, 0x0001), PCI_DEVICE_CLASS(0x020000, ~0)}, 79 ENTRY(0x0001),
76 {PCI_DEVICE(0x4040, 0x0002), PCI_DEVICE_CLASS(0x020000, ~0)}, 80 ENTRY(0x0002),
77 {PCI_DEVICE(0x4040, 0x0003), PCI_DEVICE_CLASS(0x020000, ~0)}, 81 ENTRY(0x0003),
78 {PCI_DEVICE(0x4040, 0x0004), PCI_DEVICE_CLASS(0x020000, ~0)}, 82 ENTRY(0x0004),
79 {PCI_DEVICE(0x4040, 0x0005), PCI_DEVICE_CLASS(0x020000, ~0)}, 83 ENTRY(0x0005),
80 {PCI_DEVICE(0x4040, 0x0024), PCI_DEVICE_CLASS(0x020000, ~0)}, 84 ENTRY(0x0024),
81 {PCI_DEVICE(0x4040, 0x0025), PCI_DEVICE_CLASS(0x020000, ~0)}, 85 ENTRY(0x0025),
82 {0,} 86 {0,}
83}; 87};
84 88
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 3b2a6c598088..993d87c9296f 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -277,7 +277,7 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
277 *tcph = tcp_hdr(skb); 277 *tcph = tcp_hdr(skb);
278 278
279 /* check if ip header and tcp header are complete */ 279 /* check if ip header and tcp header are complete */
280 if (iph->tot_len < ip_len + tcp_hdrlen(skb)) 280 if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb))
281 return -1; 281 return -1;
282 282
283 *hdr_flags = LRO_IPV4 | LRO_TCP; 283 *hdr_flags = LRO_IPV4 | LRO_TCP;
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index ce95c5d168fe..70d012e90dcf 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -525,12 +525,14 @@ static int axnet_open(struct net_device *dev)
525 int ret; 525 int ret;
526 axnet_dev_t *info = PRIV(dev); 526 axnet_dev_t *info = PRIV(dev);
527 struct pcmcia_device *link = info->p_dev; 527 struct pcmcia_device *link = info->p_dev;
528 unsigned int nic_base = dev->base_addr;
528 529
529 DEBUG(2, "axnet_open('%s')\n", dev->name); 530 DEBUG(2, "axnet_open('%s')\n", dev->name);
530 531
531 if (!pcmcia_dev_present(link)) 532 if (!pcmcia_dev_present(link))
532 return -ENODEV; 533 return -ENODEV;
533 534
535 outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */
534 ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev); 536 ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev);
535 if (ret) 537 if (ret)
536 return ret; 538 return ret;
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index fd8158a86f64..2d4c4ad89b8d 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -969,6 +969,7 @@ static int pcnet_open(struct net_device *dev)
969 int ret; 969 int ret;
970 pcnet_dev_t *info = PRIV(dev); 970 pcnet_dev_t *info = PRIV(dev);
971 struct pcmcia_device *link = info->p_dev; 971 struct pcmcia_device *link = info->p_dev;
972 unsigned int nic_base = dev->base_addr;
972 973
973 DEBUG(2, "pcnet_open('%s')\n", dev->name); 974 DEBUG(2, "pcnet_open('%s')\n", dev->name);
974 975
@@ -976,6 +977,8 @@ static int pcnet_open(struct net_device *dev)
976 return -ENODEV; 977 return -ENODEV;
977 978
978 set_misc_reg(dev); 979 set_misc_reg(dev);
980
981 outb_p(0xFF, nic_base + EN0_ISR); /* Clear bogus intr. */
979 ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev); 982 ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);
980 if (ret) 983 if (ret)
981 return ret; 984 return ret;
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 1f4ca2b54a73..83625fdff3dd 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -39,6 +39,7 @@
39#include <linux/if_arp.h> 39#include <linux/if_arp.h>
40#include <linux/ip.h> 40#include <linux/ip.h>
41#include <linux/tcp.h> 41#include <linux/tcp.h>
42#include <linux/smp_lock.h>
42#include <linux/spinlock.h> 43#include <linux/spinlock.h>
43#include <linux/rwsem.h> 44#include <linux/rwsem.h>
44#include <linux/stddef.h> 45#include <linux/stddef.h>
@@ -353,6 +354,7 @@ static const int npindex_to_ethertype[NUM_NP] = {
353 */ 354 */
354static int ppp_open(struct inode *inode, struct file *file) 355static int ppp_open(struct inode *inode, struct file *file)
355{ 356{
357 cycle_kernel_lock();
356 /* 358 /*
357 * This could (should?) be enforced by the permissions on /dev/ppp. 359 * This could (should?) be enforced by the permissions on /dev/ppp.
358 */ 360 */
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index b7f7b2227d56..bccee68bd48a 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -3701,7 +3701,9 @@ static int ql_cycle_adapter(struct ql3_adapter *qdev, int reset)
3701 printk(KERN_ERR PFX 3701 printk(KERN_ERR PFX
3702 "%s: Driver up/down cycle failed, " 3702 "%s: Driver up/down cycle failed, "
3703 "closing device\n",qdev->ndev->name); 3703 "closing device\n",qdev->ndev->name);
3704 rtnl_lock();
3704 dev_close(qdev->ndev); 3705 dev_close(qdev->ndev);
3706 rtnl_unlock();
3705 return -1; 3707 return -1;
3706 } 3708 }
3707 return 0; 3709 return 0;
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 858b191517b3..504a48ff73c8 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -273,7 +273,7 @@ static void r6040_init_ring_desc(struct r6040_descriptor *desc_ring,
273 dma_addr_t mapping = desc_dma; 273 dma_addr_t mapping = desc_dma;
274 274
275 while (size-- > 0) { 275 while (size-- > 0) {
276 mapping += sizeof(sizeof(*desc)); 276 mapping += sizeof(*desc);
277 desc->ndesc = cpu_to_le32(mapping); 277 desc->ndesc = cpu_to_le32(mapping);
278 desc->vndescp = desc + 1; 278 desc->vndescp = desc + 1;
279 desc++; 279 desc++;
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index b5c1e663417d..ae7b697456b4 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2625,9 +2625,7 @@ static int fill_rx_buffers(struct ring_info *ring)
2625 rxdp1->Buffer0_ptr = pci_map_single 2625 rxdp1->Buffer0_ptr = pci_map_single
2626 (ring->pdev, skb->data, size - NET_IP_ALIGN, 2626 (ring->pdev, skb->data, size - NET_IP_ALIGN,
2627 PCI_DMA_FROMDEVICE); 2627 PCI_DMA_FROMDEVICE);
2628 if( (rxdp1->Buffer0_ptr == 0) || 2628 if(pci_dma_mapping_error(rxdp1->Buffer0_ptr))
2629 (rxdp1->Buffer0_ptr ==
2630 DMA_ERROR_CODE))
2631 goto pci_map_failed; 2629 goto pci_map_failed;
2632 2630
2633 rxdp->Control_2 = 2631 rxdp->Control_2 =
@@ -2657,6 +2655,7 @@ static int fill_rx_buffers(struct ring_info *ring)
2657 skb->data = (void *) (unsigned long)tmp; 2655 skb->data = (void *) (unsigned long)tmp;
2658 skb_reset_tail_pointer(skb); 2656 skb_reset_tail_pointer(skb);
2659 2657
2658 /* AK: check is wrong. 0 can be valid dma address */
2660 if (!(rxdp3->Buffer0_ptr)) 2659 if (!(rxdp3->Buffer0_ptr))
2661 rxdp3->Buffer0_ptr = 2660 rxdp3->Buffer0_ptr =
2662 pci_map_single(ring->pdev, ba->ba_0, 2661 pci_map_single(ring->pdev, ba->ba_0,
@@ -2665,8 +2664,7 @@ static int fill_rx_buffers(struct ring_info *ring)
2665 pci_dma_sync_single_for_device(ring->pdev, 2664 pci_dma_sync_single_for_device(ring->pdev,
2666 (dma_addr_t) rxdp3->Buffer0_ptr, 2665 (dma_addr_t) rxdp3->Buffer0_ptr,
2667 BUF0_LEN, PCI_DMA_FROMDEVICE); 2666 BUF0_LEN, PCI_DMA_FROMDEVICE);
2668 if( (rxdp3->Buffer0_ptr == 0) || 2667 if (pci_dma_mapping_error(rxdp3->Buffer0_ptr))
2669 (rxdp3->Buffer0_ptr == DMA_ERROR_CODE))
2670 goto pci_map_failed; 2668 goto pci_map_failed;
2671 2669
2672 rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN); 2670 rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN);
@@ -2681,18 +2679,17 @@ static int fill_rx_buffers(struct ring_info *ring)
2681 (ring->pdev, skb->data, ring->mtu + 4, 2679 (ring->pdev, skb->data, ring->mtu + 4,
2682 PCI_DMA_FROMDEVICE); 2680 PCI_DMA_FROMDEVICE);
2683 2681
2684 if( (rxdp3->Buffer2_ptr == 0) || 2682 if (pci_dma_mapping_error(rxdp3->Buffer2_ptr))
2685 (rxdp3->Buffer2_ptr == DMA_ERROR_CODE))
2686 goto pci_map_failed; 2683 goto pci_map_failed;
2687 2684
2685 /* AK: check is wrong */
2688 if (!rxdp3->Buffer1_ptr) 2686 if (!rxdp3->Buffer1_ptr)
2689 rxdp3->Buffer1_ptr = 2687 rxdp3->Buffer1_ptr =
2690 pci_map_single(ring->pdev, 2688 pci_map_single(ring->pdev,
2691 ba->ba_1, BUF1_LEN, 2689 ba->ba_1, BUF1_LEN,
2692 PCI_DMA_FROMDEVICE); 2690 PCI_DMA_FROMDEVICE);
2693 2691
2694 if( (rxdp3->Buffer1_ptr == 0) || 2692 if (pci_dma_mapping_error(rxdp3->Buffer1_ptr)) {
2695 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) {
2696 pci_unmap_single 2693 pci_unmap_single
2697 (ring->pdev, 2694 (ring->pdev,
2698 (dma_addr_t)(unsigned long) 2695 (dma_addr_t)(unsigned long)
@@ -4264,16 +4261,14 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
4264 txdp->Buffer_Pointer = pci_map_single(sp->pdev, 4261 txdp->Buffer_Pointer = pci_map_single(sp->pdev,
4265 fifo->ufo_in_band_v, 4262 fifo->ufo_in_band_v,
4266 sizeof(u64), PCI_DMA_TODEVICE); 4263 sizeof(u64), PCI_DMA_TODEVICE);
4267 if((txdp->Buffer_Pointer == 0) || 4264 if (pci_dma_mapping_error(txdp->Buffer_Pointer))
4268 (txdp->Buffer_Pointer == DMA_ERROR_CODE))
4269 goto pci_map_failed; 4265 goto pci_map_failed;
4270 txdp++; 4266 txdp++;
4271 } 4267 }
4272 4268
4273 txdp->Buffer_Pointer = pci_map_single 4269 txdp->Buffer_Pointer = pci_map_single
4274 (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE); 4270 (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);
4275 if((txdp->Buffer_Pointer == 0) || 4271 if (pci_dma_mapping_error(txdp->Buffer_Pointer))
4276 (txdp->Buffer_Pointer == DMA_ERROR_CODE))
4277 goto pci_map_failed; 4272 goto pci_map_failed;
4278 4273
4279 txdp->Host_Control = (unsigned long) skb; 4274 txdp->Host_Control = (unsigned long) skb;
@@ -6884,10 +6879,8 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
6884 pci_map_single( sp->pdev, (*skb)->data, 6879 pci_map_single( sp->pdev, (*skb)->data,
6885 size - NET_IP_ALIGN, 6880 size - NET_IP_ALIGN,
6886 PCI_DMA_FROMDEVICE); 6881 PCI_DMA_FROMDEVICE);
6887 if( (rxdp1->Buffer0_ptr == 0) || 6882 if (pci_dma_mapping_error(rxdp1->Buffer0_ptr))
6888 (rxdp1->Buffer0_ptr == DMA_ERROR_CODE)) {
6889 goto memalloc_failed; 6883 goto memalloc_failed;
6890 }
6891 rxdp->Host_Control = (unsigned long) (*skb); 6884 rxdp->Host_Control = (unsigned long) (*skb);
6892 } 6885 }
6893 } else if ((sp->rxd_mode == RXD_MODE_3B) && (rxdp->Host_Control == 0)) { 6886 } else if ((sp->rxd_mode == RXD_MODE_3B) && (rxdp->Host_Control == 0)) {
@@ -6913,15 +6906,12 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
6913 pci_map_single(sp->pdev, (*skb)->data, 6906 pci_map_single(sp->pdev, (*skb)->data,
6914 dev->mtu + 4, 6907 dev->mtu + 4,
6915 PCI_DMA_FROMDEVICE); 6908 PCI_DMA_FROMDEVICE);
6916 if( (rxdp3->Buffer2_ptr == 0) || 6909 if (pci_dma_mapping_error(rxdp3->Buffer2_ptr))
6917 (rxdp3->Buffer2_ptr == DMA_ERROR_CODE)) {
6918 goto memalloc_failed; 6910 goto memalloc_failed;
6919 }
6920 rxdp3->Buffer0_ptr = *temp0 = 6911 rxdp3->Buffer0_ptr = *temp0 =
6921 pci_map_single( sp->pdev, ba->ba_0, BUF0_LEN, 6912 pci_map_single( sp->pdev, ba->ba_0, BUF0_LEN,
6922 PCI_DMA_FROMDEVICE); 6913 PCI_DMA_FROMDEVICE);
6923 if( (rxdp3->Buffer0_ptr == 0) || 6914 if (pci_dma_mapping_error(rxdp3->Buffer0_ptr)) {
6924 (rxdp3->Buffer0_ptr == DMA_ERROR_CODE)) {
6925 pci_unmap_single (sp->pdev, 6915 pci_unmap_single (sp->pdev,
6926 (dma_addr_t)rxdp3->Buffer2_ptr, 6916 (dma_addr_t)rxdp3->Buffer2_ptr,
6927 dev->mtu + 4, PCI_DMA_FROMDEVICE); 6917 dev->mtu + 4, PCI_DMA_FROMDEVICE);
@@ -6933,8 +6923,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
6933 rxdp3->Buffer1_ptr = *temp1 = 6923 rxdp3->Buffer1_ptr = *temp1 =
6934 pci_map_single(sp->pdev, ba->ba_1, BUF1_LEN, 6924 pci_map_single(sp->pdev, ba->ba_1, BUF1_LEN,
6935 PCI_DMA_FROMDEVICE); 6925 PCI_DMA_FROMDEVICE);
6936 if( (rxdp3->Buffer1_ptr == 0) || 6926 if (pci_dma_mapping_error(rxdp3->Buffer1_ptr)) {
6937 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) {
6938 pci_unmap_single (sp->pdev, 6927 pci_unmap_single (sp->pdev,
6939 (dma_addr_t)rxdp3->Buffer0_ptr, 6928 (dma_addr_t)rxdp3->Buffer0_ptr,
6940 BUF0_LEN, PCI_DMA_FROMDEVICE); 6929 BUF0_LEN, PCI_DMA_FROMDEVICE);
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 4706f7f9acb6..1827b6686c98 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -75,10 +75,6 @@ static int debug_level = ERR_DBG;
75/* DEBUG message print. */ 75/* DEBUG message print. */
76#define DBG_PRINT(dbg_level, args...) if(!(debug_level<dbg_level)) printk(args) 76#define DBG_PRINT(dbg_level, args...) if(!(debug_level<dbg_level)) printk(args)
77 77
78#ifndef DMA_ERROR_CODE
79#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
80#endif
81
82/* Protocol assist features of the NIC */ 78/* Protocol assist features of the NIC */
83#define L3_CKSUM_OK 0xFFFF 79#define L3_CKSUM_OK 0xFFFF
84#define L4_CKSUM_OK 0xFFFF 80#define L4_CKSUM_OK 0xFFFF
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index 10e4e85da3fc..b07b8cbadeaf 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -1394,6 +1394,7 @@ tc35815_open(struct net_device *dev)
1394 tc35815_chip_init(dev); 1394 tc35815_chip_init(dev);
1395 spin_unlock_irq(&lp->lock); 1395 spin_unlock_irq(&lp->lock);
1396 1396
1397 netif_carrier_off(dev);
1397 /* schedule a link state check */ 1398 /* schedule a link state check */
1398 phy_start(lp->phy_dev); 1399 phy_start(lp->phy_dev);
1399 1400
@@ -1735,7 +1736,6 @@ tc35815_rx(struct net_device *dev)
1735 skb = lp->rx_skbs[cur_bd].skb; 1736 skb = lp->rx_skbs[cur_bd].skb;
1736 prefetch(skb->data); 1737 prefetch(skb->data);
1737 lp->rx_skbs[cur_bd].skb = NULL; 1738 lp->rx_skbs[cur_bd].skb = NULL;
1738 lp->fbl_count--;
1739 pci_unmap_single(lp->pci_dev, 1739 pci_unmap_single(lp->pci_dev,
1740 lp->rx_skbs[cur_bd].skb_dma, 1740 lp->rx_skbs[cur_bd].skb_dma,
1741 RX_BUF_SIZE, PCI_DMA_FROMDEVICE); 1741 RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
@@ -1791,6 +1791,7 @@ tc35815_rx(struct net_device *dev)
1791#ifdef TC35815_USE_PACKEDBUFFER 1791#ifdef TC35815_USE_PACKEDBUFFER
1792 while (lp->fbl_curid != id) 1792 while (lp->fbl_curid != id)
1793#else 1793#else
1794 lp->fbl_count--;
1794 while (lp->fbl_count < RX_BUF_NUM) 1795 while (lp->fbl_count < RX_BUF_NUM)
1795#endif 1796#endif
1796 { 1797 {
@@ -2453,6 +2454,7 @@ static int tc35815_resume(struct pci_dev *pdev)
2453 return 0; 2454 return 0;
2454 pci_set_power_state(pdev, PCI_D0); 2455 pci_set_power_state(pdev, PCI_D0);
2455 tc35815_restart(dev); 2456 tc35815_restart(dev);
2457 netif_carrier_off(dev);
2456 if (lp->phy_dev) 2458 if (lp->phy_dev)
2457 phy_start(lp->phy_dev); 2459 phy_start(lp->phy_dev);
2458 netif_device_attach(dev); 2460 netif_device_attach(dev);
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 5f1c5072b96f..fa73e6eed6be 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -48,6 +48,7 @@
48#include <linux/skbuff.h> 48#include <linux/skbuff.h>
49#include <linux/trdevice.h> 49#include <linux/trdevice.h>
50#include <linux/bitops.h> 50#include <linux/bitops.h>
51#include <linux/firmware.h>
51 52
52#include <asm/system.h> 53#include <asm/system.h>
53#include <asm/io.h> 54#include <asm/io.h>
@@ -59,7 +60,6 @@
59#endif 60#endif
60 61
61#include "smctr.h" /* Our Stuff */ 62#include "smctr.h" /* Our Stuff */
62#include "smctr_firmware.h" /* SMC adapter firmware */
63 63
64static char version[] __initdata = KERN_INFO "smctr.c: v1.4 7/12/00 by jschlst@samba.org\n"; 64static char version[] __initdata = KERN_INFO "smctr.c: v1.4 7/12/00 by jschlst@samba.org\n";
65static const char cardname[] = "smctr"; 65static const char cardname[] = "smctr";
@@ -103,7 +103,8 @@ static int smctr_clear_trc_reset(int ioaddr);
103static int smctr_close(struct net_device *dev); 103static int smctr_close(struct net_device *dev);
104 104
105/* D */ 105/* D */
106static int smctr_decode_firmware(struct net_device *dev); 106static int smctr_decode_firmware(struct net_device *dev,
107 const struct firmware *fw);
107static int smctr_disable_16bit(struct net_device *dev); 108static int smctr_disable_16bit(struct net_device *dev);
108static int smctr_disable_adapter_ctrl_store(struct net_device *dev); 109static int smctr_disable_adapter_ctrl_store(struct net_device *dev);
109static int smctr_disable_bic_int(struct net_device *dev); 110static int smctr_disable_bic_int(struct net_device *dev);
@@ -748,7 +749,8 @@ static int smctr_close(struct net_device *dev)
748 return (0); 749 return (0);
749} 750}
750 751
751static int smctr_decode_firmware(struct net_device *dev) 752static int smctr_decode_firmware(struct net_device *dev,
753 const struct firmware *fw)
752{ 754{
753 struct net_local *tp = netdev_priv(dev); 755 struct net_local *tp = netdev_priv(dev);
754 short bit = 0x80, shift = 12; 756 short bit = 0x80, shift = 12;
@@ -762,10 +764,10 @@ static int smctr_decode_firmware(struct net_device *dev)
762 if(smctr_debug > 10) 764 if(smctr_debug > 10)
763 printk(KERN_DEBUG "%s: smctr_decode_firmware\n", dev->name); 765 printk(KERN_DEBUG "%s: smctr_decode_firmware\n", dev->name);
764 766
765 weight = *(long *)(tp->ptr_ucode + WEIGHT_OFFSET); 767 weight = *(long *)(fw->data + WEIGHT_OFFSET);
766 tsize = *(__u8 *)(tp->ptr_ucode + TREE_SIZE_OFFSET); 768 tsize = *(__u8 *)(fw->data + TREE_SIZE_OFFSET);
767 tree = (DECODE_TREE_NODE *)(tp->ptr_ucode + TREE_OFFSET); 769 tree = (DECODE_TREE_NODE *)(fw->data + TREE_OFFSET);
768 ucode = (__u8 *)(tp->ptr_ucode + TREE_OFFSET 770 ucode = (__u8 *)(fw->data + TREE_OFFSET
769 + (tsize * sizeof(DECODE_TREE_NODE))); 771 + (tsize * sizeof(DECODE_TREE_NODE)));
770 mem = (__u16 *)(tp->ram_access); 772 mem = (__u16 *)(tp->ram_access);
771 773
@@ -2963,34 +2965,44 @@ static int smctr_link_tx_fcbs_to_bdbs(struct net_device *dev)
2963static int smctr_load_firmware(struct net_device *dev) 2965static int smctr_load_firmware(struct net_device *dev)
2964{ 2966{
2965 struct net_local *tp = netdev_priv(dev); 2967 struct net_local *tp = netdev_priv(dev);
2968 const struct firmware *fw;
2966 __u16 i, checksum = 0; 2969 __u16 i, checksum = 0;
2967 int err = 0; 2970 int err = 0;
2968 2971
2969 if(smctr_debug > 10) 2972 if(smctr_debug > 10)
2970 printk(KERN_DEBUG "%s: smctr_load_firmware\n", dev->name); 2973 printk(KERN_DEBUG "%s: smctr_load_firmware\n", dev->name);
2971 2974
2972 tp->ptr_ucode = smctr_code; 2975 if (request_firmware(&fw, "tr_smctr.bin", &dev->dev)) {
2976 printk(KERN_ERR "%s: firmware not found\n", dev->name);
2977 return (UCODE_NOT_PRESENT);
2978 }
2979
2973 tp->num_of_tx_buffs = 4; 2980 tp->num_of_tx_buffs = 4;
2974 tp->mode_bits |= UMAC; 2981 tp->mode_bits |= UMAC;
2975 tp->receive_mask = 0; 2982 tp->receive_mask = 0;
2976 tp->max_packet_size = 4177; 2983 tp->max_packet_size = 4177;
2977 2984
2978 /* Can only upload the firmware once per adapter reset. */ 2985 /* Can only upload the firmware once per adapter reset. */
2979 if(tp->microcode_version != 0) 2986 if (tp->microcode_version != 0) {
2980 return (UCODE_PRESENT); 2987 err = (UCODE_PRESENT);
2988 goto out;
2989 }
2981 2990
2982 /* Verify the firmware exists and is there in the right amount. */ 2991 /* Verify the firmware exists and is there in the right amount. */
2983 if (!tp->ptr_ucode 2992 if (!fw->data
2984 || (*(tp->ptr_ucode + UCODE_VERSION_OFFSET) < UCODE_VERSION)) 2993 || (*(fw->data + UCODE_VERSION_OFFSET) < UCODE_VERSION))
2985 { 2994 {
2986 return (UCODE_NOT_PRESENT); 2995 err = (UCODE_NOT_PRESENT);
2996 goto out;
2987 } 2997 }
2988 2998
2989 /* UCODE_SIZE is not included in Checksum. */ 2999 /* UCODE_SIZE is not included in Checksum. */
2990 for(i = 0; i < *((__u16 *)(tp->ptr_ucode + UCODE_SIZE_OFFSET)); i += 2) 3000 for(i = 0; i < *((__u16 *)(fw->data + UCODE_SIZE_OFFSET)); i += 2)
2991 checksum += *((__u16 *)(tp->ptr_ucode + 2 + i)); 3001 checksum += *((__u16 *)(fw->data + 2 + i));
2992 if(checksum) 3002 if (checksum) {
2993 return (UCODE_NOT_PRESENT); 3003 err = (UCODE_NOT_PRESENT);
3004 goto out;
3005 }
2994 3006
2995 /* At this point we have a valid firmware image, lets kick it on up. */ 3007 /* At this point we have a valid firmware image, lets kick it on up. */
2996 smctr_enable_adapter_ram(dev); 3008 smctr_enable_adapter_ram(dev);
@@ -2998,7 +3010,7 @@ static int smctr_load_firmware(struct net_device *dev)
2998 smctr_set_page(dev, (__u8 *)tp->ram_access); 3010 smctr_set_page(dev, (__u8 *)tp->ram_access);
2999 3011
3000 if((smctr_checksum_firmware(dev)) 3012 if((smctr_checksum_firmware(dev))
3001 || (*(tp->ptr_ucode + UCODE_VERSION_OFFSET) 3013 || (*(fw->data + UCODE_VERSION_OFFSET)
3002 > tp->microcode_version)) 3014 > tp->microcode_version))
3003 { 3015 {
3004 smctr_enable_adapter_ctrl_store(dev); 3016 smctr_enable_adapter_ctrl_store(dev);
@@ -3007,9 +3019,9 @@ static int smctr_load_firmware(struct net_device *dev)
3007 for(i = 0; i < CS_RAM_SIZE; i += 2) 3019 for(i = 0; i < CS_RAM_SIZE; i += 2)
3008 *((__u16 *)(tp->ram_access + i)) = 0; 3020 *((__u16 *)(tp->ram_access + i)) = 0;
3009 3021
3010 smctr_decode_firmware(dev); 3022 smctr_decode_firmware(dev, fw);
3011 3023
3012 tp->microcode_version = *(tp->ptr_ucode + UCODE_VERSION_OFFSET); *((__u16 *)(tp->ram_access + CS_RAM_VERSION_OFFSET)) 3024 tp->microcode_version = *(fw->data + UCODE_VERSION_OFFSET); *((__u16 *)(tp->ram_access + CS_RAM_VERSION_OFFSET))
3013 = (tp->microcode_version << 8); 3025 = (tp->microcode_version << 8);
3014 *((__u16 *)(tp->ram_access + CS_RAM_CHECKSUM_OFFSET)) 3026 *((__u16 *)(tp->ram_access + CS_RAM_CHECKSUM_OFFSET))
3015 = ~(tp->microcode_version << 8) + 1; 3027 = ~(tp->microcode_version << 8) + 1;
@@ -3023,7 +3035,8 @@ static int smctr_load_firmware(struct net_device *dev)
3023 err = UCODE_PRESENT; 3035 err = UCODE_PRESENT;
3024 3036
3025 smctr_disable_16bit(dev); 3037 smctr_disable_16bit(dev);
3026 3038 out:
3039 release_firmware(fw);
3027 return (err); 3040 return (err);
3028} 3041}
3029 3042
@@ -5651,6 +5664,7 @@ static int io[SMCTR_MAX_ADAPTERS];
5651static int irq[SMCTR_MAX_ADAPTERS]; 5664static int irq[SMCTR_MAX_ADAPTERS];
5652 5665
5653MODULE_LICENSE("GPL"); 5666MODULE_LICENSE("GPL");
5667MODULE_FIRMWARE("tr_smctr.bin");
5654 5668
5655module_param_array(io, int, NULL, 0); 5669module_param_array(io, int, NULL, 0);
5656module_param_array(irq, int, NULL, 0); 5670module_param_array(irq, int, NULL, 0);
diff --git a/drivers/net/tokenring/smctr.h b/drivers/net/tokenring/smctr.h
index 88dfa2e01d6e..52df7dd815cc 100644
--- a/drivers/net/tokenring/smctr.h
+++ b/drivers/net/tokenring/smctr.h
@@ -1042,8 +1042,6 @@ typedef struct net_local {
1042 __u16 functional_address[2]; 1042 __u16 functional_address[2];
1043 __u16 bitwise_group_address[2]; 1043 __u16 bitwise_group_address[2];
1044 1044
1045 const __u8 *ptr_ucode;
1046
1047 __u8 cleanup; 1045 __u8 cleanup;
1048 1046
1049 struct sk_buff_head SendSkbQueue; 1047 struct sk_buff_head SendSkbQueue;
diff --git a/drivers/net/tokenring/smctr_firmware.h b/drivers/net/tokenring/smctr_firmware.h
deleted file mode 100644
index 292e50ddf01a..000000000000
--- a/drivers/net/tokenring/smctr_firmware.h
+++ /dev/null
@@ -1,978 +0,0 @@
1/*
2 * The firmware this driver downloads into the tokenring card is a
3 * separate program and is not GPL'd source code, even though the Linux
4 * side driver and the routine that loads this data into the card are.
5 *
6 * This firmware is licensed to you strictly for use in conjunction
7 * with the use of SMC TokenRing adapters. There is no waranty
8 * expressed or implied about its fitness for any purpose.
9 */
10
11/* smctr_firmware.h: SMC TokenRing driver firmware dump for Linux.
12 *
13 * Notes:
14 * - This is an 8K binary image. (MCT.BIN v6.3C1 03/01/95)
15 *
16 * Authors:
17 * - Jay Schulist <jschlst@samba.org>
18 */
19
20
21#if defined(CONFIG_SMCTR) || defined(CONFIG_SMCTR_MODULE)
22
23static const unsigned char smctr_code[] = {
24 0x0BC, 0x01D, 0x012, 0x03B, 0x063, 0x0B4, 0x0E9, 0x000,
25 0x000, 0x01F, 0x000, 0x001, 0x001, 0x000, 0x002, 0x005,
26 0x001, 0x000, 0x006, 0x003, 0x001, 0x000, 0x004, 0x009,
27 0x001, 0x000, 0x00A, 0x007, 0x001, 0x000, 0x008, 0x00B,
28 0x001, 0x000, 0x00C, 0x000, 0x000, 0x000, 0x000, 0x00F,
29 0x001, 0x000, 0x010, 0x00D, 0x001, 0x000, 0x00E, 0x013,
30 0x001, 0x000, 0x014, 0x011, 0x001, 0x000, 0x012, 0x000,
31 0x000, 0x005, 0x000, 0x015, 0x001, 0x000, 0x016, 0x019,
32 0x001, 0x000, 0x01A, 0x017, 0x001, 0x000, 0x018, 0x000,
33 0x000, 0x00E, 0x000, 0x000, 0x000, 0x001, 0x000, 0x000,
34 0x000, 0x004, 0x000, 0x01B, 0x001, 0x000, 0x01C, 0x000,
35 0x000, 0x007, 0x000, 0x000, 0x000, 0x00F, 0x000, 0x000,
36 0x000, 0x00B, 0x000, 0x01D, 0x001, 0x000, 0x01E, 0x000,
37 0x000, 0x008, 0x000, 0x000, 0x000, 0x002, 0x000, 0x000,
38 0x000, 0x00C, 0x000, 0x000, 0x000, 0x006, 0x000, 0x000,
39 0x000, 0x00D, 0x000, 0x000, 0x000, 0x003, 0x000, 0x000,
40 0x000, 0x00A, 0x000, 0x000, 0x000, 0x009, 0x000, 0x004,
41 0x078, 0x0C6, 0x0BC, 0x001, 0x094, 0x004, 0x093, 0x080,
42 0x0C8, 0x040, 0x062, 0x0E9, 0x0DA, 0x01C, 0x02C, 0x015,
43 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x058,
44 0x00B, 0x0E9, 0x0E5, 0x0D5, 0x095, 0x0C1, 0x09D, 0x077,
45 0x0CE, 0x0BB, 0x0A0, 0x06E, 0x01C, 0x005, 0x0F6, 0x077,
46 0x0C6, 0x002, 0x0FA, 0x096, 0x070, 0x0E8, 0x01D, 0x0C0,
47 0x017, 0x00E, 0x002, 0x0FA, 0x058, 0x07D, 0x0C0, 0x05F,
48 0x072, 0x0CE, 0x0EC, 0x0A4, 0x0C3, 0x084, 0x090, 0x07A,
49 0x030, 0x0CD, 0x08D, 0x079, 0x019, 0x0E7, 0x06C, 0x024,
50 0x027, 0x09C, 0x008, 0x039, 0x007, 0x038, 0x0A8, 0x04A,
51 0x04C, 0x0EA, 0x04D, 0x098, 0x09B, 0x024, 0x04C, 0x0C0,
52 0x026, 0x0D3, 0x0E7, 0x054, 0x05A, 0x04D, 0x0F2, 0x04C,
53 0x00C, 0x013, 0x023, 0x049, 0x090, 0x032, 0x06E, 0x0A4,
54 0x0DF, 0x093, 0x071, 0x013, 0x077, 0x026, 0x0E1, 0x026,
55 0x0F8, 0x026, 0x00C, 0x04C, 0x012, 0x026, 0x008, 0x009,
56 0x082, 0x082, 0x060, 0x0A9, 0x030, 0x079, 0x036, 0x0B0,
57 0x0B2, 0x0A8, 0x0A7, 0x072, 0x064, 0x08F, 0x09B, 0x033,
58 0x033, 0x0F9, 0x0B8, 0x039, 0x0D5, 0x011, 0x073, 0x0AA,
59 0x075, 0x026, 0x05D, 0x026, 0x051, 0x093, 0x02A, 0x049,
60 0x094, 0x0C9, 0x095, 0x089, 0x0BC, 0x04D, 0x0C8, 0x09B,
61 0x080, 0x09B, 0x0A0, 0x099, 0x006, 0x04C, 0x086, 0x026,
62 0x058, 0x09B, 0x0A4, 0x09B, 0x099, 0x037, 0x062, 0x06C,
63 0x067, 0x09B, 0x033, 0x030, 0x0BF, 0x036, 0x066, 0x061,
64 0x0BF, 0x036, 0x0EC, 0x0C5, 0x0BD, 0x066, 0x082, 0x05A,
65 0x050, 0x031, 0x0D5, 0x09D, 0x098, 0x018, 0x029, 0x03C,
66 0x098, 0x086, 0x04C, 0x017, 0x026, 0x03E, 0x02C, 0x0B8,
67 0x069, 0x03B, 0x049, 0x02E, 0x0B4, 0x008, 0x043, 0x01A,
68 0x0A4, 0x0F9, 0x0B3, 0x051, 0x0F1, 0x010, 0x0F3, 0x043,
69 0x0CD, 0x008, 0x06F, 0x063, 0x079, 0x0B3, 0x033, 0x00E,
70 0x013, 0x098, 0x049, 0x098, 0x004, 0x0DA, 0x07C, 0x0E0,
71 0x052, 0x079, 0x031, 0x00C, 0x098, 0x02E, 0x04D, 0x0AC,
72 0x02C, 0x084, 0x014, 0x0EE, 0x04C, 0x0FE, 0x067, 0x05E,
73 0x0E4, 0x09A, 0x075, 0x029, 0x0D7, 0x0A9, 0x035, 0x03A,
74 0x094, 0x05B, 0x0D5, 0x09B, 0x058, 0x0B4, 0x0AF, 0x075,
75 0x066, 0x0AF, 0x014, 0x0A9, 0x0EF, 0x040, 0x095, 0x025,
76 0x008, 0x0B9, 0x0AD, 0x042, 0x0FC, 0x0D8, 0x0D9, 0x08C,
77 0x033, 0x00E, 0x013, 0x098, 0x066, 0x01E, 0x045, 0x0AC,
78 0x0B0, 0x00C, 0x042, 0x0D3, 0x0CC, 0x0A6, 0x012, 0x062,
79 0x0DE, 0x0B4, 0x0B1, 0x080, 0x049, 0x07D, 0x0A2, 0x0DE,
80 0x0B4, 0x018, 0x0C0, 0x024, 0x084, 0x0E6, 0x054, 0x0F5,
81 0x083, 0x046, 0x001, 0x068, 0x01A, 0x063, 0x00C, 0x0C6,
82 0x012, 0x064, 0x0FA, 0x04C, 0x035, 0x01C, 0x02C, 0x00E,
83 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA,
84 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AD, 0x0D7, 0x002,
85 0x070, 0x0E0, 0x04C, 0x0F3, 0x0A1, 0x0C1, 0x0D5, 0x0C0,
86 0x03C, 0x0B9, 0x069, 0x039, 0x060, 0x04E, 0x058, 0x077,
87 0x002, 0x067, 0x093, 0x03C, 0x099, 0x0E4, 0x0CF, 0x038,
88 0x01C, 0x097, 0x02E, 0x040, 0x01B, 0x090, 0x031, 0x046,
89 0x0A3, 0x05E, 0x00E, 0x088, 0x034, 0x06A, 0x035, 0x0E0,
90 0x0E8, 0x0AA, 0x035, 0x01A, 0x0A9, 0x0F5, 0x015, 0x046,
91 0x0A3, 0x0EA, 0x07D, 0x04A, 0x0A3, 0x051, 0x0AA, 0x09F,
92 0x070, 0x054, 0x0A6, 0x057, 0x02E, 0x0B4, 0x0CD, 0x0C8,
93 0x0A3, 0x00C, 0x0C1, 0x0DA, 0x0C6, 0x0E1, 0x0CB, 0x07A,
94 0x0D4, 0x01C, 0x068, 0x0FF, 0x0CF, 0x055, 0x0A8, 0x0C0,
95 0x02D, 0x085, 0x011, 0x017, 0x044, 0x02A, 0x030, 0x00B,
96 0x04A, 0x088, 0x0C2, 0x04D, 0x0B5, 0x020, 0x0D5, 0x026,
97 0x001, 0x069, 0x051, 0x069, 0x052, 0x019, 0x052, 0x060,
98 0x016, 0x095, 0x016, 0x082, 0x096, 0x054, 0x098, 0x005,
99 0x0A5, 0x045, 0x0F3, 0x0DD, 0x06A, 0x0F9, 0x028, 0x018,
100 0x0EF, 0x000, 0x030, 0x030, 0x051, 0x04E, 0x044, 0x05D,
101 0x012, 0x0D1, 0x043, 0x0E6, 0x012, 0x06F, 0x09E, 0x0BA,
102 0x0CC, 0x0DF, 0x025, 0x003, 0x01D, 0x0E0, 0x006, 0x006,
103 0x00A, 0x030, 0x0CC, 0x0A9, 0x0EB, 0x02D, 0x000, 0x086,
104 0x0A6, 0x012, 0x065, 0x04F, 0x056, 0x0D6, 0x065, 0x049,
105 0x05F, 0x03D, 0x0E8, 0x037, 0x0C9, 0x040, 0x0C7, 0x078,
106 0x001, 0x081, 0x082, 0x08C, 0x033, 0x018, 0x049, 0x080,
107 0x0AE, 0x040, 0x0C5, 0x018, 0x005, 0x09C, 0x06D, 0x018,
108 0x066, 0x00E, 0x0F3, 0x0A0, 0x0C6, 0x012, 0x062, 0x0DE,
109 0x0F5, 0x004, 0x0B4, 0x0AC, 0x06B, 0x0C6, 0x019, 0x091,
110 0x073, 0x005, 0x048, 0x02E, 0x072, 0x094, 0x080, 0x073,
111 0x0A1, 0x0C8, 0x047, 0x036, 0x066, 0x064, 0x02F, 0x036,
112 0x066, 0x064, 0x007, 0x099, 0x002, 0x091, 0x08E, 0x072,
113 0x0D1, 0x00F, 0x09D, 0x006, 0x031, 0x073, 0x0A0, 0x0C3,
114 0x051, 0x06A, 0x01A, 0x020, 0x0BF, 0x03A, 0x00C, 0x02C,
115 0x073, 0x087, 0x043, 0x05E, 0x060, 0x002, 0x023, 0x0FC,
116 0x0E0, 0x0D6, 0x035, 0x0EF, 0x09E, 0x0F5, 0x0EF, 0x092,
117 0x081, 0x08E, 0x0F0, 0x003, 0x003, 0x005, 0x018, 0x066,
118 0x045, 0x0CC, 0x00B, 0x048, 0x02E, 0x070, 0x00A, 0x040,
119 0x039, 0x0D0, 0x0E4, 0x023, 0x09B, 0x033, 0x032, 0x017,
120 0x09B, 0x033, 0x032, 0x003, 0x0CC, 0x085, 0x048, 0x0C7,
121 0x038, 0x014, 0x0A5, 0x0CE, 0x029, 0x07E, 0x0D2, 0x080,
122 0x0A1, 0x0A8, 0x0B4, 0x048, 0x088, 0x02F, 0x0CE, 0x083,
123 0x00B, 0x01C, 0x0E1, 0x0D0, 0x0D7, 0x098, 0x004, 0x088,
124 0x087, 0x0CE, 0x096, 0x031, 0x073, 0x0A5, 0x08F, 0x0F3,
125 0x083, 0x058, 0x0D7, 0x0BE, 0x07B, 0x082, 0x0AF, 0x092,
126 0x081, 0x08E, 0x0F0, 0x003, 0x003, 0x005, 0x018, 0x066,
127 0x045, 0x0CC, 0x015, 0x020, 0x0B9, 0x0C8, 0x029, 0x000,
128 0x0E7, 0x043, 0x090, 0x08E, 0x06C, 0x0CC, 0x0C8, 0x05E,
129 0x06C, 0x0CC, 0x0C8, 0x00F, 0x032, 0x005, 0x023, 0x01C,
130 0x0E4, 0x050, 0x0D4, 0x05A, 0x017, 0x088, 0x02F, 0x0CE,
131 0x083, 0x010, 0x0F9, 0x0D0, 0x023, 0x017, 0x03A, 0x004,
132 0x035, 0x0E6, 0x000, 0x022, 0x016, 0x039, 0x0C3, 0x0A3,
133 0x0FC, 0x0E0, 0x0D6, 0x035, 0x0E0, 0x0BF, 0x0F4, 0x018,
134 0x0F2, 0x02D, 0x04D, 0x043, 0x051, 0x06E, 0x05A, 0x022,
135 0x01F, 0x030, 0x0D4, 0x017, 0x0E7, 0x041, 0x091, 0x073,
136 0x005, 0x048, 0x02E, 0x077, 0x069, 0x000, 0x0E7, 0x043,
137 0x090, 0x08E, 0x06C, 0x0CC, 0x0C8, 0x05E, 0x06C, 0x0CC,
138 0x0C8, 0x00F, 0x032, 0x005, 0x023, 0x01C, 0x0EF, 0x04C,
139 0x04E, 0x006, 0x004, 0x0C9, 0x09E, 0x00B, 0x0FF, 0x041,
140 0x08F, 0x022, 0x0D4, 0x0D4, 0x035, 0x016, 0x0E5, 0x0A2,
141 0x021, 0x0F3, 0x05A, 0x082, 0x0FC, 0x0E8, 0x032, 0x02E,
142 0x060, 0x0A9, 0x005, 0x0CE, 0x013, 0x048, 0x007, 0x03A,
143 0x01C, 0x084, 0x073, 0x066, 0x066, 0x042, 0x0F3, 0x066,
144 0x066, 0x040, 0x079, 0x090, 0x029, 0x018, 0x0E7, 0x00A,
145 0x098, 0x09C, 0x00A, 0x09E, 0x0B5, 0x012, 0x05C, 0x07C,
146 0x0C3, 0x031, 0x08B, 0x098, 0x02A, 0x07C, 0x0D3, 0x0ED,
147 0x038, 0x0E9, 0x0D3, 0x04E, 0x074, 0x0ED, 0x049, 0x09E,
148 0x00B, 0x0FF, 0x041, 0x08F, 0x022, 0x0D4, 0x0D4, 0x035,
149 0x016, 0x0E5, 0x0A2, 0x02D, 0x0EB, 0x045, 0x033, 0x08F,
150 0x0FC, 0x0F7, 0x0A0, 0x05F, 0x025, 0x003, 0x01D, 0x0E4,
151 0x00E, 0x006, 0x00A, 0x030, 0x0CC, 0x00C, 0x0F3, 0x0EB,
152 0x040, 0x0DE, 0x061, 0x0A8, 0x070, 0x092, 0x00A, 0x000,
153 0x0E1, 0x024, 0x01E, 0x000, 0x0E1, 0x024, 0x01E, 0x000,
154 0x0E1, 0x024, 0x01E, 0x000, 0x0E1, 0x024, 0x01E, 0x000,
155 0x0E1, 0x024, 0x01E, 0x001, 0x00F, 0x098, 0x02A, 0x00B,
156 0x0F3, 0x0A0, 0x0C8, 0x0B9, 0x0A2, 0x0A4, 0x017, 0x03A,
157 0x069, 0x000, 0x0E7, 0x043, 0x090, 0x08E, 0x075, 0x048,
158 0x05E, 0x070, 0x069, 0x001, 0x0E6, 0x000, 0x052, 0x031,
159 0x0CC, 0x018, 0x014, 0x0A5, 0x0CC, 0x009, 0x082, 0x094,
160 0x073, 0x00C, 0x0A0, 0x091, 0x0F5, 0x025, 0x0CC, 0x007,
161 0x006, 0x084, 0x084, 0x09F, 0x030, 0x0A2, 0x0A4, 0x07D,
162 0x050, 0x075, 0x0A6, 0x065, 0x001, 0x04A, 0x08E, 0x0B4,
163 0x0CC, 0x0C4, 0x035, 0x054, 0x075, 0x066, 0x0A4, 0x097,
164 0x07A, 0x089, 0x050, 0x053, 0x013, 0x080, 0x019, 0x0E3,
165 0x049, 0x05C, 0x06D, 0x0CE, 0x0A9, 0x040, 0x035, 0x006,
166 0x078, 0x0D2, 0x057, 0x006, 0x0F1, 0x0B3, 0x02A, 0x08D,
167 0x097, 0x023, 0x062, 0x092, 0x05D, 0x069, 0x099, 0x01C,
168 0x06A, 0x036, 0x0E6, 0x0CD, 0x046, 0x012, 0x06F, 0x09E,
169 0x0E1, 0x0AB, 0x0E4, 0x0A3, 0x00C, 0x0C0, 0x0DE, 0x0AC,
170 0x0D4, 0x00D, 0x028, 0x01B, 0x0D0, 0x012, 0x0A5, 0x000,
171 0x0F8, 0x04B, 0x0AD, 0x033, 0x028, 0x006, 0x0A0, 0x0DE,
172 0x014, 0x097, 0x03A, 0x089, 0x05D, 0x0C0, 0x00D, 0x0E3,
173 0x006, 0x090, 0x092, 0x05D, 0x069, 0x098, 0x066, 0x0B9,
174 0x019, 0x095, 0x0E4, 0x0A8, 0x0CF, 0x09D, 0x033, 0x018,
175 0x049, 0x0BE, 0x07B, 0x086, 0x0AF, 0x092, 0x08C, 0x033,
176 0x024, 0x014, 0x00C, 0x0F4, 0x083, 0x024, 0x021, 0x0C2,
177 0x070, 0x0BF, 0x0F4, 0x018, 0x0F2, 0x02D, 0x04D, 0x043,
178 0x051, 0x06E, 0x05A, 0x022, 0x01F, 0x032, 0x0A8, 0x02F,
179 0x0CE, 0x083, 0x022, 0x0E6, 0x005, 0x0A4, 0x017, 0x03A,
180 0x069, 0x000, 0x0E7, 0x043, 0x090, 0x08E, 0x075, 0x048,
181 0x05E, 0x070, 0x069, 0x001, 0x0E6, 0x042, 0x0A4, 0x063,
182 0x098, 0x002, 0x029, 0x04B, 0x09A, 0x029, 0x078, 0x0E9,
183 0x040, 0x053, 0x013, 0x081, 0x081, 0x032, 0x067, 0x082,
184 0x0FF, 0x0D0, 0x063, 0x0C8, 0x0B5, 0x035, 0x00D, 0x045,
185 0x0AE, 0x050, 0x008, 0x07C, 0x0E0, 0x0D0, 0x05F, 0x09D,
186 0x006, 0x045, 0x0CC, 0x001, 0x0A4, 0x017, 0x03A, 0x069,
187 0x000, 0x0E7, 0x043, 0x090, 0x08E, 0x075, 0x048, 0x05E,
188 0x070, 0x069, 0x001, 0x0E6, 0x059, 0x0A4, 0x063, 0x098,
189 0x01C, 0x052, 0x097, 0x03B, 0x030, 0x052, 0x08E, 0x07D,
190 0x02A, 0x009, 0x01F, 0x051, 0x0EB, 0x0A4, 0x0A4, 0x00A,
191 0x0B9, 0x094, 0x087, 0x0AE, 0x0C5, 0x031, 0x038, 0x002,
192 0x0FF, 0x0D0, 0x063, 0x0C8, 0x0B5, 0x035, 0x00D, 0x045,
193 0x0AE, 0x050, 0x008, 0x07C, 0x0EA, 0x020, 0x0BF, 0x03A,
194 0x00C, 0x08B, 0x09A, 0x016, 0x090, 0x05C, 0x0E9, 0x0A4,
195 0x003, 0x09D, 0x00E, 0x042, 0x039, 0x0D5, 0x021, 0x079,
196 0x095, 0x048, 0x00F, 0x030, 0x00A, 0x091, 0x08E, 0x060,
197 0x0EB, 0x029, 0x073, 0x000, 0x009, 0x054, 0x004, 0x0CA,
198 0x082, 0x065, 0x052, 0x065, 0x0E4, 0x0CA, 0x022, 0x065,
199 0x072, 0x065, 0x009, 0x032, 0x0E0, 0x099, 0x072, 0x04C,
200 0x0C4, 0x0E0, 0x00B, 0x0FF, 0x041, 0x08F, 0x022, 0x0D4,
201 0x0D4, 0x035, 0x016, 0x0B9, 0x040, 0x021, 0x0F3, 0x08A,
202 0x082, 0x0FC, 0x0E8, 0x032, 0x02E, 0x060, 0x0A9, 0x005,
203 0x0CE, 0x09A, 0x040, 0x039, 0x0D0, 0x0E4, 0x023, 0x09D,
204 0x052, 0x017, 0x099, 0x054, 0x061, 0x099, 0x001, 0x0E6,
205 0x040, 0x0A4, 0x063, 0x098, 0x004, 0x0B1, 0x084, 0x098,
206 0x018, 0x0EF, 0x02D, 0x003, 0x005, 0x031, 0x038, 0x002,
207 0x0FF, 0x0D0, 0x063, 0x0C8, 0x0B5, 0x035, 0x00D, 0x045,
208 0x0B9, 0x068, 0x088, 0x07C, 0x0E0, 0x050, 0x05F, 0x09D,
209 0x006, 0x045, 0x0CC, 0x081, 0x048, 0x02E, 0x071, 0x034,
210 0x08F, 0x048, 0x001, 0x048, 0x015, 0x021, 0x005, 0x021,
211 0x0E9, 0x00A, 0x052, 0x003, 0x0CE, 0x05A, 0x046, 0x039,
212 0x0CF, 0x047, 0x08E, 0x060, 0x0AB, 0x01A, 0x0F3, 0x053,
213 0x043, 0x0EB, 0x035, 0x024, 0x0B8, 0x01B, 0x030, 0x007,
214 0x009, 0x08A, 0x074, 0x02F, 0x07E, 0x041, 0x074, 0x01E,
215 0x01D, 0x00D, 0x087, 0x046, 0x049, 0x0D5, 0x095, 0x0D1,
216 0x0D5, 0x0D5, 0x0BB, 0x0A9, 0x04E, 0x082, 0x09D, 0x005,
217 0x03A, 0x00A, 0x074, 0x014, 0x0E8, 0x029, 0x0D0, 0x042,
218 0x074, 0x05B, 0x0CE, 0x050, 0x0C4, 0x007, 0x045, 0x0BC,
219 0x0E2, 0x00C, 0x040, 0x074, 0x05B, 0x0CE, 0x083, 0x004,
220 0x0F9, 0x095, 0x04D, 0x013, 0x063, 0x05E, 0x06F, 0x031,
221 0x03B, 0x0A0, 0x08B, 0x0A2, 0x0C5, 0x039, 0x08D, 0x078,
222 0x03A, 0x022, 0x0A0, 0x000, 0x06B, 0x0C1, 0x0D1, 0x054,
223 0x060, 0x016, 0x0D9, 0x091, 0x0A2, 0x0E7, 0x043, 0x08C,
224 0x024, 0x0DC, 0x01C, 0x0E0, 0x051, 0x017, 0x039, 0x06B,
225 0x03B, 0x0CC, 0x04B, 0x042, 0x02E, 0x06B, 0x050, 0x0BF,
226 0x036, 0x036, 0x065, 0x04F, 0x07A, 0x018, 0x055, 0x025,
227 0x078, 0x098, 0x023, 0x0E7, 0x050, 0x03E, 0x0F3, 0x081,
228 0x04C, 0x002, 0x06D, 0x03E, 0x071, 0x053, 0x0AF, 0x078,
229 0x0A9, 0x0D4, 0x0A6, 0x029, 0x0B1, 0x0BC, 0x0D9, 0x099,
230 0x0B2, 0x08E, 0x062, 0x08F, 0x022, 0x02E, 0x075, 0x016,
231 0x0B0, 0x0B2, 0x0AB, 0x023, 0x028, 0x016, 0x054, 0x052,
232 0x031, 0x0BC, 0x0D9, 0x099, 0x0B2, 0x08E, 0x066, 0x019,
233 0x002, 0x02E, 0x075, 0x016, 0x050, 0x02C, 0x0A9, 0x0C8,
234 0x0C6, 0x0F5, 0x020, 0x0D3, 0x0E4, 0x07F, 0x04F, 0x09C,
235 0x00A, 0x0D6, 0x016, 0x07F, 0x090, 0x0EE, 0x04C, 0x0EB,
236 0x0CF, 0x0E2, 0x088, 0x0BA, 0x02F, 0x042, 0x086, 0x0AE,
237 0x0BD, 0x0E5, 0x0A7, 0x052, 0x09F, 0x093, 0x063, 0x079,
238 0x0EB, 0x033, 0x008, 0x0F9, 0x094, 0x052, 0x047, 0x0CD,
239 0x099, 0x025, 0x06F, 0x03A, 0x00C, 0x013, 0x0E6, 0x055,
240 0x034, 0x04C, 0x05A, 0x04D, 0x0B5, 0x023, 0x095, 0x0A5,
241 0x048, 0x011, 0x05A, 0x00A, 0x043, 0x095, 0x0AC, 0x02C,
242 0x0BA, 0x024, 0x005, 0x049, 0x0B1, 0x0BC, 0x0CA, 0x0A7,
243 0x072, 0x06C, 0x06B, 0x0C5, 0x0BD, 0x0E8, 0x031, 0x069,
244 0x052, 0x05D, 0x006, 0x012, 0x065, 0x03E, 0x0B1, 0x050,
245 0x04C, 0x07D, 0x04F, 0x0AC, 0x00A, 0x030, 0x00B, 0x036,
246 0x064, 0x011, 0x073, 0x08A, 0x083, 0x08E, 0x075, 0x012,
247 0x09F, 0x07B, 0x0D2, 0x099, 0x058, 0x0EE, 0x082, 0x02E,
248 0x077, 0x0A0, 0x0E3, 0x09D, 0x05D, 0x04F, 0x0BC, 0x02A,
249 0x053, 0x029, 0x053, 0x0DE, 0x093, 0x024, 0x0BA, 0x0B3,
250 0x036, 0x0AA, 0x04A, 0x0C6, 0x079, 0x0D4, 0x0B9, 0x0DE,
251 0x062, 0x05A, 0x011, 0x073, 0x050, 0x050, 0x0BF, 0x037,
252 0x036, 0x06F, 0x013, 0x023, 0x0BA, 0x00C, 0x024, 0x0CE,
253 0x0BD, 0x0E2, 0x0A7, 0x052, 0x0B2, 0x08E, 0x06B, 0x060,
254 0x062, 0x02E, 0x075, 0x013, 0x030, 0x0AC, 0x0A0, 0x059,
255 0x0CA, 0x064, 0x063, 0x079, 0x0B3, 0x033, 0x065, 0x01C,
256 0x0CC, 0x032, 0x004, 0x05C, 0x0EA, 0x02C, 0x0A0, 0x059,
257 0x0DF, 0x023, 0x01B, 0x0D4, 0x083, 0x052, 0x047, 0x0DD,
258 0x079, 0x096, 0x0D4, 0x09E, 0x0B3, 0x052, 0x04B, 0x0A2,
259 0x05A, 0x01A, 0x08D, 0x05D, 0x07B, 0x082, 0x0A7, 0x052,
260 0x0B2, 0x08E, 0x066, 0x019, 0x002, 0x02E, 0x075, 0x016,
261 0x050, 0x02C, 0x08C, 0x032, 0x01D, 0x07B, 0x08E, 0x0A7,
262 0x052, 0x0B1, 0x0BC, 0x0D9, 0x099, 0x098, 0x004, 0x0DA,
263 0x07C, 0x0E2, 0x0AC, 0x0FE, 0x066, 0x019, 0x002, 0x02E,
264 0x065, 0x050, 0x0BF, 0x033, 0x066, 0x064, 0x0FE, 0x074,
265 0x018, 0x086, 0x04C, 0x017, 0x026, 0x0D6, 0x016, 0x052,
266 0x039, 0x018, 0x0DE, 0x07A, 0x0CC, 0x0C2, 0x03E, 0x065,
267 0x014, 0x091, 0x0F3, 0x066, 0x049, 0x008, 0x06E, 0x083,
268 0x009, 0x033, 0x0AF, 0x031, 0x0ED, 0x00D, 0x09D, 0x006,
269 0x012, 0x062, 0x02A, 0x031, 0x08D, 0x06D, 0x0E7, 0x041,
270 0x082, 0x07C, 0x0CA, 0x0A6, 0x089, 0x087, 0x009, 0x02E,
271 0x029, 0x0B1, 0x0AF, 0x010, 0x039, 0x0D6, 0x064, 0x097,
272 0x030, 0x01D, 0x042, 0x075, 0x093, 0x044, 0x002, 0x08C,
273 0x024, 0x0D2, 0x07A, 0x0B3, 0x050, 0x0F6, 0x089, 0x005,
274 0x043, 0x05E, 0x061, 0x098, 0x0C0, 0x02C, 0x092, 0x025,
275 0x03C, 0x08B, 0x024, 0x089, 0x049, 0x005, 0x049, 0x0E7,
276 0x00C, 0x0B9, 0x084, 0x098, 0x0B7, 0x0AD, 0x033, 0x044,
277 0x0AE, 0x05A, 0x051, 0x086, 0x060, 0x09F, 0x038, 0x0A9,
278 0x0A2, 0x06C, 0x06B, 0x0C4, 0x08E, 0x0F4, 0x05E, 0x049,
279 0x046, 0x012, 0x062, 0x0DE, 0x0B4, 0x0CD, 0x021, 0x05C,
280 0x0B4, 0x0A3, 0x00C, 0x0C1, 0x03E, 0x072, 0x029, 0x0A2,
281 0x06C, 0x06B, 0x0C6, 0x012, 0x062, 0x047, 0x0F0, 0x0E8,
282 0x0C3, 0x032, 0x004, 0x035, 0x040, 0x092, 0x0A4, 0x082,
283 0x088, 0x010, 0x092, 0x07C, 0x0CB, 0x0D4, 0x02F, 0x0A4,
284 0x002, 0x011, 0x084, 0x098, 0x0B7, 0x0AD, 0x033, 0x044,
285 0x0AE, 0x05A, 0x051, 0x086, 0x060, 0x09F, 0x038, 0x0A9,
286 0x0A2, 0x06C, 0x06B, 0x0C4, 0x08E, 0x0F4, 0x05E, 0x049,
287 0x044, 0x008, 0x049, 0x03E, 0x065, 0x0EA, 0x017, 0x0D2,
288 0x001, 0x008, 0x0C2, 0x04C, 0x05B, 0x0D6, 0x099, 0x0A4,
289 0x02B, 0x096, 0x094, 0x061, 0x098, 0x027, 0x0CE, 0x045,
290 0x034, 0x04D, 0x08D, 0x078, 0x081, 0x009, 0x027, 0x0CC,
291 0x0BD, 0x012, 0x028, 0x06C, 0x058, 0x0AF, 0x0B6, 0x0F3,
292 0x0A0, 0x0C1, 0x03E, 0x065, 0x053, 0x044, 0x0D8, 0x0D7,
293 0x092, 0x08E, 0x07D, 0x04B, 0x0C2, 0x0FA, 0x061, 0x026,
294 0x006, 0x03A, 0x0B3, 0x06B, 0x003, 0x005, 0x049, 0x0E7,
295 0x00C, 0x0B9, 0x06F, 0x05A, 0x066, 0x095, 0x05C, 0x0B4,
296 0x0A3, 0x00C, 0x0C1, 0x03E, 0x070, 0x029, 0x0A2, 0x06E,
297 0x0A4, 0x0DF, 0x093, 0x071, 0x013, 0x077, 0x026, 0x0E1,
298 0x026, 0x0F8, 0x026, 0x0C6, 0x0BC, 0x094, 0x073, 0x0F9,
299 0x02F, 0x00B, 0x0E9, 0x084, 0x098, 0x018, 0x0EA, 0x0CC,
300 0x0EC, 0x00C, 0x015, 0x027, 0x09C, 0x032, 0x0FF, 0x03D,
301 0x056, 0x0AF, 0x092, 0x08B, 0x07A, 0x0D3, 0x035, 0x0D5,
302 0x0CB, 0x04A, 0x030, 0x0CC, 0x013, 0x0E7, 0x002, 0x09A,
303 0x026, 0x0C6, 0x0BC, 0x094, 0x073, 0x041, 0x097, 0x091,
304 0x0F4, 0x083, 0x0CE, 0x004, 0x020, 0x062, 0x08B, 0x005,
305 0x016, 0x049, 0x08C, 0x024, 0x0C0, 0x0C7, 0x056, 0x090,
306 0x0C0, 0x0C1, 0x052, 0x079, 0x0C3, 0x02E, 0x05B, 0x0D5,
307 0x0A6, 0x072, 0x0D2, 0x094, 0x0FA, 0x0AD, 0x058, 0x0C8,
308 0x0FA, 0x09F, 0x054, 0x0B3, 0x032, 0x04B, 0x0B9, 0x054,
309 0x0A6, 0x051, 0x086, 0x06B, 0x079, 0x0D0, 0x060, 0x09F,
310 0x032, 0x005, 0x034, 0x04D, 0x08D, 0x07A, 0x04D, 0x01E,
311 0x07A, 0x0B3, 0x051, 0x000, 0x0A9, 0x03D, 0x059, 0x0A8,
312 0x07B, 0x044, 0x082, 0x0A1, 0x0AF, 0x04A, 0x08D, 0x052,
313 0x0A9, 0x052, 0x041, 0x049, 0x04F, 0x03A, 0x02E, 0x040,
314 0x0A4, 0x099, 0x050, 0x0BE, 0x090, 0x008, 0x052, 0x079,
315 0x0C3, 0x02E, 0x061, 0x026, 0x02D, 0x0EB, 0x04C, 0x0D0,
316 0x015, 0x0CB, 0x04A, 0x030, 0x0CC, 0x013, 0x0E7, 0x002,
317 0x09A, 0x026, 0x0C6, 0x0BC, 0x048, 0x0FE, 0x01D, 0x025,
318 0x046, 0x0A9, 0x054, 0x0A9, 0x020, 0x0A4, 0x0A7, 0x09D,
319 0x017, 0x020, 0x052, 0x04C, 0x0A8, 0x05F, 0x048, 0x004,
320 0x023, 0x009, 0x031, 0x06F, 0x05A, 0x066, 0x080, 0x0AE,
321 0x05A, 0x051, 0x086, 0x060, 0x09F, 0x038, 0x014, 0x0D1,
322 0x036, 0x035, 0x0E4, 0x0A7, 0x09D, 0x017, 0x020, 0x052,
323 0x04C, 0x0A2, 0x045, 0x00D, 0x08B, 0x015, 0x0F4, 0x091,
324 0x0DE, 0x08B, 0x0C9, 0x028, 0x0C2, 0x04C, 0x05B, 0x0D6,
325 0x099, 0x0A9, 0x05C, 0x0B4, 0x0A3, 0x00C, 0x0D6, 0x0F3,
326 0x0A0, 0x0C1, 0x03E, 0x064, 0x00A, 0x068, 0x09B, 0x01A,
327 0x0F1, 0x06D, 0x04C, 0x0AA, 0x092, 0x0E0, 0x036, 0x094,
328 0x070, 0x09B, 0x029, 0x078, 0x013, 0x0AE, 0x0B3, 0x0AA,
329 0x085, 0x0D4, 0x043, 0x075, 0x009, 0x03A, 0x0C9, 0x0EB,
330 0x035, 0x024, 0x0B8, 0x01B, 0x032, 0x08E, 0x013, 0x048,
331 0x07E, 0x04E, 0x0FD, 0x040, 0x0FD, 0x040, 0x0FD, 0x040,
332 0x0FD, 0x040, 0x0FD, 0x040, 0x0FC, 0x013, 0x0F4, 0x021,
333 0x0F9, 0x017, 0x045, 0x08A, 0x030, 0x00B, 0x033, 0x05F,
334 0x083, 0x0A2, 0x02A, 0x030, 0x00B, 0x033, 0x05F, 0x083,
335 0x0A2, 0x0A8, 0x0C0, 0x02D, 0x0B3, 0x020, 0x070, 0x092,
336 0x013, 0x09A, 0x0DE, 0x074, 0x018, 0x027, 0x0CC, 0x0AA,
337 0x068, 0x09B, 0x01A, 0x0F7, 0x007, 0x045, 0x051, 0x080,
338 0x05B, 0x066, 0x047, 0x007, 0x038, 0x0A8, 0x023, 0x0E7,
339 0x051, 0x011, 0x03F, 0x0E0, 0x0E8, 0x085, 0x046, 0x001,
340 0x06D, 0x099, 0x006, 0x012, 0x065, 0x04F, 0x07A, 0x020,
341 0x024, 0x0BA, 0x0B3, 0x032, 0x015, 0x025, 0x07B, 0x0AD,
342 0x033, 0x078, 0x0AE, 0x00E, 0x073, 0x0D0, 0x047, 0x0CE,
343 0x0A7, 0x030, 0x0CC, 0x044, 0x0FF, 0x083, 0x0A2, 0x0A8,
344 0x0C0, 0x02C, 0x0D9, 0x091, 0x0C1, 0x0D1, 0x015, 0x018,
345 0x005, 0x09B, 0x032, 0x008, 0x0BA, 0x02C, 0x051, 0x080,
346 0x059, 0x0B3, 0x020, 0x070, 0x092, 0x0E2, 0x098, 0x089,
347 0x0FD, 0x0BC, 0x0EE, 0x018, 0x090, 0x0FC, 0x08B, 0x0A2,
348 0x0C5, 0x02B, 0x00D, 0x078, 0x03A, 0x022, 0x0A5, 0x061,
349 0x0AF, 0x007, 0x045, 0x051, 0x080, 0x05B, 0x066, 0x044,
350 0x09E, 0x0B3, 0x052, 0x04B, 0x083, 0x0AD, 0x0C7, 0x009,
351 0x0BE, 0x01F, 0x09F, 0x074, 0x065, 0x05D, 0x00A, 0x017,
352 0x07C, 0x0AB, 0x0A0, 0x0C2, 0x04C, 0x038, 0x049, 0x012,
353 0x02E, 0x038, 0x049, 0x007, 0x0A3, 0x00C, 0x0C1, 0x03E,
354 0x065, 0x053, 0x044, 0x0D8, 0x0D7, 0x0AD, 0x0E7, 0x000,
355 0x032, 0x04B, 0x09B, 0x033, 0x034, 0x04A, 0x003, 0x000,
356 0x09D, 0x025, 0x0CE, 0x083, 0x024, 0x0B8, 0x019, 0x099,
357 0x08C, 0x002, 0x012, 0x04B, 0x0A1, 0x099, 0x0D8, 0x0C0,
358 0x027, 0x049, 0x073, 0x0CF, 0x0F9, 0x03C, 0x0F4, 0x07C,
359 0x0E7, 0x098, 0x004, 0x0E9, 0x02E, 0x07F, 0x039, 0x0E3,
360 0x04F, 0x046, 0x053, 0x0C0, 0x060, 0x013, 0x0A4, 0x0B9,
361 0x0E5, 0x03C, 0x003, 0x0DE, 0x08F, 0x09C, 0x0F3, 0x000,
362 0x09C, 0x06F, 0x0CF, 0x03E, 0x085, 0x0F9, 0x0A3, 0x036,
363 0x002, 0x01E, 0x060, 0x038, 0x092, 0x03E, 0x063, 0x01A,
364 0x010, 0x09F, 0x0CF, 0x018, 0x010, 0x092, 0x0BC, 0x0D0,
365 0x0A4, 0x00C, 0x0DC, 0x0C0, 0x00F, 0x09C, 0x097, 0x034,
366 0x062, 0x0B6, 0x0E7, 0x0F3, 0x0F3, 0x0A5, 0x0CF, 0x018,
367 0x042, 0x034, 0x01C, 0x0C2, 0x0CA, 0x0FA, 0x08E, 0x068,
368 0x052, 0x006, 0x0AF, 0x03C, 0x0A3, 0x00D, 0x0BF, 0x09E,
369 0x050, 0x0E1, 0x0D1, 0x073, 0x0CA, 0x0E0, 0x03A, 0x0FC,
370 0x0C1, 0x009, 0x01A, 0x01E, 0x06A, 0x05C, 0x05B, 0x08E,
371 0x063, 0x04E, 0x077, 0x073, 0x0CC, 0x061, 0x067, 0x0DD,
372 0x0E6, 0x06C, 0x048, 0x0D1, 0x0F3, 0x01B, 0x024, 0x069,
373 0x051, 0x008, 0x0D4, 0x042, 0x01B, 0x0F4, 0x067, 0x0D1,
374 0x080, 0x04E, 0x02F, 0x0D0, 0x08C, 0x0D8, 0x030, 0x009,
375 0x0C2, 0x01E, 0x080, 0x01C, 0x046, 0x001, 0x03A, 0x047,
376 0x0D0, 0x031, 0x0A1, 0x006, 0x001, 0x03A, 0x07F, 0x046,
377 0x030, 0x021, 0x018, 0x004, 0x0E9, 0x05E, 0x084, 0x029,
378 0x000, 0x0C0, 0x027, 0x0CD, 0x0D0, 0x000, 0x07C, 0x098,
379 0x004, 0x0F9, 0x02E, 0x084, 0x062, 0x08C, 0x002, 0x07D,
380 0x0BA, 0x03E, 0x07E, 0x04C, 0x002, 0x07D, 0x02E, 0x08C,
381 0x061, 0x008, 0x030, 0x009, 0x0F4, 0x01D, 0x001, 0x065,
382 0x073, 0x000, 0x09F, 0x051, 0x0D0, 0x085, 0x020, 0x018,
383 0x004, 0x0FA, 0x0BD, 0x019, 0x046, 0x018, 0x0C0, 0x027,
384 0x0DF, 0x0D1, 0x094, 0x038, 0x04C, 0x002, 0x07D, 0x017,
385 0x046, 0x057, 0x001, 0x030, 0x009, 0x0F5, 0x0FA, 0x001,
386 0x009, 0x006, 0x001, 0x03E, 0x087, 0x0A1, 0x04B, 0x088,
387 0x0C0, 0x027, 0x0DC, 0x074, 0x00D, 0x039, 0x0D3, 0x000,
388 0x09F, 0x073, 0x0D0, 0x030, 0x0B3, 0x098, 0x004, 0x0FB,
389 0x0BD, 0x006, 0x0C4, 0x083, 0x000, 0x09F, 0x047, 0x0D0,
390 0x036, 0x048, 0x0CC, 0x002, 0x071, 0x0BF, 0x03F, 0x09A,
391 0x017, 0x0E6, 0x03F, 0x008, 0x021, 0x0E6, 0x092, 0x0A4,
392 0x08F, 0x09A, 0x010, 0x031, 0x0A7, 0x0F3, 0x010, 0x0B1,
393 0x084, 0x0AF, 0x03A, 0x0AC, 0x0DC, 0x0F7, 0x073, 0x0F2,
394 0x05C, 0x0C6, 0x02A, 0x0DB, 0x09E, 0x07E, 0x07E, 0x097,
395 0x031, 0x008, 0x063, 0x0D0, 0x073, 0x07B, 0x043, 0x0A8,
396 0x0E6, 0x03D, 0x034, 0x0EA, 0x0F3, 0x0E3, 0x015, 0x0BF,
397 0x09F, 0x018, 0x05F, 0x045, 0x0CF, 0x0E8, 0x09F, 0x05F,
398 0x09A, 0x05B, 0x003, 0x0D0, 0x0F3, 0x0D3, 0x0CE, 0x037,
399 0x01C, 0x0D0, 0x00F, 0x0BB, 0x09E, 0x068, 0x078, 0x03B,
400 0x0BC, 0x0CA, 0x031, 0x0E8, 0x0F9, 0x0A2, 0x002, 0x012,
401 0x0A2, 0x073, 0x051, 0x008, 0x06F, 0x0D1, 0x0F3, 0x046,
402 0x001, 0x038, 0x0BF, 0x040, 0x0FC, 0x023, 0x000, 0x09C,
403 0x021, 0x0E8, 0x049, 0x051, 0x080, 0x04E, 0x091, 0x0F4,
404 0x021, 0x003, 0x019, 0x080, 0x04E, 0x09F, 0x0D0, 0x021,
405 0x063, 0x006, 0x001, 0x03A, 0x056, 0x08C, 0x002, 0x074,
406 0x0FE, 0x075, 0x049, 0x05E, 0x063, 0x0D3, 0x04A, 0x054,
407 0x042, 0x035, 0x013, 0x0A7, 0x0D1, 0x080, 0x04E, 0x095,
408 0x0E8, 0x01E, 0x09A, 0x04C, 0x002, 0x07C, 0x0DD, 0x01B,
409 0x0B9, 0x0E6, 0x001, 0x03E, 0x04B, 0x0A0, 0x062, 0x0A3,
410 0x000, 0x09F, 0x06E, 0x08C, 0x0FC, 0x0F3, 0x000, 0x09F,
411 0x04B, 0x0A0, 0x042, 0x018, 0x0CC, 0x002, 0x07D, 0x007,
412 0x043, 0x0DA, 0x013, 0x000, 0x09F, 0x051, 0x0D0, 0x03D,
413 0x034, 0x098, 0x004, 0x0FA, 0x0BD, 0x01C, 0x062, 0x08C,
414 0x002, 0x07D, 0x0FD, 0x01C, 0x061, 0x073, 0x000, 0x09F,
415 0x045, 0x0D1, 0x0F4, 0x04E, 0x060, 0x013, 0x0EB, 0x0F4,
416 0x025, 0x0B0, 0x033, 0x000, 0x09F, 0x043, 0x0D1, 0x0A7,
417 0x09C, 0x018, 0x004, 0x0FB, 0x08E, 0x084, 0x003, 0x0E9,
418 0x080, 0x04F, 0x0B9, 0x0E8, 0x043, 0x0C1, 0x030, 0x009,
419 0x0F7, 0x07A, 0x00A, 0x031, 0x098, 0x004, 0x0FA, 0x03E,
420 0x084, 0x040, 0x041, 0x080, 0x04E, 0x082, 0x0E7, 0x041,
421 0x087, 0x009, 0x023, 0x004, 0x023, 0x000, 0x09D, 0x005,
422 0x0CE, 0x096, 0x01C, 0x024, 0x08C, 0x010, 0x08C, 0x002,
423 0x074, 0x017, 0x03A, 0x004, 0x038, 0x049, 0x018, 0x021,
424 0x018, 0x004, 0x0E8, 0x02E, 0x074, 0x050, 0x0E1, 0x024,
425 0x060, 0x084, 0x060, 0x013, 0x0A0, 0x0B9, 0x0D4, 0x011,
426 0x0C2, 0x048, 0x0C1, 0x008, 0x0C0, 0x027, 0x041, 0x073,
427 0x0A8, 0x023, 0x084, 0x091, 0x082, 0x011, 0x080, 0x04E,
428 0x082, 0x0E7, 0x052, 0x08E, 0x012, 0x046, 0x008, 0x046,
429 0x001, 0x03A, 0x00B, 0x09D, 0x040, 0x01C, 0x024, 0x08C,
430 0x010, 0x08C, 0x002, 0x074, 0x017, 0x03A, 0x009, 0x00E,
431 0x012, 0x046, 0x008, 0x046, 0x001, 0x03A, 0x00B, 0x098,
432 0x06A, 0x01C, 0x024, 0x0B0, 0x0E1, 0x018, 0x004, 0x0E8,
433 0x02E, 0x06B, 0x050, 0x0E1, 0x025, 0x087, 0x008, 0x0C0,
434 0x027, 0x041, 0x073, 0x005, 0x043, 0x084, 0x096, 0x01C,
435 0x023, 0x000, 0x09D, 0x005, 0x0CC, 0x0AA, 0x01C, 0x024,
436 0x0B0, 0x0E1, 0x018, 0x004, 0x0E8, 0x02E, 0x070, 0x068,
437 0x070, 0x092, 0x0C3, 0x084, 0x060, 0x013, 0x0E5, 0x044,
438 0x0F9, 0x040, 0x09D, 0x005, 0x0CE, 0x05A, 0x01C, 0x024,
439 0x0B0, 0x0E1, 0x018, 0x004, 0x0F9, 0x0D1, 0x03E, 0x070,
440 0x027, 0x0CF, 0x013, 0x0E5, 0x044, 0x02C, 0x0A0, 0x042,
441 0x0CB, 0x089, 0x0F2, 0x021, 0x03A, 0x00B, 0x09C, 0x00A,
442 0x01C, 0x024, 0x0B0, 0x0E1, 0x018, 0x004, 0x0F9, 0x0D1,
443 0x00B, 0x038, 0x010, 0x0B3, 0x0C4, 0x021, 0x039, 0x036,
444 0x05C, 0x042, 0x0C8, 0x084, 0x02B, 0x079, 0x0D0, 0x061,
445 0x0C2, 0x074, 0x015, 0x024, 0x0BA, 0x0D3, 0x031, 0x0E5,
446 0x059, 0x008, 0x029, 0x008, 0x0E0, 0x066, 0x063, 0x042,
447 0x095, 0x012, 0x081, 0x000, 0x029, 0x00B, 0x0C1, 0x051,
448 0x024, 0x0B8, 0x019, 0x099, 0x090, 0x022, 0x090, 0x0B4,
449 0x018, 0x0A0, 0x091, 0x041, 0x001, 0x041, 0x041, 0x041,
450 0x052, 0x083, 0x0CA, 0x040, 0x028, 0x068, 0x029, 0x008,
451 0x0BA, 0x016, 0x010, 0x09C, 0x099, 0x00B, 0x056, 0x094,
452 0x090, 0x052, 0x015, 0x074, 0x0C0, 0x027, 0x01A, 0x02A,
453 0x0D2, 0x090, 0x025, 0x0D3, 0x000, 0x09D, 0x028, 0x0AB,
454 0x04A, 0x042, 0x017, 0x04C, 0x002, 0x070, 0x0D4, 0x084,
455 0x02E, 0x098, 0x004, 0x0E1, 0x02A, 0x042, 0x017, 0x04C,
456 0x002, 0x070, 0x082, 0x090, 0x04B, 0x0A6, 0x001, 0x038,
457 0x051, 0x048, 0x042, 0x0E9, 0x080, 0x04E, 0x015, 0x0A4,
458 0x021, 0x074, 0x0C0, 0x027, 0x00F, 0x0A4, 0x012, 0x0E9,
459 0x080, 0x04E, 0x082, 0x0AC, 0x080, 0x0AC, 0x0A0, 0x0AC,
460 0x0A9, 0x059, 0x0E5, 0x064, 0x045, 0x065, 0x0CA, 0x0C8,
461 0x04A, 0x0CE, 0x00A, 0x0CE, 0x04A, 0x0CE, 0x095, 0x091,
462 0x095, 0x094, 0x095, 0x093, 0x029, 0x025, 0x0C0, 0x0CC,
463 0x0CC, 0x088, 0x0A4, 0x097, 0x056, 0x036, 0x064, 0x072,
464 0x090, 0x054, 0x08A, 0x09C, 0x045, 0x008, 0x0B9, 0x0B7,
465 0x066, 0x012, 0x093, 0x009, 0x0C9, 0x0B2, 0x074, 0x08E,
466 0x0BA, 0x060, 0x013, 0x0E5, 0x034, 0x08E, 0x0BA, 0x060,
467 0x013, 0x0E4, 0x074, 0x08E, 0x0BA, 0x060, 0x013, 0x0E5,
468 0x069, 0x01D, 0x074, 0x0C0, 0x027, 0x0CA, 0x029, 0x01D,
469 0x074, 0x0C0, 0x027, 0x0CE, 0x0D2, 0x025, 0x0D3, 0x000,
470 0x09F, 0x038, 0x0A4, 0x04B, 0x0A6, 0x001, 0x03E, 0x05E,
471 0x091, 0x02E, 0x098, 0x004, 0x0F9, 0x015, 0x022, 0x05D,
472 0x030, 0x009, 0x0F3, 0x0E9, 0x012, 0x0E9, 0x080, 0x04F,
473 0x090, 0x052, 0x025, 0x0D3, 0x000, 0x09D, 0x0C5, 0x048,
474 0x025, 0x0D3, 0x000, 0x09C, 0x045, 0x0CE, 0x0CD, 0x009,
475 0x0C9, 0x0B2, 0x01A, 0x044, 0x0BA, 0x060, 0x013, 0x0E7,
476 0x034, 0x089, 0x074, 0x0C0, 0x027, 0x01C, 0x027, 0x0B7,
477 0x09C, 0x080, 0x0C2, 0x0D7, 0x076, 0x059, 0x09B, 0x093,
478 0x00C, 0x064, 0x0C3, 0x01D, 0x01B, 0x0F4, 0x045, 0x04B,
479 0x0C7, 0x0C6, 0x03A, 0x037, 0x0E8, 0x081, 0x04B, 0x0C7,
480 0x0C6, 0x03A, 0x037, 0x0E8, 0x091, 0x04B, 0x0C7, 0x0C6,
481 0x032, 0x061, 0x08E, 0x0B3, 0x0BC, 0x0C3, 0x04A, 0x022,
482 0x0E6, 0x0B5, 0x024, 0x097, 0x071, 0x0C9, 0x087, 0x0B4,
483 0x031, 0x0AE, 0x073, 0x0A2, 0x0CF, 0x039, 0x0D2, 0x05D,
484 0x004, 0x044, 0x042, 0x0C0, 0x0D6, 0x0DE, 0x071, 0x006,
485 0x016, 0x0BB, 0x0DB, 0x0CE, 0x083, 0x00C, 0x064, 0x0C3,
486 0x01D, 0x031, 0x013, 0x004, 0x0F9, 0x095, 0x04D, 0x013,
487 0x032, 0x093, 0x063, 0x05E, 0x066, 0x014, 0x0CC, 0x029,
488 0x02A, 0x053, 0x030, 0x0A6, 0x061, 0x04C, 0x0C2, 0x099,
489 0x085, 0x03A, 0x072, 0x0CC, 0x0C2, 0x099, 0x085, 0x006,
490 0x01B, 0x0B3, 0x00A, 0x066, 0x014, 0x014, 0x024, 0x099,
491 0x085, 0x033, 0x00A, 0x008, 0x0B1, 0x086, 0x061, 0x04C,
492 0x0C2, 0x084, 0x021, 0x068, 0x073, 0x03B, 0x030, 0x0A6,
493 0x061, 0x041, 0x04E, 0x0A5, 0x098, 0x053, 0x030, 0x0AC,
494 0x059, 0x076, 0x061, 0x04C, 0x0C2, 0x0B0, 0x08D, 0x0D6,
495 0x061, 0x04C, 0x0C2, 0x0B0, 0x02C, 0x0F6, 0x061, 0x04C,
496 0x0C2, 0x0B1, 0x08C, 0x0A5, 0x098, 0x053, 0x030, 0x0AC,
497 0x00F, 0x024, 0x0CC, 0x029, 0x098, 0x056, 0x00F, 0x028,
498 0x066, 0x015, 0x092, 0x01A, 0x019, 0x085, 0x033, 0x00A,
499 0x0CA, 0x085, 0x00C, 0x0C2, 0x099, 0x085, 0x065, 0x0C3,
500 0x0D9, 0x085, 0x033, 0x00A, 0x0CE, 0x070, 0x086, 0x061,
501 0x04C, 0x0C2, 0x0B3, 0x097, 0x071, 0x00C, 0x099, 0x03B,
502 0x0CC, 0x083, 0x058, 0x00B, 0x0EA, 0x077, 0x09D, 0x006,
503 0x04A, 0x0BE, 0x004, 0x074, 0x060, 0x0E0, 0x0D1, 0x04E,
504 0x038, 0x04C, 0x03E, 0x0EE, 0x03E, 0x0EE, 0x03E, 0x0EE,
505 0x03E, 0x0EE, 0x030, 0x0BB, 0x0CA, 0x0E1, 0x01F, 0x077,
506 0x01F, 0x077, 0x01F, 0x077, 0x01F, 0x077, 0x027, 0x070,
507 0x08F, 0x0BB, 0x080, 0x00E, 0x011, 0x0F7, 0x071, 0x0F7,
508 0x07C, 0x06F, 0x03C, 0x0B3, 0x036, 0x002, 0x0FB, 0x08D,
509 0x0E6, 0x055, 0x070, 0x07F, 0x02D, 0x024, 0x069, 0x055,
510 0x04F, 0x058, 0x0A9, 0x023, 0x01F, 0x054, 0x0F7, 0x08A,
511 0x095, 0x025, 0x02B, 0x075, 0x00C, 0x0CC, 0x0AC, 0x056,
512 0x051, 0x0CC, 0x051, 0x0E4, 0x045, 0x0CE, 0x0A2, 0x012,
513 0x039, 0x0C0, 0x0A0, 0x0AF, 0x056, 0x06A, 0x049, 0x07F,
514 0x002, 0x08C, 0x009, 0x0F8, 0x00B, 0x0EB, 0x0AF, 0x056,
515 0x076, 0x067, 0x052, 0x0B2, 0x08E, 0x069, 0x0A7, 0x011,
516 0x073, 0x0A8, 0x0B1, 0x0BC, 0x0CA, 0x0A0, 0x0A9, 0x036,
517 0x050, 0x02C, 0x098, 0x0E7, 0x00A, 0x0F5, 0x066, 0x0A4,
518 0x097, 0x0E2, 0x05A, 0x030, 0x027, 0x0BA, 0x0F7, 0x083,
519 0x04E, 0x0A5, 0x033, 0x00A, 0x066, 0x015, 0x08D, 0x0E6,
520 0x055, 0x039, 0x0D2, 0x0A7, 0x0AC, 0x054, 0x060, 0x016,
521 0x070, 0x01B, 0x072, 0x08E, 0x062, 0x08F, 0x022, 0x02E,
522 0x075, 0x016, 0x002, 0x0FB, 0x08D, 0x0E6, 0x00A, 0x095,
523 0x03D, 0x062, 0x0A3, 0x000, 0x0B7, 0x001, 0x0B5, 0x053,
524 0x0DE, 0x02A, 0x054, 0x094, 0x0AD, 0x0D4, 0x033, 0x032,
525 0x0B1, 0x059, 0x047, 0x031, 0x047, 0x091, 0x017, 0x03A,
526 0x088, 0x048, 0x0E7, 0x002, 0x0B0, 0x017, 0x0DC, 0x067,
527 0x09D, 0x04B, 0x08D, 0x0E7, 0x052, 0x0AA, 0x07B, 0x0D4,
528 0x0AA, 0x092, 0x0BD, 0x0D6, 0x099, 0x0BC, 0x056, 0x002,
529 0x0FB, 0x08C, 0x0F3, 0x066, 0x066, 0x0C6, 0x0F3, 0x066,
530 0x066, 0x062, 0x099, 0x02A, 0x0F8, 0x018, 0x068, 0x070,
531 0x0B0, 0x08A, 0x00D, 0x055, 0x055, 0x055, 0x055, 0x052,
532 0x032, 0x0E1, 0x040, 0x05C, 0x038, 0x00B, 0x0EA, 0x09B,
533 0x087, 0x001, 0x07D, 0x0C0, 0x05F, 0x070, 0x017, 0x0DC,
534 0x005, 0x0F5, 0x0DC, 0x09B, 0x001, 0x07D, 0x061, 0x04D,
535 0x080, 0x0BE, 0x0A7, 0x079, 0x082, 0x0A2, 0x01F, 0x050,
536 0x015, 0x02A, 0x08F, 0x08B, 0x01C, 0x0E5, 0x0A5, 0x013,
537 0x084, 0x058, 0x0E7, 0x002, 0x091, 0x054, 0x005, 0x002,
538 0x04B, 0x0BD, 0x022, 0x01A, 0x094, 0x07F, 0x09C, 0x01A,
539 0x0C0, 0x05F, 0x042, 0x01A, 0x021, 0x0D1, 0x080, 0x059,
540 0x0C0, 0x06D, 0x01C, 0x02C, 0x00A, 0x083, 0x055, 0x055,
541 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055,
542 0x055, 0x054, 0x01C, 0x0B8, 0x05C, 0x06E, 0x017, 0x09C,
543 0x02F, 0x038, 0x05E, 0x070, 0x0E7, 0x0B8, 0x05E, 0x070,
544 0x0BC, 0x0E1, 0x079, 0x0C2, 0x0F3, 0x085, 0x0E7, 0x00B,
545 0x0CE, 0x017, 0x09C, 0x029, 0x09C, 0x029, 0x09C, 0x029,
546 0x09C, 0x023, 0x00F, 0x058, 0x014, 0x0EE, 0x035, 0x077,
547 0x026, 0x021, 0x093, 0x005, 0x0C9, 0x0B0, 0x017, 0x0D2,
548 0x01D, 0x018, 0x08A, 0x021, 0x093, 0x005, 0x0C9, 0x0B0,
549 0x017, 0x0D1, 0x087, 0x0AC, 0x00A, 0x074, 0x00F, 0x0AE,
550 0x0F5, 0x05A, 0x082, 0x0A3, 0x0E4, 0x03A, 0x031, 0x014,
551 0x0BB, 0x0D7, 0x059, 0x099, 0x074, 0x0A2, 0x019, 0x030,
552 0x05C, 0x09B, 0x001, 0x07D, 0x018, 0x07A, 0x0C0, 0x0A7,
553 0x040, 0x0F8, 0x043, 0x0D4, 0x063, 0x089, 0x025, 0x0D0,
554 0x010, 0x0D6, 0x01C, 0x06A, 0x010, 0x0F5, 0x055, 0x089,
555 0x025, 0x0D1, 0x051, 0x066, 0x01F, 0x051, 0x0F5, 0x091,
556 0x049, 0x02E, 0x089, 0x015, 0x098, 0x06A, 0x0A3, 0x0E0,
557 0x08A, 0x094, 0x065, 0x064, 0x00E, 0x013, 0x017, 0x038,
558 0x0A8, 0x086, 0x04C, 0x017, 0x026, 0x0C0, 0x05F, 0x046,
559 0x01E, 0x0B0, 0x028, 0x063, 0x01F, 0x008, 0x07A, 0x08C,
560 0x071, 0x024, 0x0BA, 0x002, 0x01A, 0x0D0, 0x00D, 0x042,
561 0x01E, 0x0AA, 0x0B1, 0x024, 0x0BA, 0x02A, 0x02D, 0x031,
562 0x0F5, 0x01F, 0x058, 0x074, 0x092, 0x0E8, 0x087, 0x05A,
563 0x063, 0x052, 0x0DE, 0x0F4, 0x051, 0x069, 0x04A, 0x03E,
564 0x009, 0x069, 0x046, 0x050, 0x0F0, 0x0E1, 0x031, 0x073,
565 0x005, 0x045, 0x0BD, 0x059, 0x08D, 0x08B, 0x04A, 0x07C,
566 0x0D3, 0x0ED, 0x038, 0x0E9, 0x0D3, 0x04E, 0x074, 0x0ED,
567 0x044, 0x032, 0x060, 0x0B9, 0x036, 0x002, 0x0FA, 0x05B,
568 0x0DE, 0x08A, 0x02D, 0x029, 0x0D0, 0x0E1, 0x021, 0x0F5,
569 0x0A3, 0x092, 0x021, 0x0F2, 0x019, 0x030, 0x05C, 0x09B,
570 0x001, 0x07D, 0x021, 0x0F5, 0x0A0, 0x0C6, 0x001, 0x067,
571 0x001, 0x0B4, 0x045, 0x0CE, 0x0A5, 0x012, 0x039, 0x0D4,
572 0x01C, 0x005, 0x0F4, 0x040, 0x0A1, 0x0C2, 0x0C3, 0x050,
573 0x06A, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA,
574 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x0AA, 0x081, 0x0AF,
575 0x086, 0x09F, 0x019, 0x01B, 0x0E7, 0x081, 0x0F3, 0x065,
576 0x0F2, 0x080, 0x0BE, 0x070, 0x017, 0x0DF, 0x0DF, 0x038,
577 0x00B, 0x0EB, 0x00D, 0x0C3, 0x080, 0x0BE, 0x0A7, 0x00F,
578 0x095, 0x04F, 0x05A, 0x094, 0x0C0, 0x02C, 0x0D8, 0x0B1,
579 0x0A7, 0x0CE, 0x05A, 0x011, 0x073, 0x0A8, 0x03A, 0x0C2,
580 0x0CC, 0x0B6, 0x030, 0x017, 0x0DC, 0x06F, 0x035, 0x0A9,
581 0x080, 0x04D, 0x0A7, 0x0CE, 0x02A, 0x018, 0x079, 0x0C5,
582 0x049, 0x0DE, 0x061, 0x0A8, 0x022, 0x0E7, 0x050, 0x033,
583 0x0F9, 0x098, 0x064, 0x008, 0x0B9, 0x095, 0x042, 0x0FC,
584 0x0CC, 0x0D9, 0x095, 0x03D, 0x062, 0x0A2, 0x048, 0x0D4,
585 0x048, 0x0E7, 0x002, 0x088, 0x0B9, 0x0C1, 0x0A0, 0x0E3,
586 0x09D, 0x04E, 0x062, 0x0E6, 0x0CC, 0x0C6, 0x06B, 0x0CE,
587 0x083, 0x010, 0x0C9, 0x082, 0x0E4, 0x0DA, 0x0C2, 0x0C8,
588 0x01E, 0x0C3, 0x0B9, 0x036, 0x002, 0x0FA, 0x0A9, 0x0EB,
589 0x04E, 0x030, 0x030, 0x0FA, 0x00D, 0x0F0, 0x0A9, 0x0EB,
590 0x040, 0x0B9, 0x00F, 0x0AA, 0x07A, 0x0D2, 0x0C2, 0x0C8,
591 0x0FA, 0x0A7, 0x0AD, 0x041, 0x00A, 0x047, 0x0D5, 0x03D,
592 0x068, 0x0AC, 0x0F1, 0x0F5, 0x04F, 0x05A, 0x097, 0x054,
593 0x07D, 0x04F, 0x0A8, 0x0AA, 0x055, 0x01F, 0x011, 0x073,
594 0x05A, 0x0B0, 0x017, 0x0DE, 0x05D, 0x059, 0x0A9, 0x025,
595 0x0D0, 0x055, 0x02A, 0x046, 0x0BC, 0x0B8, 0x022, 0x0AE,
596 0x045, 0x029, 0x03E, 0x014, 0x0FA, 0x0E1, 0x099, 0x094,
597 0x0CA, 0x04A, 0x0BE, 0x03D, 0x0D6, 0x099, 0x092, 0x05D,
598 0x015, 0x017, 0x0C8, 0x0D7, 0x0DC, 0x015, 0x017, 0x08A,
599 0x040, 0x01F, 0x00A, 0x09E, 0x0AC, 0x0C9, 0x065, 0x049,
600 0x05C, 0x01D, 0x010, 0x068, 0x04A, 0x03E, 0x05B, 0x0DE,
601 0x083, 0x016, 0x095, 0x080, 0x0BE, 0x091, 0x074, 0x058,
602 0x0A4, 0x000, 0x07C, 0x038, 0x0E7, 0x056, 0x030, 0x017,
603 0x0DF, 0x075, 0x0A6, 0x064, 0x097, 0x045, 0x020, 0x09D,
604 0x003, 0x05F, 0x070, 0x054, 0x05E, 0x029, 0x01D, 0x0F0,
605 0x0A9, 0x0EA, 0x0CC, 0x086, 0x054, 0x095, 0x0C1, 0x0D1,
606 0x006, 0x083, 0x00F, 0x0AA, 0x07B, 0x0D0, 0x065, 0x049,
607 0x045, 0x0BD, 0x0E9, 0x062, 0x0D2, 0x091, 0x0DF, 0x004,
608 0x05D, 0x016, 0x029, 0x01C, 0x07D, 0x04F, 0x0AC, 0x01A,
609 0x047, 0x01A, 0x0A9, 0x0F5, 0x067, 0x066, 0x053, 0x028,
610 0x0B7, 0x0BD, 0x02C, 0x05A, 0x052, 0x03B, 0x0E3, 0x0DD,
611 0x059, 0x0A9, 0x025, 0x0D1, 0x0A8, 0x0AC, 0x008, 0x06B,
612 0x0EE, 0x008, 0x0AB, 0x0C5, 0x020, 0x02F, 0x085, 0x04F,
613 0x056, 0x066, 0x075, 0x049, 0x05C, 0x01C, 0x018, 0x01D,
614 0x081, 0x0C2, 0x064, 0x005, 0x0F0, 0x080, 0x0BE, 0x035,
615 0x05C, 0x0D0, 0x017, 0x0C2, 0x055, 0x0F0, 0x095, 0x07C,
616 0x025, 0x05F, 0x008, 0x00B, 0x0E1, 0x001, 0x07C, 0x07B,
617 0x0AB, 0x035, 0x024, 0x0BA, 0x010, 0x055, 0x093, 0x01A,
618 0x0FB, 0x082, 0x02A, 0x0F1, 0x048, 0x0D7, 0x0C2, 0x0A7,
619 0x0AB, 0x031, 0x0B2, 0x0A4, 0x0AC, 0x063, 0x09D, 0x04A,
620 0x08D, 0x07C, 0x07B, 0x0AB, 0x035, 0x024, 0x0BA, 0x010,
621 0x054, 0x030, 0x08D, 0x07D, 0x0C1, 0x015, 0x078, 0x0AC,
622 0x06F, 0x05A, 0x094, 0x060, 0x01A, 0x0E3, 0x079, 0x0D4,
623 0x0AA, 0x04F, 0x085, 0x04F, 0x056, 0x066, 0x0D5, 0x049,
624 0x058, 0x0C7, 0x03A, 0x095, 0x049, 0x0F0, 0x045, 0x0D1,
625 0x062, 0x094, 0x086, 0x0BC, 0x01D, 0x013, 0x0D2, 0x090,
626 0x0FF, 0x0CF, 0x07A, 0x083, 0x0F2, 0x050, 0x031, 0x0DE,
627 0x000, 0x060, 0x060, 0x0A1, 0x017, 0x035, 0x0A8, 0x05F,
628 0x09B, 0x01B, 0x037, 0x007, 0x044, 0x01A, 0x030, 0x00B,
629 0x038, 0x00D, 0x0BC, 0x01C, 0x0E0, 0x0D0, 0x047, 0x0CE,
630 0x0A0, 0x0AA, 0x07A, 0x0A1, 0x098, 0x06A, 0x092, 0x095,
631 0x03D, 0x068, 0x031, 0x080, 0x05B, 0x080, 0x0DA, 0x0A9,
632 0x0EF, 0x041, 0x095, 0x025, 0x016, 0x0F7, 0x0A5, 0x08B,
633 0x04A, 0x0C6, 0x079, 0x0B3, 0x033, 0x060, 0x02F, 0x0AA,
634 0x09E, 0x0B1, 0x051, 0x080, 0x059, 0x09E, 0x0CA, 0x0A7,
635 0x0AC, 0x00A, 0x030, 0x00B, 0x067, 0x0B2, 0x0AD, 0x0D5,
636 0x0DA, 0x092, 0x05D, 0x017, 0x0A3, 0x000, 0x0B3, 0x02D,
637 0x095, 0x06E, 0x008, 0x0A9, 0x058, 0x0A1, 0x017, 0x03A,
638 0x08B, 0x001, 0x07D, 0x054, 0x0F7, 0x08E, 0x095, 0x025,
639 0x008, 0x01C, 0x0E0, 0x056, 0x002, 0x0FB, 0x0C1, 0x0D1,
640 0x015, 0x018, 0x005, 0x092, 0x06B, 0x03C, 0x01D, 0x012,
641 0x028, 0x0C0, 0x02C, 0x0A5, 0x06C, 0x011, 0x070, 0x017,
642 0x0B2, 0x038, 0x04D, 0x080, 0x0BE, 0x0E0, 0x02F, 0x0B4,
643 0x0EC, 0x04A, 0x0ED, 0x0B3, 0x09E, 0x002, 0x0FB, 0x080,
644 0x0BE, 0x0E0, 0x02F, 0x0B1, 0x039, 0x093, 0x03E, 0x06D,
645 0x0E7, 0x010, 0x060, 0x09F, 0x032, 0x0A9, 0x0A2, 0x06C,
646 0x005, 0x0F4, 0x040, 0x0E6, 0x00A, 0x095, 0x03D, 0x06A,
647 0x023, 0x000, 0x0B3, 0x080, 0x0DA, 0x0A7, 0x0D6, 0x02A,
648 0x003, 0x00D, 0x070, 0x017, 0x0D2, 0x02E, 0x076, 0x029,
649 0x04F, 0x0BC, 0x054, 0x0A6, 0x051, 0x06F, 0x07A, 0x058,
650 0x0B4, 0x0AC, 0x005, 0x0F4, 0x08B, 0x0A2, 0x0F4, 0x00E,
651 0x035, 0x00D, 0x049, 0x02E, 0x0B4, 0x0CC, 0x018, 0x0A5,
652 0x0C8, 0x0F8, 0x04A, 0x097, 0x023, 0x0E1, 0x005, 0x02E,
653 0x047, 0x0C2, 0x08A, 0x05C, 0x08F, 0x085, 0x069, 0x072,
654 0x03E, 0x01F, 0x04A, 0x0C3, 0x055, 0x01F, 0x056, 0x043,
655 0x032, 0x08C, 0x0A3, 0x05E, 0x060, 0x0A8, 0x045, 0x0CE,
656 0x00D, 0x060, 0x02F, 0x0A3, 0x084, 0x09D, 0x0D8, 0x0F0,
657 0x017, 0x0D2, 0x02E, 0x00E, 0x01B, 0x023, 0x084, 0x0D8,
658 0x00B, 0x0EB, 0x089, 0x0F3, 0x080, 0x0BE, 0x0E0, 0x02F,
659 0x0BB, 0x039, 0x085, 0x0DF, 0x022, 0x003, 0x0E7, 0x001,
660 0x07D, 0x0C0, 0x05F, 0x070, 0x017, 0x0D1, 0x017, 0x038,
661 0x014, 0x05B, 0x0D6, 0x0A2, 0x074, 0x00D, 0x04B, 0x07A,
662 0x0B3, 0x031, 0x096, 0x094, 0x06B, 0x0CC, 0x035, 0x023,
663 0x0D7, 0x049, 0x048, 0x015, 0x073, 0x029, 0x00F, 0x05D,
664 0x08A, 0x0C0, 0x05F, 0x04D, 0x079, 0x084, 0x035, 0x080,
665 0x0BE, 0x088, 0x01C, 0x0C3, 0x052, 0x09F, 0x059, 0x068,
666 0x0C0, 0x02C, 0x0E0, 0x036, 0x0AA, 0x07B, 0x0CD, 0x04A,
667 0x092, 0x0BE, 0x0F3, 0x081, 0x04A, 0x07D, 0x05B, 0x059,
668 0x094, 0x0CA, 0x01C, 0x024, 0x0EE, 0x0C7, 0x080, 0x0BE,
669 0x088, 0x01C, 0x0C3, 0x052, 0x09F, 0x059, 0x068, 0x0C0,
670 0x02C, 0x0E0, 0x036, 0x0AA, 0x07B, 0x0CD, 0x04A, 0x092,
671 0x0BE, 0x0F3, 0x081, 0x043, 0x084, 0x09C, 0x07B, 0x038,
672 0x00B, 0x0EB, 0x0AF, 0x070, 0x0D4, 0x0EA, 0x053, 0x000,
673 0x09B, 0x04F, 0x09C, 0x054, 0x030, 0x0F3, 0x08A, 0x094,
674 0x0FA, 0x0B6, 0x0B3, 0x029, 0x094, 0x022, 0x0E6, 0x01A,
675 0x085, 0x0F9, 0x0B0, 0x059, 0x093, 0x0F9, 0x0D2, 0x0C4,
676 0x032, 0x060, 0x0B9, 0x036, 0x0B0, 0x0B3, 0x090, 0x0D9,
677 0x077, 0x026, 0x01C, 0x027, 0x022, 0x0E8, 0x096, 0x0B4,
678 0x023, 0x0EA, 0x09E, 0x0B5, 0x011, 0x080, 0x059, 0x065,
679 0x086, 0x020, 0x073, 0x096, 0x08D, 0x079, 0x0AD, 0x058,
680 0x00B, 0x0E9, 0x017, 0x044, 0x08A, 0x04A, 0x007, 0x0D7,
681 0x07A, 0x082, 0x0A1, 0x090, 0x0FA, 0x0EF, 0x001, 0x054,
682 0x0BA, 0x050, 0x0D4, 0x059, 0x01E, 0x02C, 0x0E9, 0x0F3,
683 0x08A, 0x099, 0x085, 0x06B, 0x00B, 0x023, 0x015, 0x097,
684 0x072, 0x061, 0x017, 0x030, 0x0D4, 0x02C, 0x073, 0x087,
685 0x048, 0x0AA, 0x002, 0x081, 0x025, 0x0DE, 0x091, 0x00D,
686 0x04A, 0x0C0, 0x05F, 0x07E, 0x0D2, 0x080, 0x0A5, 0x03E,
687 0x0B2, 0x0D0, 0x0C8, 0x06B, 0x080, 0x0BE, 0x088, 0x01C,
688 0x0EA, 0x009, 0x017, 0x044, 0x01A, 0x037, 0x01A, 0x091,
689 0x074, 0x058, 0x0A3, 0x071, 0x0AF, 0x007, 0x044, 0x054,
690 0x06E, 0x035, 0x0E0, 0x0E8, 0x0AA, 0x064, 0x00F, 0x090,
691 0x0FA, 0x0D0, 0x063, 0x000, 0x0B3, 0x080, 0x0DA, 0x02C,
692 0x073, 0x087, 0x048, 0x0AA, 0x002, 0x081, 0x025, 0x0DE,
693 0x091, 0x00D, 0x04A, 0x0C0, 0x05F, 0x048, 0x0BA, 0x027,
694 0x0A3, 0x000, 0x0B7, 0x001, 0x0B7, 0x04F, 0x09C, 0x0B4,
695 0x06B, 0x0CC, 0x035, 0x016, 0x0F5, 0x066, 0x063, 0x02D,
696 0x029, 0x01E, 0x0BA, 0x04A, 0x040, 0x0AB, 0x099, 0x048,
697 0x07A, 0x0EC, 0x050, 0x08B, 0x09C, 0x008, 0x022, 0x0FC,
698 0x0F9, 0x0B2, 0x055, 0x03D, 0x062, 0x0A9, 0x023, 0x051,
699 0x023, 0x09C, 0x00A, 0x03C, 0x073, 0x00D, 0x044, 0x05C,
700 0x0E1, 0x050, 0x071, 0x0CE, 0x0A1, 0x01F, 0x0E7, 0x015,
701 0x06B, 0x00B, 0x025, 0x0ED, 0x00B, 0x093, 0x060, 0x02F,
702 0x0AA, 0x09E, 0x0AC, 0x036, 0x065, 0x049, 0x05F, 0x07A,
703 0x020, 0x050, 0x008, 0x07F, 0x0EF, 0x039, 0x014, 0x049,
704 0x001, 0x011, 0x081, 0x004, 0x060, 0x040, 0x0CC, 0x059,
705 0x0C0, 0x0AD, 0x023, 0x0EB, 0x041, 0x0B0, 0x081, 0x0F2,
706 0x03A, 0x041, 0x0AA, 0x050, 0x043, 0x0E4, 0x0D4, 0x086,
707 0x054, 0x0A0, 0x087, 0x0C1, 0x052, 0x0CA, 0x093, 0x001,
708 0x032, 0x054, 0x09D, 0x024, 0x002, 0x000, 0x000, 0x052,
709 0x0AF, 0x016, 0x046, 0x0A7, 0x091, 0x067, 0x008, 0x0B4,
710 0x004, 0x051, 0x0F1, 0x065, 0x019, 0x0B4, 0x06E, 0x02D,
711 0x0C0, 0x0AD, 0x049, 0x000, 0x092, 0x057, 0x01B, 0x074,
712 0x045, 0x05F, 0x023, 0x051, 0x0B7, 0x044, 0x00A, 0x010,
713 0x006, 0x0A3, 0x06E, 0x08B, 0x06B, 0x008, 0x01F, 0x019,
714 0x0D1, 0x0E6, 0x080, 0x082, 0x080, 0x054, 0x004, 0x02A,
715 0x045, 0x091, 0x0A9, 0x0E4, 0x059, 0x0C2, 0x02D, 0x001,
716 0x014, 0x004, 0x050, 0x0D3, 0x0FC, 0x055, 0x084, 0x061,
717 0x0D9, 0x080, 0x051, 0x02F, 0x0E2, 0x01F, 0x046, 0x05F,
718 0x040, 0x0E0, 0x020, 0x015, 0x04A, 0x0BC, 0x059, 0x01A,
719 0x09E, 0x045, 0x09C, 0x022, 0x0D0, 0x011, 0x048, 0x0CB,
720 0x0E8, 0x014, 0x008, 0x001, 0x054, 0x015, 0x0E2, 0x0C8,
721 0x0D4, 0x0F2, 0x02C, 0x0E1, 0x016, 0x080, 0x08A, 0x046,
722 0x05F, 0x052, 0x07C, 0x0D9, 0x0A8, 0x0F8, 0x088, 0x0D0,
723 0x05A, 0x03C, 0x0D2, 0x05C, 0x05B, 0x080, 0x0DA, 0x0A7,
724 0x0D6, 0x05A, 0x008, 0x086, 0x0A4, 0x05D, 0x017, 0x0A0,
725 0x0C3, 0x052, 0x02E, 0x088, 0x0A8, 0x022, 0x01F, 0x053,
726 0x0EA, 0x0DA, 0x0CC, 0x0A6, 0x050, 0x0E1, 0x027, 0x076,
727 0x03C, 0x005, 0x0F5, 0x04F, 0x0AB, 0x06B, 0x032, 0x099,
728 0x043, 0x084, 0x09C, 0x07B, 0x038, 0x00B, 0x0E9, 0x027,
729 0x0AC, 0x0D4, 0x092, 0x0E0, 0x00E, 0x0DA, 0x038, 0x04D,
730 0x080, 0x0BE, 0x0E6, 0x07D, 0x050, 0x0BA, 0x051, 0x0AE,
731 0x066, 0x0EF, 0x0BC, 0x0DC, 0x07B, 0x087, 0x01E, 0x002,
732 0x0FA, 0x093, 0x0E6, 0x0CD, 0x047, 0x0C4, 0x043, 0x0CD,
733 0x00F, 0x034, 0x09D, 0x0A3, 0x000, 0x0B0, 0x055, 0x001,
734 0x0AE, 0x003, 0x084, 0x004, 0x0CE, 0x001, 0x0D0, 0x0E1,
735 0x070, 0x002, 0x080, 0x00E, 0x089, 0x0E9, 0x022, 0x01F,
736 0x0E0, 0x0E8, 0x096, 0x0B0, 0x011, 0x0F4, 0x0C2, 0x0CE,
737 0x003, 0x06A, 0x044, 0x02D, 0x0C0, 0x06D, 0x048, 0x005,
738 0x0B8, 0x00D, 0x0A3, 0x000, 0x0B7, 0x076, 0x0D5, 0x0DE,
739 0x0B1, 0x050, 0x0DC, 0x07D, 0x077, 0x0BC, 0x054, 0x0BA,
740 0x052, 0x07F, 0x058, 0x014, 0x034, 0x00F, 0x09A, 0x0F3,
741 0x081, 0x058, 0x00B, 0x0EA, 0x0EF, 0x058, 0x014, 0x060,
742 0x016, 0x0A5, 0x06C, 0x02E, 0x0F7, 0x081, 0x04B, 0x0A5,
743 0x06F, 0x07D, 0x05D, 0x0EE, 0x0B5, 0x02E, 0x095, 0x080,
744 0x0BE, 0x0F0, 0x073, 0x0BD, 0x004, 0x07C, 0x0EA, 0x0FE,
745 0x0EB, 0x04C, 0x0DE, 0x029, 0x053, 0x0DD, 0x06A, 0x054,
746 0x094, 0x0A9, 0x0EA, 0x00A, 0x08C, 0x002, 0x0D6, 0x04C,
747 0x03C, 0x005, 0x0F4, 0x000, 0x0EA, 0x0CD, 0x056, 0x0AF,
748 0x0C0, 0x047, 0x0D2, 0x09C, 0x08D, 0x029, 0x0CA, 0x0E0,
749 0x02F, 0x0AE, 0x0BD, 0x075, 0x099, 0x09D, 0x04A, 0x0F9,
750 0x0EF, 0x051, 0x07C, 0x094, 0x00C, 0x077, 0x080, 0x018,
751 0x018, 0x029, 0x02A, 0x0F8, 0x0E0, 0x0E8, 0x0AA, 0x030,
752 0x00B, 0x02A, 0x098, 0x07C, 0x01D, 0x011, 0x051, 0x080,
753 0x059, 0x054, 0x0C3, 0x051, 0x0F5, 0x01B, 0x033, 0x024,
754 0x0BB, 0x082, 0x0A5, 0x019, 0x05C, 0x01D, 0x010, 0x028,
755 0x0C0, 0x02C, 0x09A, 0x0C7, 0x0C1, 0x0D1, 0x022, 0x08C,
756 0x002, 0x0C9, 0x094, 0x064, 0x05C, 0x00C, 0x0D6, 0x08E,
757 0x013, 0x060, 0x02F, 0x0B8, 0x00B, 0x0EA, 0x030, 0x0E3,
758 0x0C0, 0x05F, 0x048, 0x0DC, 0x078, 0x00B, 0x0E8, 0x000,
759 0x0E3, 0x0C0, 0x05F, 0x06C, 0x038, 0x0D5, 0x02E, 0x035,
760 0x04F, 0x05A, 0x08A, 0x061, 0x0AA, 0x09F, 0x056, 0x01B,
761 0x032, 0x099, 0x046, 0x042, 0x0C8, 0x001, 0x00C, 0x045,
762 0x0CE, 0x0A5, 0x017, 0x0E6, 0x0C6, 0x0CE, 0x0A9, 0x0EB,
763 0x015, 0x016, 0x046, 0x0A2, 0x047, 0x038, 0x014, 0x043,
764 0x026, 0x022, 0x0E7, 0x03D, 0x060, 0x02F, 0x0AA, 0x09E,
765 0x0B5, 0x012, 0x0E0, 0x07F, 0x001, 0x07D, 0x0E3, 0x0E7,
766 0x002, 0x093, 0x0F9, 0x095, 0x044, 0x05C, 0x0E5, 0x0A0,
767 0x0E3, 0x09D, 0x04A, 0x07F, 0x09C, 0x054, 0x0A9, 0x0EB,
768 0x051, 0x005, 0x046, 0x0B9, 0x0FC, 0x0C0, 0x01B, 0x022,
769 0x02E, 0x064, 0x054, 0x02F, 0x0CD, 0x046, 0x0CC, 0x0A7,
770 0x0D5, 0x086, 0x0CC, 0x0A6, 0x050, 0x055, 0x0C6, 0x045,
771 0x0CE, 0x05A, 0x00E, 0x039, 0x0D4, 0x0A7, 0x0F9, 0x0C5,
772 0x04A, 0x09E, 0x0B5, 0x011, 0x080, 0x059, 0x0C0, 0x06D,
773 0x0CF, 0x0E6, 0x000, 0x0D9, 0x011, 0x073, 0x022, 0x0A1,
774 0x07E, 0x06A, 0x036, 0x065, 0x03E, 0x0AC, 0x036, 0x065,
775 0x032, 0x0B0, 0x017, 0x0DD, 0x03E, 0x072, 0x0D2, 0x079,
776 0x031, 0x00C, 0x098, 0x02E, 0x04C, 0x020, 0x073, 0x02A,
777 0x08F, 0x0F3, 0x08A, 0x0AD, 0x0E7, 0x041, 0x082, 0x07C,
778 0x0CA, 0x0A6, 0x089, 0x0B5, 0x085, 0x09F, 0x0B0, 0x0F0,
779 0x017, 0x0D5, 0x01F, 0x054, 0x054, 0x025, 0x01A, 0x0A8,
780 0x0FF, 0x02A, 0x094, 0x065, 0x011, 0x0D7, 0x049, 0x044,
781 0x0D5, 0x0CC, 0x0A0, 0x055, 0x0D8, 0x0AE, 0x00E, 0x088,
782 0x014, 0x060, 0x016, 0x04D, 0x063, 0x022, 0x0E0, 0x072,
783 0x086, 0x038, 0x04D, 0x080, 0x0BE, 0x0E0, 0x02F, 0x0B8,
784 0x00B, 0x0EE, 0x002, 0x0FB, 0x081, 0x038, 0x0F0, 0x017,
785 0x0D7, 0x0D7, 0x01E, 0x002, 0x0FA, 0x0FA, 0x0E3, 0x0C0,
786 0x05F, 0x04C, 0x085, 0x090, 0x002, 0x018, 0x0C8, 0x05B,
787 0x080, 0x0DA, 0x030, 0x00B, 0x070, 0x01B, 0x04C, 0x022,
788 0x0D3, 0x04C, 0x033, 0x003, 0x08C, 0x02E, 0x04C, 0x043,
789 0x026, 0x0D0, 0x0F5, 0x063, 0x066, 0x0D0, 0x095, 0x0A7,
790 0x0CE, 0x045, 0x033, 0x00A, 0x0D6, 0x016, 0x042, 0x038,
791 0x06E, 0x0E4, 0x0CE, 0x0BD, 0x059, 0x02C, 0x0D2, 0x0AB,
792 0x0BA, 0x094, 0x09D, 0x0E6, 0x01A, 0x0B0, 0x017, 0x0D5,
793 0x04F, 0x05A, 0x08B, 0x009, 0x01A, 0x088, 0x0B9, 0x0C5,
794 0x042, 0x047, 0x030, 0x0D4, 0x032, 0x016, 0x072, 0x088,
795 0x065, 0x0BD, 0x059, 0x099, 0x025, 0x0A5, 0x060, 0x02F,
796 0x0B8, 0x060, 0x0F3, 0x008, 0x0B7, 0x04A, 0x01A, 0x08F,
797 0x0AB, 0x00D, 0x099, 0x046, 0x051, 0x0AF, 0x038, 0x0A8,
798 0x08E, 0x090, 0x065, 0x013, 0x052, 0x018, 0x0A0, 0x054,
799 0x0B1, 0x042, 0x02E, 0x061, 0x0A8, 0x048, 0x0E7, 0x02D,
800 0x016, 0x0F7, 0x0A8, 0x005, 0x0A5, 0x060, 0x02F, 0x0A4,
801 0x075, 0x0D2, 0x051, 0x035, 0x073, 0x028, 0x015, 0x076,
802 0x02B, 0x083, 0x0A2, 0x005, 0x018, 0x005, 0x093, 0x058,
803 0x0C8, 0x0B8, 0x006, 0x028, 0x063, 0x084, 0x0D8, 0x00B,
804 0x0EE, 0x002, 0x0FB, 0x080, 0x0BE, 0x0E0, 0x02F, 0x0A0,
805 0x043, 0x0A7, 0x001, 0x07D, 0x04C, 0x0E3, 0x0C0, 0x05F,
806 0x070, 0x017, 0x0DC, 0x005, 0x0F4, 0x064, 0x02D, 0x0C0,
807 0x06D, 0x018, 0x005, 0x0B8, 0x00D, 0x0A5, 0x0BD, 0x06A,
808 0x023, 0x086, 0x0AA, 0x09E, 0x0B5, 0x011, 0x0A4, 0x06A,
809 0x0A3, 0x0EA, 0x08A, 0x08D, 0x023, 0x0E1, 0x017, 0x038,
810 0x034, 0x069, 0x071, 0x098, 0x045, 0x0A6, 0x098, 0x06A,
811 0x03E, 0x0AC, 0x036, 0x065, 0x019, 0x046, 0x0BC, 0x0E2,
812 0x0A2, 0x03A, 0x041, 0x094, 0x04D, 0x048, 0x062, 0x081,
813 0x052, 0x0C5, 0x016, 0x0F7, 0x0A8, 0x08B, 0x04A, 0x054,
814 0x0F5, 0x0A8, 0x08C, 0x002, 0x0DC, 0x006, 0x0D1, 0x003,
815 0x09C, 0x0B4, 0x0A9, 0x0EE, 0x00A, 0x095, 0x025, 0x02A,
816 0x07A, 0x0AD, 0x046, 0x001, 0x067, 0x001, 0x0B5, 0x0D7,
817 0x0AC, 0x00A, 0x030, 0x00B, 0x06C, 0x049, 0x035, 0x0E6,
818 0x0B5, 0x067, 0x0F3, 0x000, 0x06C, 0x088, 0x0B9, 0x091,
819 0x050, 0x0BF, 0x031, 0x01B, 0x032, 0x0A7, 0x0B8, 0x068,
820 0x095, 0x025, 0x07B, 0x0AD, 0x033, 0x078, 0x0A7, 0x0CD,
821 0x03E, 0x0D3, 0x08E, 0x09D, 0x034, 0x0E7, 0x04E, 0x0D4,
822 0x022, 0x0E7, 0x006, 0x084, 0x08E, 0x060, 0x0A8, 0x0FF,
823 0x038, 0x0AB, 0x083, 0x09C, 0x02A, 0x008, 0x0F9, 0x0D4,
824 0x020, 0x063, 0x0BC, 0x01A, 0x006, 0x00A, 0x0C0, 0x05F,
825 0x046, 0x042, 0x0DC, 0x006, 0x0D1, 0x080, 0x05B, 0x080,
826 0x0DA, 0x022, 0x0E6, 0x01A, 0x084, 0x08E, 0x072, 0x0D1,
827 0x06F, 0x05A, 0x080, 0x087, 0x01A, 0x0AA, 0x07A, 0x0D4,
828 0x048, 0x0C8, 0x0D5, 0x047, 0x0D5, 0x015, 0x023, 0x023,
829 0x0E1, 0x017, 0x038, 0x034, 0x08C, 0x0BA, 0x04B, 0x07B,
830 0x0D4, 0x002, 0x0D2, 0x08C, 0x022, 0x0DC, 0x006, 0x0D5,
831 0x01F, 0x056, 0x01B, 0x032, 0x08C, 0x0A3, 0x05E, 0x071,
832 0x051, 0x01D, 0x020, 0x0CA, 0x026, 0x0A4, 0x031, 0x040,
833 0x0A9, 0x062, 0x0B0, 0x017, 0x0DF, 0x09E, 0x0F4, 0x0B7,
834 0x0C9, 0x040, 0x0C7, 0x078, 0x001, 0x081, 0x082, 0x0B8,
835 0x038, 0x039, 0x049, 0x01C, 0x026, 0x0C0, 0x05F, 0x070,
836 0x017, 0x0D4, 0x0AB, 0x0E1, 0x02A, 0x0F8, 0x04A, 0x0BE,
837 0x012, 0x0AF, 0x08F, 0x097, 0x04F, 0x0CB, 0x0A7, 0x001,
838 0x07D, 0x0DA, 0x080, 0x0AA, 0x091, 0x064, 0x07F, 0x04A,
839 0x081, 0x0D5, 0x022, 0x0C8, 0x0FE, 0x082, 0x080, 0x025,
840 0x048, 0x0B2, 0x03E, 0x0BB, 0x0DC, 0x035, 0x02E, 0x094,
841 0x007, 0x0E8, 0x08A, 0x09C, 0x003, 0x0E2, 0x04B, 0x0A5,
842 0x077, 0x0AB, 0x0B3, 0x032, 0x0E9, 0x04B, 0x0BD, 0x059,
843 0x086, 0x084, 0x097, 0x07A, 0x004, 0x0BA, 0x053, 0x0E1,
844 0x032, 0x0EF, 0x050, 0x0D4, 0x0E6, 0x035, 0x053, 0x0EB,
845 0x002, 0x09C, 0x0C7, 0x0D7, 0x07A, 0x0B3, 0x030, 0x0D2,
846 0x05D, 0x0EA, 0x002, 0x0E9, 0x044, 0x05D, 0x016, 0x028,
847 0x0C0, 0x02C, 0x0E0, 0x036, 0x091, 0x074, 0x045, 0x059,
848 0x018, 0x0D5, 0x04F, 0x0AC, 0x00A, 0x0C4, 0x035, 0x030,
849 0x08B, 0x038, 0x069, 0x02B, 0x0BD, 0x059, 0x098, 0x069,
850 0x02E, 0x0F5, 0x012, 0x0E9, 0x058, 0x067, 0x04A, 0x0EF,
851 0x050, 0x0D5, 0x08E, 0x03E, 0x01C, 0x0A4, 0x0B0, 0x0CE,
852 0x093, 0x021, 0x06E, 0x01A, 0x048, 0x01F, 0x0A2, 0x02A,
853 0x0C3, 0x00D, 0x057, 0x07A, 0x0B3, 0x00D, 0x009, 0x02E,
854 0x0F4, 0x043, 0x05D, 0x028, 0x08B, 0x083, 0x020, 0x092,
855 0x038, 0x04D, 0x080, 0x0BE, 0x0E0, 0x02F, 0x0AC, 0x017,
856 0x049, 0x0B3, 0x0A5, 0x082, 0x0E9, 0x03E, 0x0E9, 0x036,
857 0x074, 0x0E0, 0x02F, 0x0A6, 0x0CE, 0x09C, 0x005, 0x0F4,
858 0x0C2, 0x02C, 0x08C, 0x052, 0x057, 0x07A, 0x0D4, 0x08D,
859 0x048, 0x0FA, 0x0EF, 0x050, 0x0D5, 0x0AE, 0x035, 0x053,
860 0x0EB, 0x002, 0x086, 0x021, 0x0AA, 0x0EF, 0x056, 0x066,
861 0x01A, 0x04B, 0x0BD, 0x044, 0x0BA, 0x050, 0x0C4, 0x0E9,
862 0x053, 0x0EB, 0x002, 0x086, 0x081, 0x0F5, 0x0DE, 0x0A1,
863 0x0A8, 0x062, 0x01F, 0x05D, 0x0FE, 0x0A2, 0x05D, 0x029,
864 0x077, 0x0A8, 0x06A, 0x061, 0x08D, 0x040, 0x0FD, 0x011,
865 0x053, 0x00C, 0x06A, 0x0A7, 0x0D6, 0x005, 0x030, 0x0C7,
866 0x0D7, 0x07F, 0x0A9, 0x057, 0x04A, 0x05D, 0x0EB, 0x048,
867 0x01B, 0x00C, 0x07C, 0x08B, 0x09D, 0x08A, 0x053, 0x0EF,
868 0x066, 0x094, 0x0CA, 0x054, 0x0F5, 0x0A0, 0x0C6, 0x001,
869 0x06E, 0x003, 0x06A, 0x09F, 0x056, 0x076, 0x065, 0x032,
870 0x08B, 0x07B, 0x0D2, 0x0C5, 0x0A5, 0x060, 0x02F, 0x0AA,
871 0x07D, 0x065, 0x0A3, 0x000, 0x0B7, 0x001, 0x0B4, 0x0C8,
872 0x05A, 0x007, 0x08F, 0x0ED, 0x001, 0x0D5, 0x027, 0x091,
873 0x067, 0x001, 0x0B4, 0x08B, 0x09C, 0x054, 0x01C, 0x073,
874 0x0A8, 0x084, 0x05C, 0x0C1, 0x050, 0x0BF, 0x036, 0x056,
875 0x060, 0x0AB, 0x08C, 0x08B, 0x09C, 0x054, 0x01C, 0x073,
876 0x0A8, 0x084, 0x05C, 0x0C1, 0x050, 0x0BF, 0x036, 0x056,
877 0x06C, 0x005, 0x0F5, 0x053, 0x0D6, 0x0A2, 0x030, 0x00B,
878 0x029, 0x05B, 0x019, 0x0FC, 0x0F6, 0x094, 0x045, 0x0CF,
879 0x015, 0x00B, 0x0F3, 0x03C, 0x0B3, 0x02A, 0x07A, 0x0C5,
880 0x046, 0x001, 0x064, 0x08A, 0x031, 0x023, 0x09C, 0x00A,
881 0x05D, 0x0EA, 0x034, 0x033, 0x02E, 0x095, 0x0C7, 0x0CE,
882 0x02A, 0x04F, 0x0E6, 0x050, 0x020, 0x0B9, 0x031, 0x00C,
883 0x09B, 0x0EF, 0x039, 0x014, 0x045, 0x0CE, 0x045, 0x007,
884 0x01C, 0x0EA, 0x046, 0x087, 0x0AB, 0x01B, 0x036, 0x084,
885 0x0A7, 0x05E, 0x0AC, 0x096, 0x067, 0x052, 0x0B0, 0x017,
886 0x0DC, 0x0FE, 0x07B, 0x04A, 0x022, 0x0E7, 0x08A, 0x085,
887 0x0F9, 0x09E, 0x059, 0x097, 0x07A, 0x08D, 0x00C, 0x0CB,
888 0x0A5, 0x027, 0x0F3, 0x0A0, 0x044, 0x032, 0x060, 0x0B9,
889 0x037, 0x0DE, 0x072, 0x028, 0x08B, 0x09C, 0x08A, 0x00E,
890 0x039, 0x0D4, 0x08C, 0x005, 0x0F7, 0x0E7, 0x0B8, 0x02A,
891 0x0F9, 0x028, 0x018, 0x0EF, 0x000, 0x030, 0x030, 0x057,
892 0x007, 0x044, 0x00A, 0x050, 0x08F, 0x0F0, 0x073, 0x091,
893 0x041, 0x01F, 0x03A, 0x090, 0x045, 0x0C0, 0x0BB, 0x018,
894 0x0E1, 0x036, 0x002, 0x0FB, 0x0FB, 0x09E, 0x002, 0x0FA,
895 0x0EE, 0x0E7, 0x0F5, 0x0CF, 0x001, 0x07D, 0x010, 0x05C,
896 0x0F0, 0x017, 0x0D1, 0x005, 0x0CF, 0x001, 0x07D, 0x053,
897 0x0EB, 0x02D, 0x018, 0x005, 0x0B8, 0x00D, 0x0A6, 0x042,
898 0x0DC, 0x006, 0x0D3, 0x017, 0x035, 0x0A8, 0x08B, 0x09C,
899 0x00A, 0x00E, 0x039, 0x0D4, 0x00C, 0x0FE, 0x07B, 0x04A,
900 0x022, 0x0E6, 0x055, 0x00B, 0x0F3, 0x031, 0x0B3, 0x060,
901 0x02F, 0x0BC, 0x07C, 0x0E2, 0x0A4, 0x0FE, 0x065, 0x051,
902 0x017, 0x038, 0x014, 0x01C, 0x073, 0x0A8, 0x019, 0x0FC,
903 0x0F6, 0x094, 0x045, 0x0CC, 0x0AA, 0x017, 0x0E6, 0x063,
904 0x066, 0x00A, 0x0B8, 0x0CC, 0x085, 0x0A1, 0x058, 0x0F6,
905 0x0A2, 0x035, 0x048, 0x048, 0x07F, 0x04A, 0x089, 0x095,
906 0x021, 0x021, 0x0FD, 0x005, 0x002, 0x054, 0x09E, 0x045,
907 0x091, 0x00E, 0x03C, 0x005, 0x0F5, 0x007, 0x040, 0x055,
908 0x048, 0x052, 0x03E, 0x086, 0x0A0, 0x075, 0x048, 0x052,
909 0x03E, 0x0B5, 0x000, 0x04A, 0x09C, 0x000, 0x06B, 0x0C7,
910 0x0CE, 0x045, 0x027, 0x0F3, 0x02A, 0x084, 0x037, 0x035,
911 0x0DE, 0x0A0, 0x0AB, 0x023, 0x01A, 0x0AE, 0x0F5, 0x083,
912 0x059, 0x018, 0x0D7, 0x043, 0x0DE, 0x02A, 0x0D0, 0x094,
913 0x0EB, 0x0DE, 0x005, 0x03A, 0x095, 0x09F, 0x0CC, 0x0C3,
914 0x020, 0x045, 0x0CC, 0x0AA, 0x017, 0x0E6, 0x066, 0x0CC,
915 0x043, 0x026, 0x04F, 0x0E7, 0x041, 0x022, 0x02E, 0x070,
916 0x068, 0x038, 0x0E7, 0x053, 0x0E0, 0x02F, 0x0AB, 0x0BC,
917 0x012, 0x0D2, 0x0E9, 0x058, 0x00B, 0x0EA, 0x0A7, 0x0AD,
918 0x045, 0x0A1, 0x01F, 0x0C0, 0x05F, 0x078, 0x039, 0x0C8,
919 0x0A0, 0x08F, 0x09D, 0x048, 0x01C, 0x024, 0x0EE, 0x0C7,
920 0x080, 0x0BE, 0x0BA, 0x0F5, 0x06D, 0x066, 0x049, 0x077,
921 0x00D, 0x04E, 0x0A5, 0x030, 0x009, 0x0B4, 0x0F9, 0x0C5,
922 0x043, 0x00F, 0x038, 0x0A9, 0x03F, 0x09D, 0x002, 0x0FB,
923 0x0CE, 0x045, 0x011, 0x073, 0x091, 0x041, 0x0C7, 0x03A,
924 0x091, 0x09F, 0x0CF, 0x069, 0x044, 0x05C, 0x0F1, 0x050,
925 0x0BF, 0x033, 0x0CB, 0x032, 0x0A7, 0x0AC, 0x054, 0x090,
926 0x08D, 0x044, 0x08E, 0x070, 0x029, 0x077, 0x0A8, 0x0D0,
927 0x0CC, 0x0BA, 0x056, 0x0B0, 0x0B2, 0x09D, 0x08C, 0x086,
928 0x04C, 0x017, 0x026, 0x077, 0x026, 0x01C, 0x027, 0x01C,
929 0x024, 0x09E, 0x023, 0x061, 0x0BE, 0x08E, 0x012, 0x04F,
930 0x011, 0x087, 0x01C, 0x0EA, 0x05C, 0x005, 0x0F5, 0x0D7,
931 0x0B8, 0x06A, 0x075, 0x029, 0x077, 0x0AB, 0x00D, 0x099,
932 0x074, 0x0A5, 0x04F, 0x072, 0x0A0, 0x0AA, 0x04A, 0x0C6,
933 0x0F3, 0x066, 0x066, 0x0C6, 0x039, 0x082, 0x0AF, 0x075,
934 0x0A6, 0x06F, 0x014, 0x06B, 0x0CE, 0x005, 0x070, 0x073,
935 0x096, 0x082, 0x03E, 0x075, 0x028, 0x0E1, 0x03A, 0x0A7,
936 0x0AD, 0x044, 0x060, 0x016, 0x052, 0x0B6, 0x01D, 0x07A,
937 0x0B6, 0x0B3, 0x024, 0x0BB, 0x086, 0x0A7, 0x052, 0x098,
938 0x004, 0x0DA, 0x07C, 0x0E2, 0x0A1, 0x087, 0x09C, 0x055,
939 0x0F7, 0x09C, 0x0B5, 0x0AC, 0x02C, 0x095, 0x033, 0x0B9,
940 0x031, 0x005, 0x0D9, 0x053, 0x0D6, 0x0A2, 0x030, 0x00B,
941 0x029, 0x05B, 0x002, 0x02E, 0x061, 0x05A, 0x017, 0x0E6,
942 0x09C, 0x0B3, 0x02A, 0x07A, 0x0C5, 0x040, 0x021, 0x0A8,
943 0x091, 0x0CE, 0x005, 0x027, 0x0F3, 0x0A5, 0x088, 0x064,
944 0x0C1, 0x072, 0x065, 0x04F, 0x058, 0x014, 0x00C, 0x08D,
945 0x07E, 0x0F3, 0x081, 0x044, 0x05C, 0x0EF, 0x041, 0x0C7,
946 0x03A, 0x0BE, 0x002, 0x0FA, 0x0A9, 0x0EA, 0x0CE, 0x0CC,
947 0x0A9, 0x029, 0x053, 0x0D6, 0x0A2, 0x046, 0x047, 0x0DD,
948 0x07A, 0x0C0, 0x0A3, 0x000, 0x086, 0x0E2, 0x09B, 0x029,
949 0x078, 0x08B, 0x081, 0x009, 0x098, 0x070, 0x09B, 0x029,
950 0x079, 0x05D, 0x0D9, 0x072, 0x0ED, 0x094, 0x0BC, 0x0B9,
951 0x076, 0x013, 0x03B, 0x02A, 0x05D, 0x0B2, 0x097, 0x095,
952 0x02E, 0x0D9, 0x04B, 0x0CA, 0x07D, 0x05B, 0x059, 0x094,
953 0x0CA, 0x01C, 0x024, 0x0EE, 0x0C7, 0x094, 0x0BC, 0x0C0,
954 0x026, 0x0D3, 0x0E7, 0x015, 0x00C, 0x03C, 0x0E2, 0x0AC,
955 0x0FE, 0x07B, 0x04A, 0x022, 0x0E7, 0x08A, 0x085, 0x0F9,
956 0x09E, 0x059, 0x097, 0x07A, 0x08D, 0x00C, 0x0CB, 0x0A5,
957 0x027, 0x0F3, 0x0A0, 0x041, 0x072, 0x062, 0x019, 0x037,
958 0x0DE, 0x070, 0x028, 0x08B, 0x09C, 0x08A, 0x00E, 0x039,
959 0x0D4, 0x08D, 0x00F, 0x056, 0x036, 0x06D, 0x009, 0x04E,
960 0x0BD, 0x059, 0x02C, 0x0CE, 0x0A5, 0x06B, 0x00B, 0x022,
961 0x0D9, 0x09D, 0x0C9, 0x0B2, 0x097, 0x0BE, 0x0F3, 0x081,
962 0x04A, 0x07D, 0x065, 0x0A3, 0x000, 0x093, 0x08F, 0x067,
963 0x029, 0x078, 0x0C2, 0x04D, 0x0C1, 0x0D1, 0x006, 0x082,
964 0x031, 0x0AF, 0x007, 0x038, 0x034, 0x011, 0x0F3, 0x0A8,
965 0x02A, 0x09E, 0x0A8, 0x066, 0x01A, 0x0A4, 0x0A5, 0x04F,
966 0x05A, 0x00C, 0x011, 0x08F, 0x0AA, 0x07B, 0x0D0, 0x065,
967 0x049, 0x045, 0x0BD, 0x0E9, 0x062, 0x0D2, 0x0B1, 0x09E,
968 0x06C, 0x0CC, 0x0C6, 0x019, 0x087, 0x009, 0x0C3, 0x08E,
969 0x075, 0x041, 0x01F, 0x03A, 0x0A5, 0x013, 0x0D5, 0x055,
970 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055,
971 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055,
972 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055,
973 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055,
974 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055, 0x055,
975 0x055, 0x055, 0x055, 0x05A, 0x0CC, 0x090
976 };
977
978#endif /* defined(CONFIG_SMCTR) || defined(CONFIG_SMCTR_MODULE) */
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7ab94c825b57..eba1271b9735 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -48,6 +48,7 @@
48#include <linux/kernel.h> 48#include <linux/kernel.h>
49#include <linux/major.h> 49#include <linux/major.h>
50#include <linux/slab.h> 50#include <linux/slab.h>
51#include <linux/smp_lock.h>
51#include <linux/poll.h> 52#include <linux/poll.h>
52#include <linux/fcntl.h> 53#include <linux/fcntl.h>
53#include <linux/init.h> 54#include <linux/init.h>
@@ -602,6 +603,12 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
602 tun->attached = 1; 603 tun->attached = 1;
603 get_net(dev_net(tun->dev)); 604 get_net(dev_net(tun->dev));
604 605
606 /* Make sure persistent devices do not get stuck in
607 * xoff state.
608 */
609 if (netif_running(tun->dev))
610 netif_wake_queue(tun->dev);
611
605 strcpy(ifr->ifr_name, tun->dev->name); 612 strcpy(ifr->ifr_name, tun->dev->name);
606 return 0; 613 return 0;
607 614
@@ -796,22 +803,26 @@ static int tun_chr_fasync(int fd, struct file *file, int on)
796 803
797 DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on); 804 DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on);
798 805
806 lock_kernel();
799 if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0) 807 if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0)
800 return ret; 808 goto out;
801 809
802 if (on) { 810 if (on) {
803 ret = __f_setown(file, task_pid(current), PIDTYPE_PID, 0); 811 ret = __f_setown(file, task_pid(current), PIDTYPE_PID, 0);
804 if (ret) 812 if (ret)
805 return ret; 813 goto out;
806 tun->flags |= TUN_FASYNC; 814 tun->flags |= TUN_FASYNC;
807 } else 815 } else
808 tun->flags &= ~TUN_FASYNC; 816 tun->flags &= ~TUN_FASYNC;
809 817 ret = 0;
810 return 0; 818out:
819 unlock_kernel();
820 return ret;
811} 821}
812 822
813static int tun_chr_open(struct inode *inode, struct file * file) 823static int tun_chr_open(struct inode *inode, struct file * file)
814{ 824{
825 cycle_kernel_lock();
815 DBG1(KERN_INFO "tunX: tun_chr_open\n"); 826 DBG1(KERN_INFO "tunX: tun_chr_open\n");
816 file->private_data = NULL; 827 file->private_data = NULL;
817 return 0; 828 return 0;
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index fb0b918e5ccb..402e81020fb8 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -28,8 +28,8 @@
28#include <linux/mii.h> 28#include <linux/mii.h>
29#include <linux/phy.h> 29#include <linux/phy.h>
30#include <linux/workqueue.h> 30#include <linux/workqueue.h>
31#include <linux/of_platform.h>
31 32
32#include <asm/of_platform.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <asm/irq.h> 34#include <asm/irq.h>
35#include <asm/io.h> 35#include <asm/io.h>
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 940474736922..6d9e7ad9fda9 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -36,8 +36,8 @@
36#include <linux/mii.h> 36#include <linux/mii.h>
37#include <linux/phy.h> 37#include <linux/phy.h>
38#include <linux/fsl_devices.h> 38#include <linux/fsl_devices.h>
39#include <linux/of_platform.h>
39 40
40#include <asm/of_platform.h>
41#include <asm/io.h> 41#include <asm/io.h>
42#include <asm/irq.h> 42#include <asm/irq.h>
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 7c66b052f55a..d6829db51b45 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -57,13 +57,12 @@
57#include <linux/ethtool.h> 57#include <linux/ethtool.h>
58#include <linux/dma-mapping.h> 58#include <linux/dma-mapping.h>
59#include <linux/wait.h> 59#include <linux/wait.h>
60#include <linux/firmware.h>
60#include <asm/uaccess.h> 61#include <asm/uaccess.h>
61#include <asm/byteorder.h> 62#include <asm/byteorder.h>
62 63
63#undef DEBUG 64#undef DEBUG
64 65
65#include "kawethfw.h"
66
67#define KAWETH_MTU 1514 66#define KAWETH_MTU 1514
68#define KAWETH_BUF_SIZE 1664 67#define KAWETH_BUF_SIZE 1664
69#define KAWETH_TX_TIMEOUT (5 * HZ) 68#define KAWETH_TX_TIMEOUT (5 * HZ)
@@ -108,6 +107,10 @@
108MODULE_AUTHOR("Michael Zappe <zapman@interlan.net>, Stephane Alnet <stephane@u-picardie.fr>, Brad Hards <bhards@bigpond.net.au> and Oliver Neukum <oliver@neukum.org>"); 107MODULE_AUTHOR("Michael Zappe <zapman@interlan.net>, Stephane Alnet <stephane@u-picardie.fr>, Brad Hards <bhards@bigpond.net.au> and Oliver Neukum <oliver@neukum.org>");
109MODULE_DESCRIPTION("KL5USB101 USB Ethernet driver"); 108MODULE_DESCRIPTION("KL5USB101 USB Ethernet driver");
110MODULE_LICENSE("GPL"); 109MODULE_LICENSE("GPL");
110MODULE_FIRMWARE("kaweth/new_code.bin");
111MODULE_FIRMWARE("kaweth/new_code_fix.bin");
112MODULE_FIRMWARE("kaweth/trigger_code.bin");
113MODULE_FIRMWARE("kaweth/trigger_code_fix.bin");
111 114
112static const char driver_name[] = "kaweth"; 115static const char driver_name[] = "kaweth";
113 116
@@ -385,17 +388,28 @@ static int kaweth_set_receive_filter(struct kaweth_device *kaweth,
385 * kaweth_download_firmware 388 * kaweth_download_firmware
386 ****************************************************************/ 389 ****************************************************************/
387static int kaweth_download_firmware(struct kaweth_device *kaweth, 390static int kaweth_download_firmware(struct kaweth_device *kaweth,
388 __u8 *data, 391 const char *fwname,
389 __u16 data_len,
390 __u8 interrupt, 392 __u8 interrupt,
391 __u8 type) 393 __u8 type)
392{ 394{
393 if(data_len > KAWETH_FIRMWARE_BUF_SIZE) { 395 const struct firmware *fw;
394 err("Firmware too big: %d", data_len); 396 int data_len;
397 int ret;
398
399 ret = request_firmware(&fw, fwname, &kaweth->dev->dev);
400 if (ret) {
401 err("Firmware request failed\n");
402 return ret;
403 }
404
405 if (fw->size > KAWETH_FIRMWARE_BUF_SIZE) {
406 err("Firmware too big: %zu", fw->size);
395 return -ENOSPC; 407 return -ENOSPC;
396 } 408 }
409 data_len = fw->size;
410 memcpy(kaweth->firmware_buf, fw->data, fw->size);
397 411
398 memcpy(kaweth->firmware_buf, data, data_len); 412 release_firmware(fw);
399 413
400 kaweth->firmware_buf[2] = (data_len & 0xFF) - 7; 414 kaweth->firmware_buf[2] = (data_len & 0xFF) - 7;
401 kaweth->firmware_buf[3] = data_len >> 8; 415 kaweth->firmware_buf[3] = data_len >> 8;
@@ -406,8 +420,7 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth,
406 kaweth->firmware_buf[2]); 420 kaweth->firmware_buf[2]);
407 421
408 dbg("Downloading firmware at %p to kaweth device at %p", 422 dbg("Downloading firmware at %p to kaweth device at %p",
409 data, 423 fw->data, kaweth);
410 kaweth);
411 dbg("Firmware length: %d", data_len); 424 dbg("Firmware length: %d", data_len);
412 425
413 return kaweth_control(kaweth, 426 return kaweth_control(kaweth,
@@ -1009,8 +1022,7 @@ static int kaweth_probe(
1009 info("Downloading firmware..."); 1022 info("Downloading firmware...");
1010 kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL); 1023 kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL);
1011 if ((result = kaweth_download_firmware(kaweth, 1024 if ((result = kaweth_download_firmware(kaweth,
1012 kaweth_new_code, 1025 "kaweth/new_code.bin",
1013 len_kaweth_new_code,
1014 100, 1026 100,
1015 2)) < 0) { 1027 2)) < 0) {
1016 err("Error downloading firmware (%d)", result); 1028 err("Error downloading firmware (%d)", result);
@@ -1018,8 +1030,7 @@ static int kaweth_probe(
1018 } 1030 }
1019 1031
1020 if ((result = kaweth_download_firmware(kaweth, 1032 if ((result = kaweth_download_firmware(kaweth,
1021 kaweth_new_code_fix, 1033 "kaweth/new_code_fix.bin",
1022 len_kaweth_new_code_fix,
1023 100, 1034 100,
1024 3)) < 0) { 1035 3)) < 0) {
1025 err("Error downloading firmware fix (%d)", result); 1036 err("Error downloading firmware fix (%d)", result);
@@ -1027,8 +1038,7 @@ static int kaweth_probe(
1027 } 1038 }
1028 1039
1029 if ((result = kaweth_download_firmware(kaweth, 1040 if ((result = kaweth_download_firmware(kaweth,
1030 kaweth_trigger_code, 1041 "kaweth/trigger_code.bin",
1031 len_kaweth_trigger_code,
1032 126, 1042 126,
1033 2)) < 0) { 1043 2)) < 0) {
1034 err("Error downloading trigger code (%d)", result); 1044 err("Error downloading trigger code (%d)", result);
@@ -1037,8 +1047,7 @@ static int kaweth_probe(
1037 } 1047 }
1038 1048
1039 if ((result = kaweth_download_firmware(kaweth, 1049 if ((result = kaweth_download_firmware(kaweth,
1040 kaweth_trigger_code_fix, 1050 "kaweth/trigger_code_fix.bin",
1041 len_kaweth_trigger_code_fix,
1042 126, 1051 126,
1043 3)) < 0) { 1052 3)) < 0) {
1044 err("Error downloading trigger code fix (%d)", result); 1053 err("Error downloading trigger code fix (%d)", result);
diff --git a/drivers/net/usb/kawethfw.h b/drivers/net/usb/kawethfw.h
deleted file mode 100644
index cf85fcb0d1a6..000000000000
--- a/drivers/net/usb/kawethfw.h
+++ /dev/null
@@ -1,557 +0,0 @@
1/******************************************/
2/* NOTE: B6/C3 is data header signature */
3/* 0xAA/0xBB is data length = total */
4/* bytes - 7, 0xCC is type, 0xDD is */
5/* interrupt to use. */
6/******************************************/
7
8/****************************************************************
9 * kaweth_trigger_code
10 ****************************************************************/
11static __u8 kaweth_trigger_code[] =
12{
13 0xB6, 0xC3, 0xAA, 0xBB, 0xCC, 0xDD,
14 0xc8, 0x07, 0xa0, 0x00, 0xf0, 0x07, 0x5e, 0x00,
15 0x06, 0x00, 0xf0, 0x07, 0x0a, 0x00, 0x08, 0x00,
16 0xf0, 0x09, 0x00, 0x00, 0x02, 0x00, 0xe7, 0x07,
17 0x36, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00,
18 0x04, 0x00, 0xe7, 0x07, 0x50, 0xc3, 0x10, 0xc0,
19 0xf0, 0x09, 0x0e, 0xc0, 0x00, 0x00, 0xe7, 0x87,
20 0x01, 0x00, 0x0e, 0xc0, 0x97, 0xcf, 0xd7, 0x09,
21 0x00, 0xc0, 0x17, 0x02, 0xc8, 0x07, 0xa0, 0x00,
22 0xe7, 0x17, 0x50, 0xc3, 0x10, 0xc0, 0x30, 0xd8,
23 0x04, 0x00, 0x30, 0x5c, 0x08, 0x00, 0x04, 0x00,
24 0xb0, 0xc0, 0x06, 0x00, 0xc8, 0x05, 0xe7, 0x05,
25 0x00, 0xc0, 0xc0, 0xdf, 0x97, 0xcf, 0x49, 0xaf,
26 0xc0, 0x07, 0x00, 0x00, 0x60, 0xaf, 0x4a, 0xaf,
27 0x00, 0x0c, 0x0c, 0x00, 0x40, 0xd2, 0x00, 0x1c,
28 0x0c, 0x00, 0x40, 0xd2, 0x30, 0x00, 0x08, 0x00,
29 0xf0, 0x07, 0x00, 0x00, 0x04, 0x00, 0xf0, 0x07,
30 0x86, 0x00, 0x06, 0x00, 0x67, 0xcf, 0x27, 0x0c,
31 0x02, 0x00, 0x00, 0x00, 0x27, 0x0c, 0x00, 0x00,
32 0x0e, 0xc0, 0x49, 0xaf, 0x64, 0xaf, 0xc0, 0x07,
33 0x00, 0x00, 0x4b, 0xaf, 0x4a, 0xaf, 0x5a, 0xcf,
34 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35 0x00, 0x00, 0x94, 0x00, 0x05, 0x00,
36 0x00, 0x00
37};
38/****************************************************************
39 * kaweth_trigger_code_fix
40 ****************************************************************/
41static __u8 kaweth_trigger_code_fix[] =
42{
43 0xB6, 0xC3, 0xAA, 0xBB, 0xCC, 0xDD,
44 0x02, 0x00, 0x06, 0x00, 0x18, 0x00, 0x3e, 0x00,
45 0x80, 0x00, 0x98, 0x00, 0xaa, 0x00,
46 0x00, 0x00
47};
48
49/****************************************************************
50 * kaweth_new_code
51 ****************************************************************/
52static __u8 kaweth_new_code[] =
53{
54 0xB6, 0xC3, 0xAA, 0xBB, 0xCC, 0xDD,
55 0x9f, 0xcf, 0xde, 0x06, 0xe7, 0x57, 0x00, 0x00,
56 0xc4, 0x06, 0x97, 0xc1, 0xe7, 0x67, 0xff, 0x1f,
57 0x28, 0xc0, 0xe7, 0x87, 0x00, 0x04, 0x24, 0xc0,
58 0xe7, 0x67, 0xff, 0xf9, 0x22, 0xc0, 0x97, 0xcf,
59 0xd7, 0x09, 0x00, 0xc0, 0xe7, 0x09, 0xa2, 0xc0,
60 0xbe, 0x06, 0x9f, 0xaf, 0x36, 0x00, 0xe7, 0x05,
61 0x00, 0xc0, 0xa7, 0xcf, 0xbc, 0x06, 0x97, 0xcf,
62 0xe7, 0x57, 0x00, 0x00, 0xb8, 0x06, 0xa7, 0xa1,
63 0xb8, 0x06, 0x97, 0xcf, 0xe7, 0x57, 0x00, 0x00,
64 0x14, 0x08, 0x0a, 0xc0, 0xe7, 0x57, 0x00, 0x00,
65 0xa4, 0xc0, 0xa7, 0xc0, 0x7a, 0x06, 0x9f, 0xaf,
66 0x92, 0x07, 0xe7, 0x07, 0x00, 0x00, 0x14, 0x08,
67 0xe7, 0x57, 0xff, 0xff, 0xba, 0x06, 0x9f, 0xa0,
68 0x38, 0x00, 0xe7, 0x59, 0xba, 0x06, 0xbe, 0x06,
69 0x9f, 0xa0, 0x38, 0x00, 0xc8, 0x09, 0xca, 0x06,
70 0x08, 0x62, 0x9f, 0xa1, 0x36, 0x08, 0xc0, 0x09,
71 0x76, 0x06, 0x00, 0x60, 0xa7, 0xc0, 0x7a, 0x06,
72 0x9f, 0xaf, 0xcc, 0x02, 0xe7, 0x57, 0x00, 0x00,
73 0xb8, 0x06, 0xa7, 0xc1, 0x7a, 0x06, 0x9f, 0xaf,
74 0x04, 0x00, 0xe7, 0x57, 0x00, 0x00, 0x8e, 0x06,
75 0x0a, 0xc1, 0xe7, 0x09, 0x20, 0xc0, 0x10, 0x08,
76 0xe7, 0xd0, 0x10, 0x08, 0xe7, 0x67, 0x40, 0x00,
77 0x10, 0x08, 0x9f, 0xaf, 0x92, 0x0c, 0xc0, 0x09,
78 0xd0, 0x06, 0x00, 0x60, 0x05, 0xc4, 0xc0, 0x59,
79 0xbe, 0x06, 0x02, 0xc0, 0x9f, 0xaf, 0xec, 0x00,
80 0x9f, 0xaf, 0x34, 0x02, 0xe7, 0x57, 0x00, 0x00,
81 0xa6, 0x06, 0x9f, 0xa0, 0x7a, 0x02, 0xa7, 0xcf,
82 0x7a, 0x06, 0x48, 0x02, 0xe7, 0x09, 0xbe, 0x06,
83 0xd0, 0x06, 0xc8, 0x37, 0x04, 0x00, 0x9f, 0xaf,
84 0x08, 0x03, 0x97, 0xcf, 0xe7, 0x57, 0x00, 0x00,
85 0xce, 0x06, 0x97, 0xc0, 0xd7, 0x09, 0x00, 0xc0,
86 0xc1, 0xdf, 0xc8, 0x09, 0xc6, 0x06, 0x08, 0x62,
87 0x14, 0xc0, 0x27, 0x04, 0xc6, 0x06, 0x10, 0x94,
88 0xf0, 0x07, 0x10, 0x08, 0x02, 0x00, 0xc1, 0x07,
89 0x01, 0x00, 0x70, 0x00, 0x04, 0x00, 0xf0, 0x07,
90 0x30, 0x01, 0x06, 0x00, 0x50, 0xaf, 0xe7, 0x07,
91 0xff, 0xff, 0xd0, 0x06, 0xe7, 0x07, 0x00, 0x00,
92 0xce, 0x06, 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf,
93 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0x48, 0x02,
94 0xd0, 0x09, 0xc6, 0x06, 0x27, 0x02, 0xc6, 0x06,
95 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf, 0x48, 0x02,
96 0xc8, 0x37, 0x04, 0x00, 0x00, 0x0c, 0x0c, 0x00,
97 0x00, 0x60, 0x21, 0xc0, 0xc0, 0x37, 0x3e, 0x00,
98 0x23, 0xc9, 0xc0, 0x57, 0xb4, 0x05, 0x1b, 0xc8,
99 0xc0, 0x17, 0x3f, 0x00, 0xc0, 0x67, 0xc0, 0xff,
100 0x30, 0x00, 0x08, 0x00, 0xf0, 0x07, 0x00, 0x00,
101 0x04, 0x00, 0x00, 0x02, 0xc0, 0x17, 0x4c, 0x00,
102 0x30, 0x00, 0x06, 0x00, 0xf0, 0x07, 0xa0, 0x01,
103 0x0a, 0x00, 0x48, 0x02, 0xc1, 0x07, 0x02, 0x00,
104 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0x51, 0xaf,
105 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf, 0x9f, 0xaf,
106 0x08, 0x03, 0x9f, 0xaf, 0x7a, 0x02, 0x97, 0xcf,
107 0x9f, 0xaf, 0x7a, 0x02, 0xc9, 0x37, 0x04, 0x00,
108 0xc1, 0xdf, 0xc8, 0x09, 0xa2, 0x06, 0x50, 0x02,
109 0x67, 0x02, 0xa2, 0x06, 0xd1, 0x07, 0x00, 0x00,
110 0x27, 0xd8, 0xaa, 0x06, 0xc0, 0xdf, 0x9f, 0xaf,
111 0xc4, 0x01, 0x97, 0xcf, 0xe7, 0x57, 0x00, 0x00,
112 0xd2, 0x06, 0x97, 0xc1, 0xe7, 0x57, 0x01, 0x00,
113 0xa8, 0x06, 0x97, 0xc0, 0xc8, 0x09, 0xa0, 0x06,
114 0x08, 0x62, 0x97, 0xc0, 0x00, 0x02, 0xc0, 0x17,
115 0x0e, 0x00, 0x27, 0x00, 0x34, 0x01, 0x27, 0x0c,
116 0x0c, 0x00, 0x36, 0x01, 0xe7, 0x07, 0x50, 0xc3,
117 0x12, 0xc0, 0xe7, 0x07, 0xcc, 0x0b, 0x02, 0x00,
118 0xe7, 0x07, 0x01, 0x00, 0xa8, 0x06, 0xe7, 0x07,
119 0x05, 0x00, 0x90, 0xc0, 0x97, 0xcf, 0xc8, 0x09,
120 0xa4, 0x06, 0x08, 0x62, 0x02, 0xc0, 0x10, 0x64,
121 0x07, 0xc1, 0xe7, 0x07, 0x00, 0x00, 0x9e, 0x06,
122 0xe7, 0x07, 0x72, 0x04, 0x24, 0x00, 0x97, 0xcf,
123 0x27, 0x04, 0xa4, 0x06, 0xc8, 0x17, 0x0e, 0x00,
124 0x27, 0x02, 0x9e, 0x06, 0xe7, 0x07, 0x80, 0x04,
125 0x24, 0x00, 0x97, 0xcf, 0xd7, 0x09, 0x00, 0xc0,
126 0xc1, 0xdf, 0xe7, 0x57, 0x00, 0x00, 0x90, 0x06,
127 0x13, 0xc1, 0x9f, 0xaf, 0x06, 0x02, 0xe7, 0x57,
128 0x00, 0x00, 0x9e, 0x06, 0x13, 0xc0, 0xe7, 0x09,
129 0x9e, 0x06, 0x30, 0x01, 0xe7, 0x07, 0xf2, 0x05,
130 0x32, 0x01, 0xe7, 0x07, 0x10, 0x00, 0x96, 0xc0,
131 0xe7, 0x09, 0x9e, 0x06, 0x90, 0x06, 0x04, 0xcf,
132 0xe7, 0x57, 0x00, 0x00, 0x9e, 0x06, 0x02, 0xc1,
133 0x9f, 0xaf, 0x06, 0x02, 0xe7, 0x05, 0x00, 0xc0,
134 0x97, 0xcf, 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf,
135 0x08, 0x92, 0xe7, 0x57, 0x02, 0x00, 0xaa, 0x06,
136 0x02, 0xc3, 0xc8, 0x09, 0xa4, 0x06, 0x27, 0x02,
137 0xa6, 0x06, 0x08, 0x62, 0x03, 0xc1, 0xe7, 0x05,
138 0x00, 0xc0, 0x97, 0xcf, 0x27, 0x04, 0xa4, 0x06,
139 0xe7, 0x05, 0x00, 0xc0, 0xf0, 0x07, 0x40, 0x00,
140 0x08, 0x00, 0xf0, 0x07, 0x00, 0x00, 0x04, 0x00,
141 0x00, 0x02, 0xc0, 0x17, 0x0c, 0x00, 0x30, 0x00,
142 0x06, 0x00, 0xf0, 0x07, 0x46, 0x01, 0x0a, 0x00,
143 0xc8, 0x17, 0x04, 0x00, 0xc1, 0x07, 0x02, 0x00,
144 0x51, 0xaf, 0x97, 0xcf, 0xe7, 0x57, 0x00, 0x00,
145 0x96, 0x06, 0x97, 0xc0, 0xc1, 0xdf, 0xc8, 0x09,
146 0x96, 0x06, 0x27, 0x04, 0x96, 0x06, 0x27, 0x52,
147 0x98, 0x06, 0x03, 0xc1, 0xe7, 0x07, 0x96, 0x06,
148 0x98, 0x06, 0xc0, 0xdf, 0x17, 0x02, 0xc8, 0x17,
149 0x0e, 0x00, 0x9f, 0xaf, 0xba, 0x03, 0xc8, 0x05,
150 0x00, 0x60, 0x03, 0xc0, 0x9f, 0xaf, 0x24, 0x03,
151 0x97, 0xcf, 0x9f, 0xaf, 0x08, 0x03, 0x97, 0xcf,
152 0x57, 0x02, 0xc9, 0x07, 0xa4, 0x06, 0xd7, 0x09,
153 0x00, 0xc0, 0xc1, 0xdf, 0x08, 0x62, 0x1b, 0xc0,
154 0x50, 0x04, 0x11, 0x02, 0xe7, 0x05, 0x00, 0xc0,
155 0xc9, 0x05, 0x97, 0xcf, 0x97, 0x02, 0xca, 0x09,
156 0xd6, 0x06, 0xf2, 0x17, 0x01, 0x00, 0x04, 0x00,
157 0xf2, 0x27, 0x00, 0x00, 0x06, 0x00, 0xca, 0x17,
158 0x2c, 0x00, 0xf8, 0x77, 0x01, 0x00, 0x0e, 0x00,
159 0x06, 0xc0, 0xca, 0xd9, 0xf8, 0x57, 0xff, 0x00,
160 0x0e, 0x00, 0x01, 0xc1, 0xca, 0xd9, 0x22, 0x1c,
161 0x0c, 0x00, 0xe2, 0x27, 0x00, 0x00, 0xe2, 0x17,
162 0x01, 0x00, 0xe2, 0x27, 0x00, 0x00, 0xca, 0x05,
163 0x00, 0x0c, 0x0c, 0x00, 0xc0, 0x17, 0x41, 0x00,
164 0xc0, 0x67, 0xc0, 0xff, 0x30, 0x00, 0x08, 0x00,
165 0x00, 0x02, 0xc0, 0x17, 0x0c, 0x00, 0x30, 0x00,
166 0x06, 0x00, 0xf0, 0x07, 0xda, 0x00, 0x0a, 0x00,
167 0xf0, 0x07, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0c,
168 0x08, 0x00, 0x40, 0xd1, 0x01, 0x00, 0xc0, 0x19,
169 0xce, 0x06, 0xc0, 0x59, 0xc2, 0x06, 0x04, 0xc9,
170 0x49, 0xaf, 0x9f, 0xaf, 0xec, 0x00, 0x4a, 0xaf,
171 0x67, 0x10, 0xce, 0x06, 0xc8, 0x17, 0x04, 0x00,
172 0xc1, 0x07, 0x01, 0x00, 0xd7, 0x09, 0x00, 0xc0,
173 0xc1, 0xdf, 0x50, 0xaf, 0xe7, 0x05, 0x00, 0xc0,
174 0x97, 0xcf, 0xc0, 0x07, 0x01, 0x00, 0xc1, 0x09,
175 0xac, 0x06, 0xc1, 0x77, 0x01, 0x00, 0x97, 0xc1,
176 0xd8, 0x77, 0x01, 0x00, 0x12, 0xc0, 0xc9, 0x07,
177 0x6a, 0x06, 0x9f, 0xaf, 0x08, 0x04, 0x04, 0xc1,
178 0xc1, 0x77, 0x08, 0x00, 0x13, 0xc0, 0x97, 0xcf,
179 0xc1, 0x77, 0x02, 0x00, 0x97, 0xc1, 0xc1, 0x77,
180 0x10, 0x00, 0x0c, 0xc0, 0x9f, 0xaf, 0x2c, 0x04,
181 0x97, 0xcf, 0xc1, 0x77, 0x04, 0x00, 0x06, 0xc0,
182 0xc9, 0x07, 0x70, 0x06, 0x9f, 0xaf, 0x08, 0x04,
183 0x97, 0xc0, 0x00, 0xcf, 0x00, 0x90, 0x97, 0xcf,
184 0x50, 0x54, 0x97, 0xc1, 0x70, 0x5c, 0x02, 0x00,
185 0x02, 0x00, 0x97, 0xc1, 0x70, 0x5c, 0x04, 0x00,
186 0x04, 0x00, 0x97, 0xcf, 0x80, 0x01, 0xc0, 0x00,
187 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x00,
188 0x06, 0x00, 0x00, 0x00, 0xcb, 0x09, 0xb2, 0x06,
189 0xcc, 0x09, 0xb4, 0x06, 0x0b, 0x53, 0x11, 0xc0,
190 0xc9, 0x02, 0xca, 0x07, 0x1c, 0x04, 0x9f, 0xaf,
191 0x08, 0x04, 0x97, 0xc0, 0x0a, 0xc8, 0x82, 0x08,
192 0x0a, 0xcf, 0x82, 0x08, 0x9f, 0xaf, 0x08, 0x04,
193 0x97, 0xc0, 0x05, 0xc2, 0x89, 0x30, 0x82, 0x60,
194 0x78, 0xc1, 0x00, 0x90, 0x97, 0xcf, 0x89, 0x10,
195 0x09, 0x53, 0x79, 0xc2, 0x89, 0x30, 0x82, 0x08,
196 0x7a, 0xcf, 0xc0, 0xdf, 0x97, 0xcf, 0xc0, 0xdf,
197 0x97, 0xcf, 0xe7, 0x09, 0x96, 0xc0, 0x92, 0x06,
198 0xe7, 0x09, 0x98, 0xc0, 0x94, 0x06, 0x0f, 0xcf,
199 0xe7, 0x09, 0x96, 0xc0, 0x92, 0x06, 0xe7, 0x09,
200 0x98, 0xc0, 0x94, 0x06, 0xe7, 0x09, 0x9e, 0x06,
201 0x30, 0x01, 0xe7, 0x07, 0xf2, 0x05, 0x32, 0x01,
202 0xe7, 0x07, 0x10, 0x00, 0x96, 0xc0, 0xd7, 0x09,
203 0x00, 0xc0, 0x17, 0x02, 0xc8, 0x09, 0x90, 0x06,
204 0xc8, 0x37, 0x0e, 0x00, 0xe7, 0x77, 0x2a, 0x00,
205 0x92, 0x06, 0x30, 0xc0, 0x97, 0x02, 0xca, 0x09,
206 0xd6, 0x06, 0xe7, 0x77, 0x20, 0x00, 0x92, 0x06,
207 0x0e, 0xc0, 0xf2, 0x17, 0x01, 0x00, 0x10, 0x00,
208 0xf2, 0x27, 0x00, 0x00, 0x12, 0x00, 0xe7, 0x77,
209 0x0a, 0x00, 0x92, 0x06, 0xca, 0x05, 0x1e, 0xc0,
210 0x97, 0x02, 0xca, 0x09, 0xd6, 0x06, 0xf2, 0x17,
211 0x01, 0x00, 0x0c, 0x00, 0xf2, 0x27, 0x00, 0x00,
212 0x0e, 0x00, 0xe7, 0x77, 0x02, 0x00, 0x92, 0x06,
213 0x07, 0xc0, 0xf2, 0x17, 0x01, 0x00, 0x44, 0x00,
214 0xf2, 0x27, 0x00, 0x00, 0x46, 0x00, 0x06, 0xcf,
215 0xf2, 0x17, 0x01, 0x00, 0x60, 0x00, 0xf2, 0x27,
216 0x00, 0x00, 0x62, 0x00, 0xca, 0x05, 0x9f, 0xaf,
217 0x08, 0x03, 0x0f, 0xcf, 0x57, 0x02, 0x09, 0x02,
218 0xf1, 0x09, 0x94, 0x06, 0x0c, 0x00, 0xf1, 0xda,
219 0x0c, 0x00, 0xc8, 0x09, 0x98, 0x06, 0x50, 0x02,
220 0x67, 0x02, 0x98, 0x06, 0xd1, 0x07, 0x00, 0x00,
221 0xc9, 0x05, 0xe7, 0x09, 0x9e, 0x06, 0x90, 0x06,
222 0xe7, 0x57, 0x00, 0x00, 0x90, 0x06, 0x02, 0xc0,
223 0x9f, 0xaf, 0x06, 0x02, 0xc8, 0x05, 0xe7, 0x05,
224 0x00, 0xc0, 0xc0, 0xdf, 0x97, 0xcf, 0xd7, 0x09,
225 0x00, 0xc0, 0x17, 0x00, 0x17, 0x02, 0x97, 0x02,
226 0xc0, 0x09, 0x92, 0xc0, 0xe7, 0x07, 0x04, 0x00,
227 0x90, 0xc0, 0xca, 0x09, 0xd6, 0x06, 0xe7, 0x07,
228 0x00, 0x00, 0xa8, 0x06, 0xe7, 0x07, 0x6a, 0x04,
229 0x02, 0x00, 0xc0, 0x77, 0x02, 0x00, 0x08, 0xc0,
230 0xf2, 0x17, 0x01, 0x00, 0x50, 0x00, 0xf2, 0x27,
231 0x00, 0x00, 0x52, 0x00, 0x9f, 0xcf, 0x24, 0x06,
232 0xc0, 0x77, 0x10, 0x00, 0x06, 0xc0, 0xf2, 0x17,
233 0x01, 0x00, 0x58, 0x00, 0xf2, 0x27, 0x00, 0x00,
234 0x5a, 0x00, 0xc0, 0x77, 0x80, 0x00, 0x06, 0xc0,
235 0xf2, 0x17, 0x01, 0x00, 0x70, 0x00, 0xf2, 0x27,
236 0x00, 0x00, 0x72, 0x00, 0xc0, 0x77, 0x08, 0x00,
237 0x1d, 0xc1, 0xf2, 0x17, 0x01, 0x00, 0x08, 0x00,
238 0xf2, 0x27, 0x00, 0x00, 0x0a, 0x00, 0xc0, 0x77,
239 0x00, 0x02, 0x06, 0xc0, 0xf2, 0x17, 0x01, 0x00,
240 0x64, 0x00, 0xf2, 0x27, 0x00, 0x00, 0x66, 0x00,
241 0xc0, 0x77, 0x40, 0x00, 0x06, 0xc0, 0xf2, 0x17,
242 0x01, 0x00, 0x5c, 0x00, 0xf2, 0x27, 0x00, 0x00,
243 0x5e, 0x00, 0xc0, 0x77, 0x01, 0x00, 0x01, 0xc0,
244 0x1b, 0xcf, 0x1a, 0xcf, 0xf2, 0x17, 0x01, 0x00,
245 0x00, 0x00, 0xf2, 0x27, 0x00, 0x00, 0x02, 0x00,
246 0xc8, 0x09, 0x34, 0x01, 0xca, 0x17, 0x14, 0x00,
247 0xd8, 0x77, 0x01, 0x00, 0x05, 0xc0, 0xca, 0xd9,
248 0xd8, 0x57, 0xff, 0x00, 0x01, 0xc0, 0xca, 0xd9,
249 0xe2, 0x19, 0x94, 0xc0, 0xe2, 0x27, 0x00, 0x00,
250 0xe2, 0x17, 0x01, 0x00, 0xe2, 0x27, 0x00, 0x00,
251 0x9f, 0xaf, 0x40, 0x06, 0x9f, 0xaf, 0xc4, 0x01,
252 0xe7, 0x57, 0x00, 0x00, 0xd2, 0x06, 0x9f, 0xa1,
253 0x0e, 0x0a, 0xca, 0x05, 0xc8, 0x05, 0xc0, 0x05,
254 0xe7, 0x05, 0x00, 0xc0, 0xc0, 0xdf, 0x97, 0xcf,
255 0xc8, 0x09, 0xa0, 0x06, 0x08, 0x62, 0x97, 0xc0,
256 0x27, 0x04, 0xa0, 0x06, 0x27, 0x52, 0xa2, 0x06,
257 0x03, 0xc1, 0xe7, 0x07, 0xa0, 0x06, 0xa2, 0x06,
258 0x9f, 0xaf, 0x08, 0x03, 0xe7, 0x57, 0x00, 0x00,
259 0xaa, 0x06, 0x02, 0xc0, 0x27, 0xda, 0xaa, 0x06,
260 0x97, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
261 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
262 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
263 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
264 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
265 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
266 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
267 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
268 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
269 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
270 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
271 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
272 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
273 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
274 0x00, 0x00, 0xff, 0xff, 0xfb, 0x13, 0xe7, 0x57,
275 0x00, 0x80, 0xb2, 0x00, 0x06, 0xc2, 0xe7, 0x07,
276 0xee, 0x0b, 0x12, 0x00, 0xe7, 0x07, 0x34, 0x0c,
277 0xb2, 0x00, 0xe7, 0x07, 0xc6, 0x07, 0xf2, 0x02,
278 0xc8, 0x09, 0xb4, 0x00, 0xf8, 0x07, 0x02, 0x00,
279 0x0d, 0x00, 0xd7, 0x09, 0x0e, 0xc0, 0xe7, 0x07,
280 0x00, 0x00, 0x0e, 0xc0, 0xc8, 0x09, 0xde, 0x00,
281 0xc8, 0x17, 0x09, 0x00, 0xc9, 0x07, 0xda, 0x06,
282 0xc0, 0x07, 0x04, 0x00, 0x68, 0x0a, 0x00, 0xda,
283 0x7d, 0xc1, 0xe7, 0x09, 0xc0, 0x00, 0x7c, 0x06,
284 0xe7, 0x09, 0xbe, 0x00, 0x78, 0x06, 0xe7, 0x09,
285 0x10, 0x00, 0xbc, 0x06, 0xc8, 0x07, 0xd6, 0x07,
286 0x9f, 0xaf, 0xae, 0x07, 0x9f, 0xaf, 0x00, 0x0a,
287 0xc8, 0x09, 0xde, 0x00, 0x00, 0x0e, 0x0f, 0x00,
288 0x41, 0x90, 0x9f, 0xde, 0x06, 0x00, 0x44, 0xaf,
289 0x27, 0x00, 0xb2, 0x06, 0x27, 0x00, 0xb4, 0x06,
290 0x27, 0x00, 0xb6, 0x06, 0xc0, 0x07, 0x74, 0x00,
291 0x44, 0xaf, 0x27, 0x00, 0xd6, 0x06, 0x08, 0x00,
292 0x00, 0x90, 0xc1, 0x07, 0x3a, 0x00, 0x20, 0x00,
293 0x01, 0xda, 0x7d, 0xc1, 0x9f, 0xaf, 0xba, 0x09,
294 0xc0, 0x07, 0x44, 0x00, 0x48, 0xaf, 0x27, 0x00,
295 0x7a, 0x06, 0x9f, 0xaf, 0x96, 0x0a, 0xe7, 0x07,
296 0x01, 0x00, 0xc0, 0x06, 0xe7, 0x05, 0x0e, 0xc0,
297 0x97, 0xcf, 0x49, 0xaf, 0xe7, 0x87, 0x43, 0x00,
298 0x0e, 0xc0, 0xe7, 0x07, 0xff, 0xff, 0xbe, 0x06,
299 0x9f, 0xaf, 0xae, 0x0a, 0xc0, 0x07, 0x01, 0x00,
300 0x60, 0xaf, 0x4a, 0xaf, 0x97, 0xcf, 0x00, 0x08,
301 0x09, 0x08, 0x11, 0x08, 0x00, 0xda, 0x7c, 0xc1,
302 0x97, 0xcf, 0x67, 0x04, 0xcc, 0x02, 0xc0, 0xdf,
303 0x51, 0x94, 0xb1, 0xaf, 0x06, 0x00, 0xc1, 0xdf,
304 0xc9, 0x09, 0xcc, 0x02, 0x49, 0x62, 0x75, 0xc1,
305 0xc0, 0xdf, 0xa7, 0xcf, 0xd6, 0x02, 0x0e, 0x00,
306 0x24, 0x00, 0x80, 0x04, 0x22, 0x00, 0x4e, 0x05,
307 0xd0, 0x00, 0x0e, 0x0a, 0xaa, 0x00, 0x30, 0x08,
308 0xbe, 0x00, 0x4a, 0x0a, 0x10, 0x00, 0x20, 0x00,
309 0x04, 0x00, 0x6e, 0x04, 0x02, 0x00, 0x6a, 0x04,
310 0x06, 0x00, 0x00, 0x00, 0x24, 0xc0, 0x04, 0x04,
311 0x28, 0xc0, 0xfe, 0xfb, 0x1e, 0xc0, 0x00, 0x04,
312 0x22, 0xc0, 0xff, 0xf4, 0xc0, 0x00, 0x90, 0x09,
313 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x56, 0x08,
314 0x60, 0x08, 0xd0, 0x08, 0xda, 0x08, 0x00, 0x09,
315 0x04, 0x09, 0x08, 0x09, 0x32, 0x09, 0x42, 0x09,
316 0x50, 0x09, 0x52, 0x09, 0x5a, 0x09, 0x5a, 0x09,
317 0x27, 0x02, 0xca, 0x06, 0x97, 0xcf, 0xe7, 0x07,
318 0x00, 0x00, 0xca, 0x06, 0x0a, 0x0e, 0x01, 0x00,
319 0xca, 0x57, 0x0e, 0x00, 0x9f, 0xc3, 0x5a, 0x09,
320 0xca, 0x37, 0x00, 0x00, 0x9f, 0xc2, 0x5a, 0x09,
321 0x0a, 0xd2, 0xb2, 0xcf, 0x16, 0x08, 0xc8, 0x09,
322 0xde, 0x00, 0x07, 0x06, 0x9f, 0xcf, 0x6c, 0x09,
323 0x17, 0x02, 0xc8, 0x09, 0xde, 0x00, 0x00, 0x0e,
324 0x0f, 0x00, 0x41, 0x90, 0x9f, 0xde, 0x06, 0x00,
325 0xc8, 0x05, 0x30, 0x50, 0x06, 0x00, 0x9f, 0xc8,
326 0x5a, 0x09, 0x27, 0x0c, 0x02, 0x00, 0xb0, 0x06,
327 0xc0, 0x09, 0xb2, 0x06, 0x27, 0x00, 0xb4, 0x06,
328 0xe7, 0x07, 0x00, 0x00, 0xae, 0x06, 0x27, 0x00,
329 0x80, 0x06, 0x00, 0x1c, 0x06, 0x00, 0x27, 0x00,
330 0xb6, 0x06, 0x41, 0x90, 0x67, 0x50, 0xb0, 0x06,
331 0x0d, 0xc0, 0x67, 0x00, 0x7e, 0x06, 0x27, 0x0c,
332 0x06, 0x00, 0x82, 0x06, 0xe7, 0x07, 0xbc, 0x08,
333 0x84, 0x06, 0xc8, 0x07, 0x7e, 0x06, 0x41, 0x90,
334 0x51, 0xaf, 0x97, 0xcf, 0x9f, 0xaf, 0x48, 0x0c,
335 0xe7, 0x09, 0xb6, 0x06, 0xb4, 0x06, 0xe7, 0x09,
336 0xb0, 0x06, 0xae, 0x06, 0x59, 0xaf, 0x97, 0xcf,
337 0x27, 0x0c, 0x02, 0x00, 0xac, 0x06, 0x59, 0xaf,
338 0x97, 0xcf, 0x09, 0x0c, 0x02, 0x00, 0x09, 0xda,
339 0x49, 0xd2, 0xc9, 0x19, 0xd6, 0x06, 0xc8, 0x07,
340 0x7e, 0x06, 0xe0, 0x07, 0x00, 0x00, 0x60, 0x02,
341 0xe0, 0x07, 0x04, 0x00, 0xd0, 0x07, 0xcc, 0x08,
342 0x48, 0xdb, 0x41, 0x90, 0x50, 0xaf, 0x97, 0xcf,
343 0x59, 0xaf, 0x97, 0xcf, 0x59, 0xaf, 0x97, 0xcf,
344 0xf0, 0x57, 0x06, 0x00, 0x06, 0x00, 0x25, 0xc1,
345 0xe7, 0x07, 0x70, 0x06, 0x80, 0x06, 0x41, 0x90,
346 0x67, 0x00, 0x7e, 0x06, 0x27, 0x0c, 0x06, 0x00,
347 0x82, 0x06, 0xe7, 0x07, 0x8c, 0x09, 0x84, 0x06,
348 0xc8, 0x07, 0x7e, 0x06, 0x41, 0x90, 0x51, 0xaf,
349 0x97, 0xcf, 0x07, 0x0c, 0x06, 0x00, 0xc7, 0x57,
350 0x06, 0x00, 0x0f, 0xc1, 0xc8, 0x07, 0x70, 0x06,
351 0x15, 0xcf, 0x00, 0x0c, 0x02, 0x00, 0x00, 0xda,
352 0x40, 0xd1, 0x27, 0x00, 0xc2, 0x06, 0x1e, 0xcf,
353 0x1d, 0xcf, 0x27, 0x0c, 0x02, 0x00, 0xcc, 0x06,
354 0x19, 0xcf, 0x27, 0x02, 0x20, 0x01, 0xe7, 0x07,
355 0x08, 0x00, 0x22, 0x01, 0xe7, 0x07, 0x13, 0x00,
356 0xb0, 0xc0, 0x97, 0xcf, 0x41, 0x90, 0x67, 0x00,
357 0x7e, 0x06, 0xe7, 0x01, 0x82, 0x06, 0x27, 0x02,
358 0x80, 0x06, 0xe7, 0x07, 0x8c, 0x09, 0x84, 0x06,
359 0xc8, 0x07, 0x7e, 0x06, 0xc1, 0x07, 0x00, 0x80,
360 0x50, 0xaf, 0x97, 0xcf, 0x59, 0xaf, 0x97, 0xcf,
361 0x00, 0x60, 0x05, 0xc0, 0xe7, 0x07, 0x00, 0x00,
362 0xc4, 0x06, 0xa7, 0xcf, 0x7c, 0x06, 0x9f, 0xaf,
363 0x00, 0x0a, 0xe7, 0x07, 0x01, 0x00, 0xc4, 0x06,
364 0x49, 0xaf, 0xd7, 0x09, 0x00, 0xc0, 0x07, 0xaf,
365 0xe7, 0x05, 0x00, 0xc0, 0x4a, 0xaf, 0xa7, 0xcf,
366 0x7c, 0x06, 0xc0, 0x07, 0xfe, 0x7f, 0x44, 0xaf,
367 0x40, 0x00, 0xc0, 0x37, 0x00, 0x01, 0x41, 0x90,
368 0xc0, 0x37, 0x08, 0x00, 0xdf, 0xde, 0x50, 0x06,
369 0xc0, 0x57, 0x10, 0x00, 0x02, 0xc2, 0xc0, 0x07,
370 0x10, 0x00, 0x27, 0x00, 0x9a, 0x06, 0x41, 0x90,
371 0x9f, 0xde, 0x40, 0x06, 0x44, 0xaf, 0x27, 0x00,
372 0x9c, 0x06, 0xc0, 0x09, 0x9a, 0x06, 0x41, 0x90,
373 0x00, 0xd2, 0x00, 0xd8, 0x9f, 0xde, 0x08, 0x00,
374 0x44, 0xaf, 0x27, 0x00, 0xc8, 0x06, 0x97, 0xcf,
375 0xe7, 0x87, 0x00, 0x84, 0x28, 0xc0, 0xe7, 0x67,
376 0xff, 0xfb, 0x24, 0xc0, 0x97, 0xcf, 0xe7, 0x87,
377 0x01, 0x00, 0xd2, 0x06, 0xe7, 0x57, 0x00, 0x00,
378 0xa8, 0x06, 0x97, 0xc1, 0x9f, 0xaf, 0x00, 0x0a,
379 0xe7, 0x87, 0x00, 0x06, 0x22, 0xc0, 0xe7, 0x07,
380 0x00, 0x00, 0x90, 0xc0, 0xe7, 0x67, 0xfe, 0xff,
381 0x3e, 0xc0, 0xe7, 0x07, 0x26, 0x00, 0x0a, 0xc0,
382 0xe7, 0x87, 0x01, 0x00, 0x3e, 0xc0, 0xe7, 0x07,
383 0xff, 0xff, 0xbe, 0x06, 0x9f, 0xaf, 0x10, 0x0b,
384 0x97, 0xcf, 0x17, 0x00, 0xa7, 0xaf, 0x78, 0x06,
385 0xc0, 0x05, 0x27, 0x00, 0x76, 0x06, 0xe7, 0x87,
386 0x01, 0x00, 0xd2, 0x06, 0x9f, 0xaf, 0x00, 0x0a,
387 0xe7, 0x07, 0x0c, 0x00, 0x40, 0xc0, 0x9f, 0xaf,
388 0x10, 0x0b, 0x00, 0x90, 0x27, 0x00, 0xa6, 0x06,
389 0x27, 0x00, 0xaa, 0x06, 0xe7, 0x09, 0xb2, 0x06,
390 0xb4, 0x06, 0x27, 0x00, 0xae, 0x06, 0x27, 0x00,
391 0xac, 0x06, 0x9f, 0xaf, 0xae, 0x0a, 0xc0, 0x07,
392 0x00, 0x00, 0x27, 0x00, 0xb2, 0x02, 0x27, 0x00,
393 0xb4, 0x02, 0x27, 0x00, 0x8e, 0x06, 0xc0, 0x07,
394 0x06, 0x00, 0xc8, 0x09, 0xde, 0x00, 0xc8, 0x17,
395 0x03, 0x00, 0xc9, 0x07, 0x70, 0x06, 0x29, 0x0a,
396 0x00, 0xda, 0x7d, 0xc1, 0x97, 0xcf, 0xd7, 0x09,
397 0x00, 0xc0, 0xc1, 0xdf, 0x00, 0x90, 0x27, 0x00,
398 0x96, 0x06, 0xe7, 0x07, 0x96, 0x06, 0x98, 0x06,
399 0x27, 0x00, 0xa0, 0x06, 0xe7, 0x07, 0xa0, 0x06,
400 0xa2, 0x06, 0x27, 0x00, 0xa6, 0x06, 0x27, 0x00,
401 0x90, 0x06, 0x27, 0x00, 0x9e, 0x06, 0xc8, 0x09,
402 0x9c, 0x06, 0xc1, 0x09, 0x9a, 0x06, 0xc9, 0x07,
403 0xa4, 0x06, 0x11, 0x02, 0x09, 0x02, 0xc8, 0x17,
404 0x40, 0x06, 0x01, 0xda, 0x7a, 0xc1, 0x51, 0x94,
405 0xc8, 0x09, 0xc8, 0x06, 0xc9, 0x07, 0xc6, 0x06,
406 0xc1, 0x09, 0x9a, 0x06, 0x11, 0x02, 0x09, 0x02,
407 0xc8, 0x17, 0x08, 0x00, 0x01, 0xda, 0x7a, 0xc1,
408 0x51, 0x94, 0xe7, 0x05, 0x00, 0xc0, 0x97, 0xcf,
409 0xe7, 0x57, 0x00, 0x00, 0x76, 0x06, 0x97, 0xc0,
410 0x9f, 0xaf, 0x04, 0x00, 0xe7, 0x09, 0xbe, 0x06,
411 0xba, 0x06, 0xe7, 0x57, 0xff, 0xff, 0xba, 0x06,
412 0x04, 0xc1, 0xe7, 0x07, 0x10, 0x0b, 0xb8, 0x06,
413 0x97, 0xcf, 0xe7, 0x17, 0x32, 0x00, 0xba, 0x06,
414 0xe7, 0x67, 0xff, 0x07, 0xba, 0x06, 0xe7, 0x07,
415 0x46, 0x0b, 0xb8, 0x06, 0x97, 0xcf, 0xe7, 0x57,
416 0x00, 0x00, 0xc0, 0x06, 0x23, 0xc0, 0xe7, 0x07,
417 0x04, 0x00, 0x90, 0xc0, 0xe7, 0x07, 0x00, 0x80,
418 0x80, 0xc0, 0xe7, 0x07, 0x00, 0x00, 0x80, 0xc0,
419 0xe7, 0x07, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0x07,
420 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0xc0, 0x07,
421 0x00, 0x00, 0xe7, 0x07, 0x00, 0x00, 0x80, 0xc0,
422 0xe7, 0x07, 0x00, 0x80, 0x80, 0xc0, 0xe7, 0x07,
423 0x00, 0x80, 0x40, 0xc0, 0xc0, 0x07, 0x00, 0x00,
424 0xe7, 0x07, 0x00, 0x00, 0x40, 0xc0, 0xe7, 0x07,
425 0x00, 0x00, 0x80, 0xc0, 0xe7, 0x07, 0x04, 0x00,
426 0x90, 0xc0, 0xe7, 0x07, 0x00, 0x02, 0x40, 0xc0,
427 0xe7, 0x07, 0x0c, 0x02, 0x40, 0xc0, 0xe7, 0x07,
428 0x00, 0x00, 0xc0, 0x06, 0xe7, 0x07, 0x00, 0x00,
429 0xb8, 0x06, 0xe7, 0x07, 0x00, 0x00, 0xd2, 0x06,
430 0xd7, 0x09, 0x00, 0xc0, 0xc1, 0xdf, 0x9f, 0xaf,
431 0x34, 0x02, 0xe7, 0x05, 0x00, 0xc0, 0x9f, 0xaf,
432 0xc4, 0x01, 0x97, 0xcf, 0xd7, 0x09, 0x00, 0xc0,
433 0x17, 0x00, 0x17, 0x02, 0x97, 0x02, 0xe7, 0x57,
434 0x00, 0x00, 0xa8, 0x06, 0x06, 0xc0, 0xc0, 0x09,
435 0x92, 0xc0, 0xc0, 0x77, 0x09, 0x02, 0x9f, 0xc1,
436 0x5c, 0x05, 0x9f, 0xcf, 0x32, 0x06, 0xd7, 0x09,
437 0x0e, 0xc0, 0xe7, 0x07, 0x00, 0x00, 0x0e, 0xc0,
438 0x9f, 0xaf, 0x02, 0x0c, 0xe7, 0x05, 0x0e, 0xc0,
439 0x97, 0xcf, 0xd7, 0x09, 0x00, 0xc0, 0x17, 0x02,
440 0xc8, 0x09, 0xb0, 0xc0, 0xe7, 0x67, 0xfe, 0x7f,
441 0xb0, 0xc0, 0xc8, 0x77, 0x00, 0x20, 0x9f, 0xc1,
442 0x64, 0xeb, 0xe7, 0x57, 0x00, 0x00, 0xc8, 0x02,
443 0x9f, 0xc1, 0x80, 0xeb, 0xc8, 0x99, 0xca, 0x02,
444 0xc8, 0x67, 0x04, 0x00, 0x9f, 0xc1, 0x96, 0xeb,
445 0x9f, 0xcf, 0x4c, 0xeb, 0xe7, 0x07, 0x00, 0x00,
446 0xa6, 0xc0, 0xe7, 0x09, 0xb0, 0xc0, 0xc8, 0x02,
447 0xe7, 0x07, 0x03, 0x00, 0xb0, 0xc0, 0x97, 0xcf,
448 0xc0, 0x09, 0xb0, 0x06, 0xc0, 0x37, 0x01, 0x00,
449 0x97, 0xc9, 0xc9, 0x09, 0xb2, 0x06, 0x02, 0x00,
450 0x41, 0x90, 0x48, 0x02, 0xc9, 0x17, 0x06, 0x00,
451 0x9f, 0xaf, 0x08, 0x04, 0x9f, 0xa2, 0x72, 0x0c,
452 0x02, 0xda, 0x77, 0xc1, 0x41, 0x60, 0x71, 0xc1,
453 0x97, 0xcf, 0x17, 0x02, 0x57, 0x02, 0x43, 0x04,
454 0x21, 0x04, 0xe0, 0x00, 0x43, 0x04, 0x21, 0x04,
455 0xe0, 0x00, 0x43, 0x04, 0x21, 0x04, 0xe0, 0x00,
456 0xc1, 0x07, 0x01, 0x00, 0xc9, 0x05, 0xc8, 0x05,
457 0x97, 0xcf, 0xe7, 0x07, 0x01, 0x00, 0x8e, 0x06,
458 0xc8, 0x07, 0x86, 0x06, 0xe7, 0x07, 0x00, 0x00,
459 0x86, 0x06, 0xe7, 0x07, 0x10, 0x08, 0x88, 0x06,
460 0xe7, 0x07, 0x04, 0x00, 0x8a, 0x06, 0xe7, 0x07,
461 0xbc, 0x0c, 0x8c, 0x06, 0xc1, 0x07, 0x03, 0x80,
462 0x50, 0xaf, 0x97, 0xcf, 0xe7, 0x07, 0x00, 0x00,
463 0x8e, 0x06, 0x97, 0xcf,
464 0x00, 0x00
465};
466
467/****************************************************************
468 * kaweth_new_code_fix
469 ****************************************************************/
470static __u8 kaweth_new_code_fix[] =
471{
472 0xB6, 0xC3, 0xAA, 0xBB, 0xCC, 0xDD,
473 0x02, 0x00, 0x08, 0x00, 0x28, 0x00, 0x2c, 0x00,
474 0x34, 0x00, 0x3c, 0x00, 0x40, 0x00, 0x48, 0x00,
475 0x54, 0x00, 0x58, 0x00, 0x5e, 0x00, 0x64, 0x00,
476 0x68, 0x00, 0x6e, 0x00, 0x6c, 0x00, 0x72, 0x00,
477 0x76, 0x00, 0x7c, 0x00, 0x80, 0x00, 0x86, 0x00,
478 0x8a, 0x00, 0x90, 0x00, 0x94, 0x00, 0x98, 0x00,
479 0x9e, 0x00, 0xa6, 0x00, 0xaa, 0x00, 0xb0, 0x00,
480 0xb4, 0x00, 0xb8, 0x00, 0xc0, 0x00, 0xc6, 0x00,
481 0xca, 0x00, 0xd0, 0x00, 0xd4, 0x00, 0xd8, 0x00,
482 0xe0, 0x00, 0xde, 0x00, 0xe8, 0x00, 0xf0, 0x00,
483 0xfc, 0x00, 0x04, 0x01, 0x0a, 0x01, 0x18, 0x01,
484 0x22, 0x01, 0x28, 0x01, 0x3a, 0x01, 0x3e, 0x01,
485 0x7e, 0x01, 0x98, 0x01, 0x9c, 0x01, 0xa2, 0x01,
486 0xac, 0x01, 0xb2, 0x01, 0xba, 0x01, 0xc0, 0x01,
487 0xc8, 0x01, 0xd0, 0x01, 0xd6, 0x01, 0xf4, 0x01,
488 0xfc, 0x01, 0x08, 0x02, 0x16, 0x02, 0x1a, 0x02,
489 0x22, 0x02, 0x2a, 0x02, 0x2e, 0x02, 0x3e, 0x02,
490 0x44, 0x02, 0x4a, 0x02, 0x50, 0x02, 0x64, 0x02,
491 0x62, 0x02, 0x6c, 0x02, 0x72, 0x02, 0x86, 0x02,
492 0x8c, 0x02, 0x90, 0x02, 0x9e, 0x02, 0xbc, 0x02,
493 0xd0, 0x02, 0xd8, 0x02, 0xdc, 0x02, 0xe0, 0x02,
494 0xe8, 0x02, 0xe6, 0x02, 0xf4, 0x02, 0xfe, 0x02,
495 0x04, 0x03, 0x0c, 0x03, 0x28, 0x03, 0x7c, 0x03,
496 0x90, 0x03, 0x94, 0x03, 0x9c, 0x03, 0xa2, 0x03,
497 0xc0, 0x03, 0xd0, 0x03, 0xd4, 0x03, 0xee, 0x03,
498 0xfa, 0x03, 0xfe, 0x03, 0x2e, 0x04, 0x32, 0x04,
499 0x3c, 0x04, 0x40, 0x04, 0x4e, 0x04, 0x76, 0x04,
500 0x7c, 0x04, 0x84, 0x04, 0x8a, 0x04, 0x8e, 0x04,
501 0xa6, 0x04, 0xb0, 0x04, 0xb8, 0x04, 0xbe, 0x04,
502 0xd2, 0x04, 0xdc, 0x04, 0xee, 0x04, 0x10, 0x05,
503 0x1a, 0x05, 0x24, 0x05, 0x2a, 0x05, 0x36, 0x05,
504 0x34, 0x05, 0x3c, 0x05, 0x42, 0x05, 0x64, 0x05,
505 0x6a, 0x05, 0x6e, 0x05, 0x86, 0x05, 0x22, 0x06,
506 0x26, 0x06, 0x2c, 0x06, 0x30, 0x06, 0x42, 0x06,
507 0x4a, 0x06, 0x4e, 0x06, 0x56, 0x06, 0x54, 0x06,
508 0x5a, 0x06, 0x60, 0x06, 0x66, 0x06, 0xe8, 0x06,
509 0xee, 0x06, 0xf4, 0x06, 0x16, 0x07, 0x26, 0x07,
510 0x2c, 0x07, 0x32, 0x07, 0x36, 0x07, 0x3a, 0x07,
511 0x3e, 0x07, 0x52, 0x07, 0x56, 0x07, 0x5a, 0x07,
512 0x64, 0x07, 0x76, 0x07, 0x7a, 0x07, 0x80, 0x07,
513 0x84, 0x07, 0x8a, 0x07, 0x9e, 0x07, 0xa2, 0x07,
514 0xda, 0x07, 0xde, 0x07, 0xe2, 0x07, 0xe6, 0x07,
515 0xea, 0x07, 0xee, 0x07, 0xf2, 0x07, 0xf6, 0x07,
516 0x0e, 0x08, 0x16, 0x08, 0x18, 0x08, 0x1a, 0x08,
517 0x1c, 0x08, 0x1e, 0x08, 0x20, 0x08, 0x22, 0x08,
518 0x24, 0x08, 0x26, 0x08, 0x28, 0x08, 0x2a, 0x08,
519 0x2c, 0x08, 0x2e, 0x08, 0x32, 0x08, 0x3a, 0x08,
520 0x46, 0x08, 0x4e, 0x08, 0x54, 0x08, 0x5e, 0x08,
521 0x78, 0x08, 0x7e, 0x08, 0x82, 0x08, 0x86, 0x08,
522 0x8c, 0x08, 0x90, 0x08, 0x98, 0x08, 0x9e, 0x08,
523 0xa4, 0x08, 0xaa, 0x08, 0xb0, 0x08, 0xae, 0x08,
524 0xb4, 0x08, 0xbe, 0x08, 0xc4, 0x08, 0xc2, 0x08,
525 0xca, 0x08, 0xc8, 0x08, 0xd4, 0x08, 0xe4, 0x08,
526 0xe8, 0x08, 0xf6, 0x08, 0x14, 0x09, 0x12, 0x09,
527 0x1a, 0x09, 0x20, 0x09, 0x26, 0x09, 0x24, 0x09,
528 0x2a, 0x09, 0x3e, 0x09, 0x4c, 0x09, 0x56, 0x09,
529 0x70, 0x09, 0x74, 0x09, 0x78, 0x09, 0x7e, 0x09,
530 0x7c, 0x09, 0x82, 0x09, 0x98, 0x09, 0x9c, 0x09,
531 0xa0, 0x09, 0xa6, 0x09, 0xb8, 0x09, 0xdc, 0x09,
532 0xe8, 0x09, 0xec, 0x09, 0xfc, 0x09, 0x12, 0x0a,
533 0x18, 0x0a, 0x1e, 0x0a, 0x42, 0x0a, 0x46, 0x0a,
534 0x4e, 0x0a, 0x54, 0x0a, 0x5a, 0x0a, 0x5e, 0x0a,
535 0x68, 0x0a, 0x6e, 0x0a, 0x72, 0x0a, 0x78, 0x0a,
536 0x76, 0x0a, 0x7c, 0x0a, 0x80, 0x0a, 0x84, 0x0a,
537 0x94, 0x0a, 0xa4, 0x0a, 0xb8, 0x0a, 0xbe, 0x0a,
538 0xbc, 0x0a, 0xc2, 0x0a, 0xc8, 0x0a, 0xc6, 0x0a,
539 0xcc, 0x0a, 0xd0, 0x0a, 0xd4, 0x0a, 0xd8, 0x0a,
540 0xdc, 0x0a, 0xe0, 0x0a, 0xf2, 0x0a, 0xf6, 0x0a,
541 0xfa, 0x0a, 0x14, 0x0b, 0x1a, 0x0b, 0x20, 0x0b,
542 0x1e, 0x0b, 0x26, 0x0b, 0x2e, 0x0b, 0x2c, 0x0b,
543 0x36, 0x0b, 0x3c, 0x0b, 0x42, 0x0b, 0x40, 0x0b,
544 0x4a, 0x0b, 0xaa, 0x0b, 0xb0, 0x0b, 0xb6, 0x0b,
545 0xc0, 0x0b, 0xc8, 0x0b, 0xda, 0x0b, 0xe8, 0x0b,
546 0xec, 0x0b, 0xfa, 0x0b, 0x4a, 0x0c, 0x54, 0x0c,
547 0x62, 0x0c, 0x66, 0x0c, 0x96, 0x0c, 0x9a, 0x0c,
548 0xa0, 0x0c, 0xa6, 0x0c, 0xa4, 0x0c, 0xac, 0x0c,
549 0xb2, 0x0c, 0xb0, 0x0c, 0xc0, 0x0c,
550 0x00, 0x00
551};
552
553
554static const int len_kaweth_trigger_code = sizeof(kaweth_trigger_code);
555static const int len_kaweth_trigger_code_fix = sizeof(kaweth_trigger_code_fix);
556static const int len_kaweth_new_code = sizeof(kaweth_new_code);
557static const int len_kaweth_new_code_fix = sizeof(kaweth_new_code_fix);
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index b0fce1387eaf..5827324e9d9f 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -92,6 +92,7 @@
92#include <linux/spinlock.h> 92#include <linux/spinlock.h>
93#include <linux/mutex.h> 93#include <linux/mutex.h>
94#include <linux/device.h> 94#include <linux/device.h>
95#include <linux/smp_lock.h>
95 96
96#undef COSA_SLOW_IO /* for testing purposes only */ 97#undef COSA_SLOW_IO /* for testing purposes only */
97 98
@@ -970,15 +971,21 @@ static int cosa_open(struct inode *inode, struct file *file)
970 struct channel_data *chan; 971 struct channel_data *chan;
971 unsigned long flags; 972 unsigned long flags;
972 int n; 973 int n;
974 int ret = 0;
973 975
976 lock_kernel();
974 if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS) 977 if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS)
975 >= nr_cards) 978 >= nr_cards) {
976 return -ENODEV; 979 ret = -ENODEV;
980 goto out;
981 }
977 cosa = cosa_cards+n; 982 cosa = cosa_cards+n;
978 983
979 if ((n=iminor(file->f_path.dentry->d_inode) 984 if ((n=iminor(file->f_path.dentry->d_inode)
980 & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) 985 & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) {
981 return -ENODEV; 986 ret = -ENODEV;
987 goto out;
988 }
982 chan = cosa->chan + n; 989 chan = cosa->chan + n;
983 990
984 file->private_data = chan; 991 file->private_data = chan;
@@ -987,7 +994,8 @@ static int cosa_open(struct inode *inode, struct file *file)
987 994
988 if (chan->usage < 0) { /* in netdev mode */ 995 if (chan->usage < 0) { /* in netdev mode */
989 spin_unlock_irqrestore(&cosa->lock, flags); 996 spin_unlock_irqrestore(&cosa->lock, flags);
990 return -EBUSY; 997 ret = -EBUSY;
998 goto out;
991 } 999 }
992 cosa->usage++; 1000 cosa->usage++;
993 chan->usage++; 1001 chan->usage++;
@@ -996,7 +1004,9 @@ static int cosa_open(struct inode *inode, struct file *file)
996 chan->setup_rx = chrdev_setup_rx; 1004 chan->setup_rx = chrdev_setup_rx;
997 chan->rx_done = chrdev_rx_done; 1005 chan->rx_done = chrdev_rx_done;
998 spin_unlock_irqrestore(&cosa->lock, flags); 1006 spin_unlock_irqrestore(&cosa->lock, flags);
999 return 0; 1007out:
1008 unlock_kernel();
1009 return ret;
1000} 1010}
1001 1011
1002static int cosa_release(struct inode *inode, struct file *file) 1012static int cosa_release(struct inode *inode, struct file *file)
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 520bb0b1a9a2..6d35155c7145 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -1008,6 +1008,7 @@ static int fr_rx(struct sk_buff *skb)
1008 stats->rx_bytes += skb->len; 1008 stats->rx_bytes += skb->len;
1009 if (pvc->state.becn) 1009 if (pvc->state.becn)
1010 stats->rx_compressed++; 1010 stats->rx_compressed++;
1011 skb->dev = dev;
1011 netif_rx(skb); 1012 netif_rx(skb);
1012 return NET_RX_SUCCESS; 1013 return NET_RX_SUCCESS;
1013 } else { 1014 } else {
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 249e18053d5f..069f8bb0a99f 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -32,6 +32,7 @@
32#include <linux/x25.h> 32#include <linux/x25.h>
33#include <linux/lapb.h> 33#include <linux/lapb.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/rtnetlink.h>
35#include "x25_asy.h" 36#include "x25_asy.h"
36 37
37#include <net/x25device.h> 38#include <net/x25device.h>
@@ -601,8 +602,10 @@ static void x25_asy_close_tty(struct tty_struct *tty)
601 if (!sl || sl->magic != X25_ASY_MAGIC) 602 if (!sl || sl->magic != X25_ASY_MAGIC)
602 return; 603 return;
603 604
605 rtnl_lock();
604 if (sl->dev->flags & IFF_UP) 606 if (sl->dev->flags & IFF_UP)
605 dev_close(sl->dev); 607 dev_close(sl->dev);
608 rtnl_unlock();
606 609
607 tty->disc_data = NULL; 610 tty->disc_data = NULL;
608 sl->tty = NULL; 611 sl->tty = NULL;
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 438e63ecccf1..d1acef7e0b14 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -560,7 +560,7 @@ static const struct {
560static void build_wpa_mib(struct atmel_private *priv); 560static void build_wpa_mib(struct atmel_private *priv);
561static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 561static int atmel_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
562static void atmel_copy_to_card(struct net_device *dev, u16 dest, 562static void atmel_copy_to_card(struct net_device *dev, u16 dest,
563 unsigned char *src, u16 len); 563 const unsigned char *src, u16 len);
564static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest, 564static void atmel_copy_to_host(struct net_device *dev, unsigned char *dest,
565 u16 src, u16 len); 565 u16 src, u16 len);
566static void atmel_set_gcr(struct net_device *dev, u16 mask); 566static void atmel_set_gcr(struct net_device *dev, u16 mask);
@@ -3853,7 +3853,7 @@ static int reset_atmel_card(struct net_device *dev)
3853 if (priv->card_type == CARD_TYPE_EEPROM) { 3853 if (priv->card_type == CARD_TYPE_EEPROM) {
3854 /* copy in firmware if needed */ 3854 /* copy in firmware if needed */
3855 const struct firmware *fw_entry = NULL; 3855 const struct firmware *fw_entry = NULL;
3856 unsigned char *fw; 3856 const unsigned char *fw;
3857 int len = priv->firmware_length; 3857 int len = priv->firmware_length;
3858 if (!(fw = priv->firmware)) { 3858 if (!(fw = priv->firmware)) {
3859 if (priv->firmware_type == ATMEL_FW_TYPE_NONE) { 3859 if (priv->firmware_type == ATMEL_FW_TYPE_NONE) {
@@ -4120,7 +4120,7 @@ static void atmel_writeAR(struct net_device *dev, u16 data)
4120} 4120}
4121 4121
4122static void atmel_copy_to_card(struct net_device *dev, u16 dest, 4122static void atmel_copy_to_card(struct net_device *dev, u16 dest,
4123 unsigned char *src, u16 len) 4123 const unsigned char *src, u16 len)
4124{ 4124{
4125 int i; 4125 int i;
4126 atmel_writeAR(dev, dest); 4126 atmel_writeAR(dev, dest);
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c
index 36a9c42df835..76f4c7bad8b8 100644
--- a/drivers/net/wireless/b43/leds.c
+++ b/drivers/net/wireless/b43/leds.c
@@ -72,6 +72,9 @@ static void b43_led_brightness_set(struct led_classdev *led_dev,
72 struct b43_wldev *dev = led->dev; 72 struct b43_wldev *dev = led->dev;
73 bool radio_enabled; 73 bool radio_enabled;
74 74
75 if (unlikely(b43_status(dev) < B43_STAT_INITIALIZED))
76 return;
77
75 /* Checking the radio-enabled status here is slightly racy, 78 /* Checking the radio-enabled status here is slightly racy,
76 * but we want to avoid the locking overhead and we don't care 79 * but we want to avoid the locking overhead and we don't care
77 * whether the LED has the wrong state for a second. */ 80 * whether the LED has the wrong state for a second. */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index fa4b0d8b74a2..a70827793086 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2883,12 +2883,11 @@ static int b43_op_tx(struct ieee80211_hw *hw,
2883 2883
2884 if (unlikely(skb->len < 2 + 2 + 6)) { 2884 if (unlikely(skb->len < 2 + 2 + 6)) {
2885 /* Too short, this can't be a valid frame. */ 2885 /* Too short, this can't be a valid frame. */
2886 dev_kfree_skb_any(skb); 2886 goto drop_packet;
2887 return NETDEV_TX_OK;
2888 } 2887 }
2889 B43_WARN_ON(skb_shinfo(skb)->nr_frags); 2888 B43_WARN_ON(skb_shinfo(skb)->nr_frags);
2890 if (unlikely(!dev)) 2889 if (unlikely(!dev))
2891 return NETDEV_TX_BUSY; 2890 goto drop_packet;
2892 2891
2893 /* Transmissions on seperate queues can run concurrently. */ 2892 /* Transmissions on seperate queues can run concurrently. */
2894 read_lock_irqsave(&wl->tx_lock, flags); 2893 read_lock_irqsave(&wl->tx_lock, flags);
@@ -2904,7 +2903,12 @@ static int b43_op_tx(struct ieee80211_hw *hw,
2904 read_unlock_irqrestore(&wl->tx_lock, flags); 2903 read_unlock_irqrestore(&wl->tx_lock, flags);
2905 2904
2906 if (unlikely(err)) 2905 if (unlikely(err))
2907 return NETDEV_TX_BUSY; 2906 goto drop_packet;
2907 return NETDEV_TX_OK;
2908
2909drop_packet:
2910 /* We can not transmit this packet. Drop it. */
2911 dev_kfree_skb_any(skb);
2908 return NETDEV_TX_OK; 2912 return NETDEV_TX_OK;
2909} 2913}
2910 2914
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index c990f87b107a..93ddc1cbcc8b 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -876,6 +876,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
876 if (!ring) 876 if (!ring)
877 goto out; 877 goto out;
878 ring->type = type; 878 ring->type = type;
879 ring->dev = dev;
879 880
880 nr_slots = B43legacy_RXRING_SLOTS; 881 nr_slots = B43legacy_RXRING_SLOTS;
881 if (for_tx) 882 if (for_tx)
@@ -922,7 +923,6 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
922 DMA_TO_DEVICE); 923 DMA_TO_DEVICE);
923 } 924 }
924 925
925 ring->dev = dev;
926 ring->nr_slots = nr_slots; 926 ring->nr_slots = nr_slots;
927 ring->mmio_base = b43legacy_dmacontroller_base(type, controller_index); 927 ring->mmio_base = b43legacy_dmacontroller_base(type, controller_index);
928 ring->index = controller_index; 928 ring->index = controller_index;
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 204077c13870..3e612d0a13e8 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2378,8 +2378,10 @@ static int b43legacy_op_tx(struct ieee80211_hw *hw,
2378 } else 2378 } else
2379 err = b43legacy_dma_tx(dev, skb, ctl); 2379 err = b43legacy_dma_tx(dev, skb, ctl);
2380out: 2380out:
2381 if (unlikely(err)) 2381 if (unlikely(err)) {
2382 return NETDEV_TX_BUSY; 2382 /* Drop the packet. */
2383 dev_kfree_skb_any(skb);
2384 }
2383 return NETDEV_TX_OK; 2385 return NETDEV_TX_OK;
2384} 2386}
2385 2387
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index 4fd73809602e..020f450e9dba 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -64,7 +64,7 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
64 int hdrlen, phdrlen, head_need, tail_need; 64 int hdrlen, phdrlen, head_need, tail_need;
65 u16 fc; 65 u16 fc;
66 int prism_header, ret; 66 int prism_header, ret;
67 struct ieee80211_hdr_4addr *hdr; 67 struct ieee80211_hdr_4addr *fhdr;
68 68
69 iface = netdev_priv(dev); 69 iface = netdev_priv(dev);
70 local = iface->local; 70 local = iface->local;
@@ -83,8 +83,8 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
83 phdrlen = 0; 83 phdrlen = 0;
84 } 84 }
85 85
86 hdr = (struct ieee80211_hdr_4addr *) skb->data; 86 fhdr = (struct ieee80211_hdr_4addr *) skb->data;
87 fc = le16_to_cpu(hdr->frame_ctl); 87 fc = le16_to_cpu(fhdr->frame_ctl);
88 88
89 if (type == PRISM2_RX_MGMT && (fc & IEEE80211_FCTL_VERS)) { 89 if (type == PRISM2_RX_MGMT && (fc & IEEE80211_FCTL_VERS)) {
90 printk(KERN_DEBUG "%s: dropped management frame with header " 90 printk(KERN_DEBUG "%s: dropped management frame with header "
@@ -551,7 +551,7 @@ hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr,
551 hdr->addr1[2] != 0xff || hdr->addr1[3] != 0xff || 551 hdr->addr1[2] != 0xff || hdr->addr1[3] != 0xff ||
552 hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) { 552 hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) {
553 /* RA (or BSSID) is not ours - drop */ 553 /* RA (or BSSID) is not ours - drop */
554 PDEBUG(DEBUG_EXTRA, "%s: received WDS frame with " 554 PDEBUG(DEBUG_EXTRA2, "%s: received WDS frame with "
555 "not own or broadcast %s=%s\n", 555 "not own or broadcast %s=%s\n",
556 local->dev->name, 556 local->dev->name,
557 fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID", 557 fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID",
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index 0acd9589c48c..ab981afd481d 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -1930,7 +1930,7 @@ static void handle_pspoll(local_info_t *local,
1930 PDEBUG(DEBUG_PS, " PSPOLL and AID[15:14] not set\n"); 1930 PDEBUG(DEBUG_PS, " PSPOLL and AID[15:14] not set\n");
1931 return; 1931 return;
1932 } 1932 }
1933 aid &= ~BIT(15) & ~BIT(14); 1933 aid &= ~(BIT(15) | BIT(14));
1934 if (aid == 0 || aid > MAX_AID_TABLE_SIZE) { 1934 if (aid == 0 || aid > MAX_AID_TABLE_SIZE) {
1935 PDEBUG(DEBUG_PS, " invalid aid=%d\n", aid); 1935 PDEBUG(DEBUG_PS, " invalid aid=%d\n", aid);
1936 return; 1936 return;
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index ed4317a17cbb..3b4e55cf33cd 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -533,10 +533,10 @@ static void prism2_detach(struct pcmcia_device *link)
533do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 533do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
534 534
535#define CFG_CHECK2(fn, retf) \ 535#define CFG_CHECK2(fn, retf) \
536do { int ret = (retf); \ 536do { int _ret = (retf); \
537if (ret != 0) { \ 537if (_ret != 0) { \
538 PDEBUG(DEBUG_EXTRA, "CardServices(" #fn ") returned %d\n", ret); \ 538 PDEBUG(DEBUG_EXTRA, "CardServices(" #fn ") returned %d\n", _ret); \
539 cs_error(link, fn, ret); \ 539 cs_error(link, fn, _ret); \
540 goto next_entry; \ 540 goto next_entry; \
541} \ 541} \
542} while (0) 542} while (0)
@@ -777,8 +777,10 @@ static int hostap_cs_suspend(struct pcmcia_device *link)
777 int dev_open = 0; 777 int dev_open = 0;
778 struct hostap_interface *iface = NULL; 778 struct hostap_interface *iface = NULL;
779 779
780 if (dev) 780 if (!dev)
781 iface = netdev_priv(dev); 781 return -ENODEV;
782
783 iface = netdev_priv(dev);
782 784
783 PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info); 785 PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info);
784 if (iface && iface->local) 786 if (iface && iface->local)
@@ -798,8 +800,10 @@ static int hostap_cs_resume(struct pcmcia_device *link)
798 int dev_open = 0; 800 int dev_open = 0;
799 struct hostap_interface *iface = NULL; 801 struct hostap_interface *iface = NULL;
800 802
801 if (dev) 803 if (!dev)
802 iface = netdev_priv(dev); 804 return -ENODEV;
805
806 iface = netdev_priv(dev);
803 807
804 PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info); 808 PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info);
805 809
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index cdf90c40f11b..936f52e3d95c 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -2835,7 +2835,7 @@ static void hostap_passive_scan(unsigned long data)
2835{ 2835{
2836 local_info_t *local = (local_info_t *) data; 2836 local_info_t *local = (local_info_t *) data;
2837 struct net_device *dev = local->dev; 2837 struct net_device *dev = local->dev;
2838 u16 channel; 2838 u16 chan;
2839 2839
2840 if (local->passive_scan_interval <= 0) 2840 if (local->passive_scan_interval <= 0)
2841 return; 2841 return;
@@ -2872,11 +2872,11 @@ static void hostap_passive_scan(unsigned long data)
2872 2872
2873 printk(KERN_DEBUG "%s: passive scan channel %d\n", 2873 printk(KERN_DEBUG "%s: passive scan channel %d\n",
2874 dev->name, local->passive_scan_channel); 2874 dev->name, local->passive_scan_channel);
2875 channel = local->passive_scan_channel; 2875 chan = local->passive_scan_channel;
2876 local->passive_scan_state = PASSIVE_SCAN_WAIT; 2876 local->passive_scan_state = PASSIVE_SCAN_WAIT;
2877 local->passive_scan_timer.expires = jiffies + HZ / 10; 2877 local->passive_scan_timer.expires = jiffies + HZ / 10;
2878 } else { 2878 } else {
2879 channel = local->channel; 2879 chan = local->channel;
2880 local->passive_scan_state = PASSIVE_SCAN_LISTEN; 2880 local->passive_scan_state = PASSIVE_SCAN_LISTEN;
2881 local->passive_scan_timer.expires = jiffies + 2881 local->passive_scan_timer.expires = jiffies +
2882 local->passive_scan_interval * HZ; 2882 local->passive_scan_interval * HZ;
@@ -2884,9 +2884,9 @@ static void hostap_passive_scan(unsigned long data)
2884 2884
2885 if (hfa384x_cmd_callback(dev, HFA384X_CMDCODE_TEST | 2885 if (hfa384x_cmd_callback(dev, HFA384X_CMDCODE_TEST |
2886 (HFA384X_TEST_CHANGE_CHANNEL << 8), 2886 (HFA384X_TEST_CHANGE_CHANNEL << 8),
2887 channel, NULL, 0)) 2887 chan, NULL, 0))
2888 printk(KERN_ERR "%s: passive scan channel set %d " 2888 printk(KERN_ERR "%s: passive scan channel set %d "
2889 "failed\n", dev->name, channel); 2889 "failed\n", dev->name, chan);
2890 2890
2891 add_timer(&local->passive_scan_timer); 2891 add_timer(&local->passive_scan_timer);
2892} 2892}
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index f7aec9309d04..a38e85f334df 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -594,7 +594,8 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
594} 594}
595 595
596 596
597int hostap_80211_header_parse(const struct sk_buff *skb, unsigned char *haddr) 597static int hostap_80211_header_parse(const struct sk_buff *skb,
598 unsigned char *haddr)
598{ 599{
599 struct hostap_interface *iface = netdev_priv(skb->dev); 600 struct hostap_interface *iface = netdev_priv(skb->dev);
600 local_info_t *local = iface->local; 601 local_info_t *local = iface->local;
@@ -857,7 +858,6 @@ const struct header_ops hostap_80211_ops = {
857 .rebuild = eth_rebuild_header, 858 .rebuild = eth_rebuild_header,
858 .cache = eth_header_cache, 859 .cache = eth_header_cache,
859 .cache_update = eth_header_cache_update, 860 .cache_update = eth_header_cache_update,
860
861 .parse = hostap_80211_header_parse, 861 .parse = hostap_80211_header_parse,
862}; 862};
863EXPORT_SYMBOL(hostap_80211_ops); 863EXPORT_SYMBOL(hostap_80211_ops);
@@ -1150,7 +1150,6 @@ EXPORT_SYMBOL(hostap_set_roaming);
1150EXPORT_SYMBOL(hostap_set_auth_algs); 1150EXPORT_SYMBOL(hostap_set_auth_algs);
1151EXPORT_SYMBOL(hostap_dump_rx_header); 1151EXPORT_SYMBOL(hostap_dump_rx_header);
1152EXPORT_SYMBOL(hostap_dump_tx_header); 1152EXPORT_SYMBOL(hostap_dump_tx_header);
1153EXPORT_SYMBOL(hostap_80211_header_parse);
1154EXPORT_SYMBOL(hostap_80211_get_hdrlen); 1153EXPORT_SYMBOL(hostap_80211_get_hdrlen);
1155EXPORT_SYMBOL(hostap_get_stats); 1154EXPORT_SYMBOL(hostap_get_stats);
1156EXPORT_SYMBOL(hostap_setup_dev); 1155EXPORT_SYMBOL(hostap_setup_dev);
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 62a3d8f8563e..55ac850744b3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -449,7 +449,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
449 449
450 if (print_summary) { 450 if (print_summary) {
451 char *title; 451 char *title;
452 u32 rate; 452 int rate;
453 453
454 if (hundred) 454 if (hundred)
455 title = "100Frames"; 455 title = "100Frames";
@@ -487,7 +487,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
487 * but you can hack it to show more, if you'd like to. */ 487 * but you can hack it to show more, if you'd like to. */
488 if (dataframe) 488 if (dataframe)
489 IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, " 489 IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, "
490 "len=%u, rssi=%d, chnl=%d, rate=%u, \n", 490 "len=%u, rssi=%d, chnl=%d, rate=%d, \n",
491 title, fc, header->addr1[5], 491 title, fc, header->addr1[5],
492 length, rssi, channel, rate); 492 length, rssi, channel, rate);
493 else { 493 else {
@@ -588,8 +588,12 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
588 588
589 if (rate == -1) 589 if (rate == -1)
590 iwl3945_rt->rt_rate = 0; 590 iwl3945_rt->rt_rate = 0;
591 else 591 else {
592 if (stats->band == IEEE80211_BAND_5GHZ)
593 rate += IWL_FIRST_OFDM_RATE;
594
592 iwl3945_rt->rt_rate = iwl3945_rates[rate].ieee; 595 iwl3945_rt->rt_rate = iwl3945_rates[rate].ieee;
596 }
593 597
594 /* antenna number */ 598 /* antenna number */
595 antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK; 599 antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index bf19eb8aafd0..de330ae0ca95 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -3528,8 +3528,12 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv,
3528 3528
3529 if (rate == -1) 3529 if (rate == -1)
3530 iwl4965_rt->rt_rate = 0; 3530 iwl4965_rt->rt_rate = 0;
3531 else 3531 else {
3532 if (stats->band == IEEE80211_BAND_5GHZ)
3533 rate += IWL_FIRST_OFDM_RATE;
3534
3532 iwl4965_rt->rt_rate = iwl4965_rates[rate].ieee; 3535 iwl4965_rt->rt_rate = iwl4965_rates[rate].ieee;
3536 }
3533 3537
3534 /* 3538 /*
3535 * "antenna number" 3539 * "antenna number"
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 13925b627e3b..6027e1119c3f 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2227,7 +2227,10 @@ static int iwl3945_scan_initiate(struct iwl3945_priv *priv)
2227 } 2227 }
2228 2228
2229 IWL_DEBUG_INFO("Starting scan...\n"); 2229 IWL_DEBUG_INFO("Starting scan...\n");
2230 priv->scan_bands = 2; 2230 if (priv->cfg->sku & IWL_SKU_G)
2231 priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ);
2232 if (priv->cfg->sku & IWL_SKU_A)
2233 priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ);
2231 set_bit(STATUS_SCANNING, &priv->status); 2234 set_bit(STATUS_SCANNING, &priv->status);
2232 priv->scan_start = jiffies; 2235 priv->scan_start = jiffies;
2233 priv->scan_pass_start = priv->scan_start; 2236 priv->scan_pass_start = priv->scan_start;
@@ -3352,13 +3355,18 @@ static void iwl3945_rx_scan_complete_notif(struct iwl3945_priv *priv,
3352 cancel_delayed_work(&priv->scan_check); 3355 cancel_delayed_work(&priv->scan_check);
3353 3356
3354 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n", 3357 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n",
3355 (priv->scan_bands == 2) ? "2.4" : "5.2", 3358 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
3359 "2.4" : "5.2",
3356 jiffies_to_msecs(elapsed_jiffies 3360 jiffies_to_msecs(elapsed_jiffies
3357 (priv->scan_pass_start, jiffies))); 3361 (priv->scan_pass_start, jiffies)));
3358 3362
3359 /* Remove this scanned band from the list 3363 /* Remove this scanned band from the list of pending
3360 * of pending bands to scan */ 3364 * bands to scan, band G precedes A in order of scanning
3361 priv->scan_bands--; 3365 * as seen in iwl3945_bg_request_scan */
3366 if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ))
3367 priv->scan_bands &= ~BIT(IEEE80211_BAND_2GHZ);
3368 else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ))
3369 priv->scan_bands &= ~BIT(IEEE80211_BAND_5GHZ);
3362 3370
3363 /* If a request to abort was given, or the scan did not succeed 3371 /* If a request to abort was given, or the scan did not succeed
3364 * then we reset the scan state machine and terminate, 3372 * then we reset the scan state machine and terminate,
@@ -4972,7 +4980,7 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv,
4972 4980
4973 ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel); 4981 ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel);
4974 if (!is_channel_valid(ch_info)) { 4982 if (!is_channel_valid(ch_info)) {
4975 IWL_DEBUG_SCAN("Channel %d is INVALID for this SKU.\n", 4983 IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n",
4976 scan_ch->channel); 4984 scan_ch->channel);
4977 continue; 4985 continue;
4978 } 4986 }
@@ -6315,21 +6323,16 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6315 6323
6316 /* flags + rate selection */ 6324 /* flags + rate selection */
6317 6325
6318 switch (priv->scan_bands) { 6326 if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) {
6319 case 2:
6320 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK; 6327 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
6321 scan->tx_cmd.rate = IWL_RATE_1M_PLCP; 6328 scan->tx_cmd.rate = IWL_RATE_1M_PLCP;
6322 scan->good_CRC_th = 0; 6329 scan->good_CRC_th = 0;
6323 band = IEEE80211_BAND_2GHZ; 6330 band = IEEE80211_BAND_2GHZ;
6324 break; 6331 } else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ)) {
6325
6326 case 1:
6327 scan->tx_cmd.rate = IWL_RATE_6M_PLCP; 6332 scan->tx_cmd.rate = IWL_RATE_6M_PLCP;
6328 scan->good_CRC_th = IWL_GOOD_CRC_TH; 6333 scan->good_CRC_th = IWL_GOOD_CRC_TH;
6329 band = IEEE80211_BAND_5GHZ; 6334 band = IEEE80211_BAND_5GHZ;
6330 break; 6335 } else {
6331
6332 default:
6333 IWL_WARNING("Invalid scan band count\n"); 6336 IWL_WARNING("Invalid scan band count\n");
6334 goto done; 6337 goto done;
6335 } 6338 }
@@ -6684,7 +6687,8 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
6684 6687
6685 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { 6688 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
6686 IWL_DEBUG_MAC80211("leave - monitor\n"); 6689 IWL_DEBUG_MAC80211("leave - monitor\n");
6687 return -1; 6690 dev_kfree_skb_any(skb);
6691 return 0;
6688 } 6692 }
6689 6693
6690 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 6694 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
@@ -6770,7 +6774,7 @@ static int iwl3945_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
6770 ch_info = iwl3945_get_channel_info(priv, conf->channel->band, 6774 ch_info = iwl3945_get_channel_info(priv, conf->channel->band,
6771 conf->channel->hw_value); 6775 conf->channel->hw_value);
6772 if (!is_channel_valid(ch_info)) { 6776 if (!is_channel_valid(ch_info)) {
6773 IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this SKU.\n", 6777 IWL_DEBUG_SCAN("Channel %d [%d] is INVALID for this band.\n",
6774 conf->channel->hw_value, conf->channel->band); 6778 conf->channel->hw_value, conf->channel->band);
6775 IWL_DEBUG_MAC80211("leave - invalid channel\n"); 6779 IWL_DEBUG_MAC80211("leave - invalid channel\n");
6776 spin_unlock_irqrestore(&priv->lock, flags); 6780 spin_unlock_irqrestore(&priv->lock, flags);
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 883b42f7e998..0bd55bb19739 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1774,7 +1774,10 @@ static int iwl4965_scan_initiate(struct iwl_priv *priv)
1774 } 1774 }
1775 1775
1776 IWL_DEBUG_INFO("Starting scan...\n"); 1776 IWL_DEBUG_INFO("Starting scan...\n");
1777 priv->scan_bands = 2; 1777 if (priv->cfg->sku & IWL_SKU_G)
1778 priv->scan_bands |= BIT(IEEE80211_BAND_2GHZ);
1779 if (priv->cfg->sku & IWL_SKU_A)
1780 priv->scan_bands |= BIT(IEEE80211_BAND_5GHZ);
1778 set_bit(STATUS_SCANNING, &priv->status); 1781 set_bit(STATUS_SCANNING, &priv->status);
1779 priv->scan_start = jiffies; 1782 priv->scan_start = jiffies;
1780 priv->scan_pass_start = priv->scan_start; 1783 priv->scan_pass_start = priv->scan_start;
@@ -3023,8 +3026,9 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
3023 3026
3024 IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index); 3027 IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index);
3025 if (index != -1) { 3028 if (index != -1) {
3026 int freed = iwl4965_tx_queue_reclaim(priv, txq_id, index);
3027#ifdef CONFIG_IWL4965_HT 3029#ifdef CONFIG_IWL4965_HT
3030 int freed = iwl4965_tx_queue_reclaim(priv, txq_id, index);
3031
3028 if (tid != MAX_TID_COUNT) 3032 if (tid != MAX_TID_COUNT)
3029 priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; 3033 priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
3030 if (iwl4965_queue_space(&txq->q) > txq->q.low_mark && 3034 if (iwl4965_queue_space(&txq->q) > txq->q.low_mark &&
@@ -3276,13 +3280,18 @@ static void iwl4965_rx_scan_complete_notif(struct iwl_priv *priv,
3276 cancel_delayed_work(&priv->scan_check); 3280 cancel_delayed_work(&priv->scan_check);
3277 3281
3278 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n", 3282 IWL_DEBUG_INFO("Scan pass on %sGHz took %dms\n",
3279 (priv->scan_bands == 2) ? "2.4" : "5.2", 3283 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
3284 "2.4" : "5.2",
3280 jiffies_to_msecs(elapsed_jiffies 3285 jiffies_to_msecs(elapsed_jiffies
3281 (priv->scan_pass_start, jiffies))); 3286 (priv->scan_pass_start, jiffies)));
3282 3287
3283 /* Remove this scanned band from the list 3288 /* Remove this scanned band from the list of pending
3284 * of pending bands to scan */ 3289 * bands to scan, band G precedes A in order of scanning
3285 priv->scan_bands--; 3290 * as seen in iwl_bg_request_scan */
3291 if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ))
3292 priv->scan_bands &= ~BIT(IEEE80211_BAND_2GHZ);
3293 else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ))
3294 priv->scan_bands &= ~BIT(IEEE80211_BAND_5GHZ);
3286 3295
3287 /* If a request to abort was given, or the scan did not succeed 3296 /* If a request to abort was given, or the scan did not succeed
3288 * then we reset the scan state machine and terminate, 3297 * then we reset the scan state machine and terminate,
@@ -3292,7 +3301,7 @@ static void iwl4965_rx_scan_complete_notif(struct iwl_priv *priv,
3292 clear_bit(STATUS_SCAN_ABORTING, &priv->status); 3301 clear_bit(STATUS_SCAN_ABORTING, &priv->status);
3293 } else { 3302 } else {
3294 /* If there are more bands on this scan pass reschedule */ 3303 /* If there are more bands on this scan pass reschedule */
3295 if (priv->scan_bands > 0) 3304 if (priv->scan_bands)
3296 goto reschedule; 3305 goto reschedule;
3297 } 3306 }
3298 3307
@@ -4635,10 +4644,9 @@ static int iwl4965_get_channels_for_scan(struct iwl_priv *priv,
4635 4644
4636 scan_ch->channel = ieee80211_frequency_to_channel(channels[i].center_freq); 4645 scan_ch->channel = ieee80211_frequency_to_channel(channels[i].center_freq);
4637 4646
4638 ch_info = iwl_get_channel_info(priv, band, 4647 ch_info = iwl_get_channel_info(priv, band, scan_ch->channel);
4639 scan_ch->channel);
4640 if (!is_channel_valid(ch_info)) { 4648 if (!is_channel_valid(ch_info)) {
4641 IWL_DEBUG_SCAN("Channel %d is INVALID for this SKU.\n", 4649 IWL_DEBUG_SCAN("Channel %d is INVALID for this band.\n",
4642 scan_ch->channel); 4650 scan_ch->channel);
4643 continue; 4651 continue;
4644 } 4652 }
@@ -5830,8 +5838,7 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
5830 scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; 5838 scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
5831 5839
5832 5840
5833 switch (priv->scan_bands) { 5841 if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) {
5834 case 2:
5835 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK; 5842 scan->flags = RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK;
5836 scan->tx_cmd.rate_n_flags = 5843 scan->tx_cmd.rate_n_flags =
5837 iwl4965_hw_set_rate_n_flags(IWL_RATE_1M_PLCP, 5844 iwl4965_hw_set_rate_n_flags(IWL_RATE_1M_PLCP,
@@ -5839,17 +5846,13 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
5839 5846
5840 scan->good_CRC_th = 0; 5847 scan->good_CRC_th = 0;
5841 band = IEEE80211_BAND_2GHZ; 5848 band = IEEE80211_BAND_2GHZ;
5842 break; 5849 } else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ)) {
5843
5844 case 1:
5845 scan->tx_cmd.rate_n_flags = 5850 scan->tx_cmd.rate_n_flags =
5846 iwl4965_hw_set_rate_n_flags(IWL_RATE_6M_PLCP, 5851 iwl4965_hw_set_rate_n_flags(IWL_RATE_6M_PLCP,
5847 RATE_MCS_ANT_B_MSK); 5852 RATE_MCS_ANT_B_MSK);
5848 scan->good_CRC_th = IWL_GOOD_CRC_TH; 5853 scan->good_CRC_th = IWL_GOOD_CRC_TH;
5849 band = IEEE80211_BAND_5GHZ; 5854 band = IEEE80211_BAND_5GHZ;
5850 break; 5855 } else {
5851
5852 default:
5853 IWL_WARNING("Invalid scan band count\n"); 5856 IWL_WARNING("Invalid scan band count\n");
5854 goto done; 5857 goto done;
5855 } 5858 }
@@ -6234,7 +6237,8 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
6234 6237
6235 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { 6238 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
6236 IWL_DEBUG_MAC80211("leave - monitor\n"); 6239 IWL_DEBUG_MAC80211("leave - monitor\n");
6237 return -1; 6240 dev_kfree_skb_any(skb);
6241 return 0;
6238 } 6242 }
6239 6243
6240 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 6244 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 54280e292ea5..d075b448da94 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -122,7 +122,7 @@ static inline void if_cs_write16(struct if_cs_card *card, uint reg, u16 val)
122static inline void if_cs_write16_rep( 122static inline void if_cs_write16_rep(
123 struct if_cs_card *card, 123 struct if_cs_card *card,
124 uint reg, 124 uint reg,
125 void *buf, 125 const void *buf,
126 unsigned long count) 126 unsigned long count)
127{ 127{
128 if (debug_output) 128 if (debug_output)
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 51f664bbee9d..b54e2ea8346b 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/drivers/net/wireless/libertas/if_sdio.c 2 * linux/drivers/net/wireless/libertas/if_sdio.c
3 * 3 *
4 * Copyright 2007 Pierre Ossman 4 * Copyright 2007-2008 Pierre Ossman
5 * 5 *
6 * Inspired by if_cs.c, Copyright 2007 Holger Schurig 6 * Inspired by if_cs.c, Copyright 2007 Holger Schurig
7 * 7 *
@@ -266,13 +266,10 @@ static int if_sdio_card_to_host(struct if_sdio_card *card)
266 266
267 /* 267 /*
268 * The transfer must be in one transaction or the firmware 268 * The transfer must be in one transaction or the firmware
269 * goes suicidal. 269 * goes suicidal. There's no way to guarantee that for all
270 * controllers, but we can at least try.
270 */ 271 */
271 chunk = size; 272 chunk = sdio_align_size(card->func, size);
272 if ((chunk > card->func->cur_blksize) || (chunk > 512)) {
273 chunk = (chunk + card->func->cur_blksize - 1) /
274 card->func->cur_blksize * card->func->cur_blksize;
275 }
276 273
277 ret = sdio_readsb(card->func, card->buffer, card->ioport, chunk); 274 ret = sdio_readsb(card->func, card->buffer, card->ioport, chunk);
278 if (ret) 275 if (ret)
@@ -392,7 +389,7 @@ static int if_sdio_prog_helper(struct if_sdio_card *card)
392 unsigned long timeout; 389 unsigned long timeout;
393 u8 *chunk_buffer; 390 u8 *chunk_buffer;
394 u32 chunk_size; 391 u32 chunk_size;
395 u8 *firmware; 392 const u8 *firmware;
396 size_t size; 393 size_t size;
397 394
398 lbs_deb_enter(LBS_DEB_SDIO); 395 lbs_deb_enter(LBS_DEB_SDIO);
@@ -508,7 +505,7 @@ static int if_sdio_prog_real(struct if_sdio_card *card)
508 unsigned long timeout; 505 unsigned long timeout;
509 u8 *chunk_buffer; 506 u8 *chunk_buffer;
510 u32 chunk_size; 507 u32 chunk_size;
511 u8 *firmware; 508 const u8 *firmware;
512 size_t size, req_size; 509 size_t size, req_size;
513 510
514 lbs_deb_enter(LBS_DEB_SDIO); 511 lbs_deb_enter(LBS_DEB_SDIO);
@@ -696,13 +693,10 @@ static int if_sdio_host_to_card(struct lbs_private *priv,
696 693
697 /* 694 /*
698 * The transfer must be in one transaction or the firmware 695 * The transfer must be in one transaction or the firmware
699 * goes suicidal. 696 * goes suicidal. There's no way to guarantee that for all
697 * controllers, but we can at least try.
700 */ 698 */
701 size = nb + 4; 699 size = sdio_align_size(card->func, nb + 4);
702 if ((size > card->func->cur_blksize) || (size > 512)) {
703 size = (size + card->func->cur_blksize - 1) /
704 card->func->cur_blksize * card->func->cur_blksize;
705 }
706 700
707 packet = kzalloc(sizeof(struct if_sdio_packet) + size, 701 packet = kzalloc(sizeof(struct if_sdio_packet) + size,
708 GFP_ATOMIC); 702 GFP_ATOMIC);
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 8032df72aaab..4dcd4092e0f0 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -293,7 +293,7 @@ static void if_usb_disconnect(struct usb_interface *intf)
293static int if_usb_send_fw_pkt(struct if_usb_card *cardp) 293static int if_usb_send_fw_pkt(struct if_usb_card *cardp)
294{ 294{
295 struct fwdata *fwdata = cardp->ep_out_buf; 295 struct fwdata *fwdata = cardp->ep_out_buf;
296 uint8_t *firmware = cardp->fw->data; 296 const uint8_t *firmware = cardp->fw->data;
297 297
298 /* If we got a CRC failure on the last block, back 298 /* If we got a CRC failure on the last block, back
299 up and retry it */ 299 up and retry it */
@@ -746,7 +746,7 @@ static int if_usb_issue_boot_command(struct if_usb_card *cardp, int ivalue)
746 * len image length 746 * len image length
747 * @return 0 or -1 747 * @return 0 or -1
748 */ 748 */
749static int check_fwfile_format(uint8_t *data, uint32_t totlen) 749static int check_fwfile_format(const uint8_t *data, uint32_t totlen)
750{ 750{
751 uint32_t bincmd, exit; 751 uint32_t bincmd, exit;
752 uint32_t blksize, offset, len; 752 uint32_t blksize, offset, len;
@@ -925,6 +925,7 @@ static struct usb_driver if_usb_driver = {
925 .id_table = if_usb_table, 925 .id_table = if_usb_table,
926 .suspend = if_usb_suspend, 926 .suspend = if_usb_suspend,
927 .resume = if_usb_resume, 927 .resume = if_usb_resume,
928 .reset_resume = if_usb_resume,
928}; 929};
929 930
930static int __init if_usb_init_module(void) 931static int __init if_usb_init_module(void)
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index d448c9702a0f..387d4878af2f 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -567,11 +567,11 @@ static int lbs_process_bss(struct bss_descriptor *bss,
567 pos += 8; 567 pos += 8;
568 568
569 /* beacon interval is 2 bytes long */ 569 /* beacon interval is 2 bytes long */
570 bss->beaconperiod = le16_to_cpup((void *) pos); 570 bss->beaconperiod = get_unaligned_le16(pos);
571 pos += 2; 571 pos += 2;
572 572
573 /* capability information is 2 bytes long */ 573 /* capability information is 2 bytes long */
574 bss->capability = le16_to_cpup((void *) pos); 574 bss->capability = get_unaligned_le16(pos);
575 lbs_deb_scan("process_bss: capabilities 0x%04x\n", bss->capability); 575 lbs_deb_scan("process_bss: capabilities 0x%04x\n", bss->capability);
576 pos += 2; 576 pos += 2;
577 577
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 1610a7308c1d..815c095ef797 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -376,7 +376,8 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
376 const struct firmware *fw_entry = NULL; 376 const struct firmware *fw_entry = NULL;
377 int err, alen; 377 int err, alen;
378 u8 carry = 0; 378 u8 carry = 0;
379 u8 *buf, *tmp, *data; 379 u8 *buf, *tmp;
380 const u8 *data;
380 unsigned int left, remains, block_size; 381 unsigned int left, remains, block_size;
381 struct x2_header *hdr; 382 struct x2_header *hdr;
382 unsigned long timeout; 383 unsigned long timeout;
@@ -523,7 +524,7 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev)
523 void *buf; 524 void *buf;
524 __le32 reg; 525 __le32 reg;
525 unsigned int remains, offset; 526 unsigned int remains, offset;
526 u8 *data; 527 const u8 *data;
527 528
528 buf = kmalloc(512, GFP_KERNEL); 529 buf = kmalloc(512, GFP_KERNEL);
529 if (!buf) { 530 if (!buf) {
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index 762e85bef55d..e43bae97ed8f 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -290,7 +290,7 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
290 290
291 avs->version = cpu_to_be32(P80211CAPTURE_VERSION); 291 avs->version = cpu_to_be32(P80211CAPTURE_VERSION);
292 avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header)); 292 avs->length = cpu_to_be32(sizeof (struct avs_80211_1_header));
293 avs->mactime = cpu_to_be64(le64_to_cpu(clock)); 293 avs->mactime = cpu_to_be64(clock);
294 avs->hosttime = cpu_to_be64(jiffies); 294 avs->hosttime = cpu_to_be64(jiffies);
295 avs->phytype = cpu_to_be32(6); /*OFDM: 6 for (g), 8 for (a) */ 295 avs->phytype = cpu_to_be32(6); /*OFDM: 6 for (g), 8 for (a) */
296 avs->channel = cpu_to_be32(channel_of_freq(freq)); 296 avs->channel = cpu_to_be32(channel_of_freq(freq));
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 560b9c73c0b9..b36ed1c6c746 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -731,6 +731,17 @@ static int rt2400pci_init_registers(struct rt2x00_dev *rt2x00dev)
731 (rt2x00dev->rx->data_size / 128)); 731 (rt2x00dev->rx->data_size / 128));
732 rt2x00pci_register_write(rt2x00dev, CSR9, reg); 732 rt2x00pci_register_write(rt2x00dev, CSR9, reg);
733 733
734 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
735 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 0);
736 rt2x00_set_field32(&reg, CSR14_TSF_SYNC, 0);
737 rt2x00_set_field32(&reg, CSR14_TBCN, 0);
738 rt2x00_set_field32(&reg, CSR14_TCFP, 0);
739 rt2x00_set_field32(&reg, CSR14_TATIMW, 0);
740 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
741 rt2x00_set_field32(&reg, CSR14_CFP_COUNT_PRELOAD, 0);
742 rt2x00_set_field32(&reg, CSR14_TBCM_PRELOAD, 0);
743 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
744
734 rt2x00pci_register_write(rt2x00dev, CNT3, 0x3f080000); 745 rt2x00pci_register_write(rt2x00dev, CNT3, 0x3f080000);
735 746
736 rt2x00pci_register_read(rt2x00dev, ARCSR0, &reg); 747 rt2x00pci_register_read(rt2x00dev, ARCSR0, &reg);
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index a5ed54b69262..f7731fb82555 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -824,6 +824,17 @@ static int rt2500pci_init_registers(struct rt2x00_dev *rt2x00dev)
824 rt2x00_set_field32(&reg, CSR11_CW_SELECT, 0); 824 rt2x00_set_field32(&reg, CSR11_CW_SELECT, 0);
825 rt2x00pci_register_write(rt2x00dev, CSR11, reg); 825 rt2x00pci_register_write(rt2x00dev, CSR11, reg);
826 826
827 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
828 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 0);
829 rt2x00_set_field32(&reg, CSR14_TSF_SYNC, 0);
830 rt2x00_set_field32(&reg, CSR14_TBCN, 0);
831 rt2x00_set_field32(&reg, CSR14_TCFP, 0);
832 rt2x00_set_field32(&reg, CSR14_TATIMW, 0);
833 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 0);
834 rt2x00_set_field32(&reg, CSR14_CFP_COUNT_PRELOAD, 0);
835 rt2x00_set_field32(&reg, CSR14_TBCM_PRELOAD, 0);
836 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
837
827 rt2x00pci_register_write(rt2x00dev, CNT3, 0); 838 rt2x00pci_register_write(rt2x00dev, CNT3, 0);
828 839
829 rt2x00pci_register_read(rt2x00dev, TXCSR8, &reg); 840 rt2x00pci_register_read(rt2x00dev, TXCSR8, &reg);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index fdbd0ef2be4b..d90512f97b39 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -138,11 +138,8 @@ static void rt2500usb_bbp_write(struct rt2x00_dev *rt2x00dev,
138 * Wait until the BBP becomes ready. 138 * Wait until the BBP becomes ready.
139 */ 139 */
140 reg = rt2500usb_bbp_check(rt2x00dev); 140 reg = rt2500usb_bbp_check(rt2x00dev);
141 if (rt2x00_get_field16(reg, PHY_CSR8_BUSY)) { 141 if (rt2x00_get_field16(reg, PHY_CSR8_BUSY))
142 ERROR(rt2x00dev, "PHY_CSR8 register busy. Write failed.\n"); 142 goto exit_fail;
143 mutex_unlock(&rt2x00dev->usb_cache_mutex);
144 return;
145 }
146 143
147 /* 144 /*
148 * Write the data into the BBP. 145 * Write the data into the BBP.
@@ -155,6 +152,13 @@ static void rt2500usb_bbp_write(struct rt2x00_dev *rt2x00dev,
155 rt2500usb_register_write_lock(rt2x00dev, PHY_CSR7, reg); 152 rt2500usb_register_write_lock(rt2x00dev, PHY_CSR7, reg);
156 153
157 mutex_unlock(&rt2x00dev->usb_cache_mutex); 154 mutex_unlock(&rt2x00dev->usb_cache_mutex);
155
156 return;
157
158exit_fail:
159 mutex_unlock(&rt2x00dev->usb_cache_mutex);
160
161 ERROR(rt2x00dev, "PHY_CSR8 register busy. Write failed.\n");
158} 162}
159 163
160static void rt2500usb_bbp_read(struct rt2x00_dev *rt2x00dev, 164static void rt2500usb_bbp_read(struct rt2x00_dev *rt2x00dev,
@@ -168,10 +172,8 @@ static void rt2500usb_bbp_read(struct rt2x00_dev *rt2x00dev,
168 * Wait until the BBP becomes ready. 172 * Wait until the BBP becomes ready.
169 */ 173 */
170 reg = rt2500usb_bbp_check(rt2x00dev); 174 reg = rt2500usb_bbp_check(rt2x00dev);
171 if (rt2x00_get_field16(reg, PHY_CSR8_BUSY)) { 175 if (rt2x00_get_field16(reg, PHY_CSR8_BUSY))
172 ERROR(rt2x00dev, "PHY_CSR8 register busy. Read failed.\n"); 176 goto exit_fail;
173 return;
174 }
175 177
176 /* 178 /*
177 * Write the request into the BBP. 179 * Write the request into the BBP.
@@ -186,17 +188,21 @@ static void rt2500usb_bbp_read(struct rt2x00_dev *rt2x00dev,
186 * Wait until the BBP becomes ready. 188 * Wait until the BBP becomes ready.
187 */ 189 */
188 reg = rt2500usb_bbp_check(rt2x00dev); 190 reg = rt2500usb_bbp_check(rt2x00dev);
189 if (rt2x00_get_field16(reg, PHY_CSR8_BUSY)) { 191 if (rt2x00_get_field16(reg, PHY_CSR8_BUSY))
190 ERROR(rt2x00dev, "PHY_CSR8 register busy. Read failed.\n"); 192 goto exit_fail;
191 *value = 0xff;
192 mutex_unlock(&rt2x00dev->usb_cache_mutex);
193 return;
194 }
195 193
196 rt2500usb_register_read_lock(rt2x00dev, PHY_CSR7, &reg); 194 rt2500usb_register_read_lock(rt2x00dev, PHY_CSR7, &reg);
197 *value = rt2x00_get_field16(reg, PHY_CSR7_DATA); 195 *value = rt2x00_get_field16(reg, PHY_CSR7_DATA);
198 196
199 mutex_unlock(&rt2x00dev->usb_cache_mutex); 197 mutex_unlock(&rt2x00dev->usb_cache_mutex);
198
199 return;
200
201exit_fail:
202 mutex_unlock(&rt2x00dev->usb_cache_mutex);
203
204 ERROR(rt2x00dev, "PHY_CSR8 register busy. Read failed.\n");
205 *value = 0xff;
200} 206}
201 207
202static void rt2500usb_rf_write(struct rt2x00_dev *rt2x00dev, 208static void rt2500usb_rf_write(struct rt2x00_dev *rt2x00dev,
@@ -795,6 +801,13 @@ static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev)
795 rt2x00_set_field16(&reg, TXRX_CSR8_BBP_ID1_VALID, 0); 801 rt2x00_set_field16(&reg, TXRX_CSR8_BBP_ID1_VALID, 0);
796 rt2500usb_register_write(rt2x00dev, TXRX_CSR8, reg); 802 rt2500usb_register_write(rt2x00dev, TXRX_CSR8, reg);
797 803
804 rt2500usb_register_read(rt2x00dev, TXRX_CSR19, &reg);
805 rt2x00_set_field16(&reg, TXRX_CSR19_TSF_COUNT, 0);
806 rt2x00_set_field16(&reg, TXRX_CSR19_TSF_SYNC, 0);
807 rt2x00_set_field16(&reg, TXRX_CSR19_TBCN, 0);
808 rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 0);
809 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
810
798 rt2500usb_register_write(rt2x00dev, TXRX_CSR21, 0xe78f); 811 rt2500usb_register_write(rt2x00dev, TXRX_CSR21, 0xe78f);
799 rt2500usb_register_write(rt2x00dev, MAC_CSR9, 0xff1d); 812 rt2500usb_register_write(rt2x00dev, MAC_CSR9, 0xff1d);
800 813
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 611d98320593..a74e1a5c56fd 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -511,8 +511,8 @@ struct rt2x00lib_ops {
511 */ 511 */
512 int (*probe_hw) (struct rt2x00_dev *rt2x00dev); 512 int (*probe_hw) (struct rt2x00_dev *rt2x00dev);
513 char *(*get_firmware_name) (struct rt2x00_dev *rt2x00dev); 513 char *(*get_firmware_name) (struct rt2x00_dev *rt2x00dev);
514 u16 (*get_firmware_crc) (void *data, const size_t len); 514 u16 (*get_firmware_crc) (const void *data, const size_t len);
515 int (*load_firmware) (struct rt2x00_dev *rt2x00dev, void *data, 515 int (*load_firmware) (struct rt2x00_dev *rt2x00dev, const void *data,
516 const size_t len); 516 const size_t len);
517 517
518 /* 518 /*
@@ -821,6 +821,7 @@ struct rt2x00_dev {
821 /* 821 /*
822 * Scheduled work. 822 * Scheduled work.
823 */ 823 */
824 struct workqueue_struct *workqueue;
824 struct work_struct intf_work; 825 struct work_struct intf_work;
825 struct work_struct filter_work; 826 struct work_struct filter_work;
826 827
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 2673d568bcac..c997d4f28ab3 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -75,7 +75,7 @@ static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
75 75
76 rt2x00lib_reset_link_tuner(rt2x00dev); 76 rt2x00lib_reset_link_tuner(rt2x00dev);
77 77
78 queue_delayed_work(rt2x00dev->hw->workqueue, 78 queue_delayed_work(rt2x00dev->workqueue,
79 &rt2x00dev->link.work, LINK_TUNE_INTERVAL); 79 &rt2x00dev->link.work, LINK_TUNE_INTERVAL);
80} 80}
81 81
@@ -137,14 +137,6 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
137 return; 137 return;
138 138
139 /* 139 /*
140 * Stop all scheduled work.
141 */
142 if (work_pending(&rt2x00dev->intf_work))
143 cancel_work_sync(&rt2x00dev->intf_work);
144 if (work_pending(&rt2x00dev->filter_work))
145 cancel_work_sync(&rt2x00dev->filter_work);
146
147 /*
148 * Stop the TX queues. 140 * Stop the TX queues.
149 */ 141 */
150 ieee80211_stop_queues(rt2x00dev->hw); 142 ieee80211_stop_queues(rt2x00dev->hw);
@@ -398,8 +390,8 @@ static void rt2x00lib_link_tuner(struct work_struct *work)
398 * Increase tuner counter, and reschedule the next link tuner run. 390 * Increase tuner counter, and reschedule the next link tuner run.
399 */ 391 */
400 rt2x00dev->link.count++; 392 rt2x00dev->link.count++;
401 queue_delayed_work(rt2x00dev->hw->workqueue, &rt2x00dev->link.work, 393 queue_delayed_work(rt2x00dev->workqueue,
402 LINK_TUNE_INTERVAL); 394 &rt2x00dev->link.work, LINK_TUNE_INTERVAL);
403} 395}
404 396
405static void rt2x00lib_packetfilter_scheduled(struct work_struct *work) 397static void rt2x00lib_packetfilter_scheduled(struct work_struct *work)
@@ -433,6 +425,15 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
433 425
434 spin_unlock(&intf->lock); 426 spin_unlock(&intf->lock);
435 427
428 /*
429 * It is possible the radio was disabled while the work had been
430 * scheduled. If that happens we should return here immediately,
431 * note that in the spinlock protected area above the delayed_flags
432 * have been cleared correctly.
433 */
434 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
435 return;
436
436 if (delayed_flags & DELAYED_UPDATE_BEACON) { 437 if (delayed_flags & DELAYED_UPDATE_BEACON) {
437 skb = ieee80211_beacon_get(rt2x00dev->hw, vif, &control); 438 skb = ieee80211_beacon_get(rt2x00dev->hw, vif, &control);
438 if (skb && rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, 439 if (skb && rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw,
@@ -441,7 +442,7 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
441 } 442 }
442 443
443 if (delayed_flags & DELAYED_CONFIG_ERP) 444 if (delayed_flags & DELAYED_CONFIG_ERP)
444 rt2x00lib_config_erp(rt2x00dev, intf, &intf->conf); 445 rt2x00lib_config_erp(rt2x00dev, intf, &conf);
445 446
446 if (delayed_flags & DELAYED_LED_ASSOC) 447 if (delayed_flags & DELAYED_LED_ASSOC)
447 rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated); 448 rt2x00leds_led_assoc(rt2x00dev, !!rt2x00dev->intf_associated);
@@ -487,7 +488,7 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
487 rt2x00lib_beacondone_iter, 488 rt2x00lib_beacondone_iter,
488 rt2x00dev); 489 rt2x00dev);
489 490
490 queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work); 491 queue_work(rt2x00dev->workqueue, &rt2x00dev->intf_work);
491} 492}
492EXPORT_SYMBOL_GPL(rt2x00lib_beacondone); 493EXPORT_SYMBOL_GPL(rt2x00lib_beacondone);
493 494
@@ -1130,6 +1131,10 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
1130 /* 1131 /*
1131 * Initialize configuration work. 1132 * Initialize configuration work.
1132 */ 1133 */
1134 rt2x00dev->workqueue = create_singlethread_workqueue("rt2x00lib");
1135 if (!rt2x00dev->workqueue)
1136 goto exit;
1137
1133 INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); 1138 INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled);
1134 INIT_WORK(&rt2x00dev->filter_work, rt2x00lib_packetfilter_scheduled); 1139 INIT_WORK(&rt2x00dev->filter_work, rt2x00lib_packetfilter_scheduled);
1135 INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00lib_link_tuner); 1140 INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00lib_link_tuner);
@@ -1190,6 +1195,13 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
1190 rt2x00leds_unregister(rt2x00dev); 1195 rt2x00leds_unregister(rt2x00dev);
1191 1196
1192 /* 1197 /*
1198 * Stop all queued work. Note that most tasks will already be halted
1199 * during rt2x00lib_disable_radio() and rt2x00lib_uninitialize().
1200 */
1201 flush_workqueue(rt2x00dev->workqueue);
1202 destroy_workqueue(rt2x00dev->workqueue);
1203
1204 /*
1193 * Free ieee80211_hw memory. 1205 * Free ieee80211_hw memory.
1194 */ 1206 */
1195 rt2x00lib_remove_hw(rt2x00dev); 1207 rt2x00lib_remove_hw(rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 87e280a21971..9cb023edd2e9 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -428,7 +428,7 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
428 if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags)) 428 if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags))
429 rt2x00dev->ops->lib->config_filter(rt2x00dev, *total_flags); 429 rt2x00dev->ops->lib->config_filter(rt2x00dev, *total_flags);
430 else 430 else
431 queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->filter_work); 431 queue_work(rt2x00dev->workqueue, &rt2x00dev->filter_work);
432} 432}
433EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter); 433EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter);
434 434
@@ -509,7 +509,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
509 memcpy(&intf->conf, bss_conf, sizeof(*bss_conf)); 509 memcpy(&intf->conf, bss_conf, sizeof(*bss_conf));
510 if (delayed) { 510 if (delayed) {
511 intf->delayed_flags |= delayed; 511 intf->delayed_flags |= delayed;
512 queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->intf_work); 512 queue_work(rt2x00dev->workqueue, &rt2x00dev->intf_work);
513 } 513 }
514 spin_unlock(&intf->lock); 514 spin_unlock(&intf->lock);
515} 515}
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h
index 9d1cdb99431c..b41967ecbf6d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.h
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.h
@@ -82,7 +82,7 @@ static inline void rt2x00pci_register_write(struct rt2x00_dev *rt2x00dev,
82static inline void 82static inline void
83rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev, 83rt2x00pci_register_multiwrite(struct rt2x00_dev *rt2x00dev,
84 const unsigned long offset, 84 const unsigned long offset,
85 void *value, const u16 length) 85 const void *value, const u16 length)
86{ 86{
87 memcpy_toio(rt2x00dev->csr.base + offset, value, length); 87 memcpy_toio(rt2x00dev->csr.base + offset, value, length);
88} 88}
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 14bc7b281659..580f90b63de7 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -915,7 +915,7 @@ static char *rt61pci_get_firmware_name(struct rt2x00_dev *rt2x00dev)
915 return fw_name; 915 return fw_name;
916} 916}
917 917
918static u16 rt61pci_get_firmware_crc(void *data, const size_t len) 918static u16 rt61pci_get_firmware_crc(const void *data, const size_t len)
919{ 919{
920 u16 crc; 920 u16 crc;
921 921
@@ -932,7 +932,7 @@ static u16 rt61pci_get_firmware_crc(void *data, const size_t len)
932 return crc; 932 return crc;
933} 933}
934 934
935static int rt61pci_load_firmware(struct rt2x00_dev *rt2x00dev, void *data, 935static int rt61pci_load_firmware(struct rt2x00_dev *rt2x00dev, const void *data,
936 const size_t len) 936 const size_t len)
937{ 937{
938 int i; 938 int i;
@@ -1201,6 +1201,15 @@ static int rt61pci_init_registers(struct rt2x00_dev *rt2x00dev)
1201 rt2x00_set_field32(&reg, TXRX_CSR8_ACK_CTS_54MBS, 42); 1201 rt2x00_set_field32(&reg, TXRX_CSR8_ACK_CTS_54MBS, 42);
1202 rt2x00pci_register_write(rt2x00dev, TXRX_CSR8, reg); 1202 rt2x00pci_register_write(rt2x00dev, TXRX_CSR8, reg);
1203 1203
1204 rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, &reg);
1205 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_INTERVAL, 0);
1206 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 0);
1207 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_SYNC, 0);
1208 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 0);
1209 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
1210 rt2x00_set_field32(&reg, TXRX_CSR9_TIMESTAMP_COMPENSATE, 0);
1211 rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg);
1212
1204 rt2x00pci_register_write(rt2x00dev, TXRX_CSR15, 0x0000000f); 1213 rt2x00pci_register_write(rt2x00dev, TXRX_CSR15, 0x0000000f);
1205 1214
1206 rt2x00pci_register_write(rt2x00dev, MAC_CSR6, 0x00000fff); 1215 rt2x00pci_register_write(rt2x00dev, MAC_CSR6, 0x00000fff);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index fff8386e816b..6a62d6bb96fe 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -134,11 +134,8 @@ static void rt73usb_bbp_write(struct rt2x00_dev *rt2x00dev,
134 * Wait until the BBP becomes ready. 134 * Wait until the BBP becomes ready.
135 */ 135 */
136 reg = rt73usb_bbp_check(rt2x00dev); 136 reg = rt73usb_bbp_check(rt2x00dev);
137 if (rt2x00_get_field32(reg, PHY_CSR3_BUSY)) { 137 if (rt2x00_get_field32(reg, PHY_CSR3_BUSY))
138 ERROR(rt2x00dev, "PHY_CSR3 register busy. Write failed.\n"); 138 goto exit_fail;
139 mutex_unlock(&rt2x00dev->usb_cache_mutex);
140 return;
141 }
142 139
143 /* 140 /*
144 * Write the data into the BBP. 141 * Write the data into the BBP.
@@ -151,6 +148,13 @@ static void rt73usb_bbp_write(struct rt2x00_dev *rt2x00dev,
151 148
152 rt73usb_register_write_lock(rt2x00dev, PHY_CSR3, reg); 149 rt73usb_register_write_lock(rt2x00dev, PHY_CSR3, reg);
153 mutex_unlock(&rt2x00dev->usb_cache_mutex); 150 mutex_unlock(&rt2x00dev->usb_cache_mutex);
151
152 return;
153
154exit_fail:
155 mutex_unlock(&rt2x00dev->usb_cache_mutex);
156
157 ERROR(rt2x00dev, "PHY_CSR3 register busy. Write failed.\n");
154} 158}
155 159
156static void rt73usb_bbp_read(struct rt2x00_dev *rt2x00dev, 160static void rt73usb_bbp_read(struct rt2x00_dev *rt2x00dev,
@@ -164,11 +168,8 @@ static void rt73usb_bbp_read(struct rt2x00_dev *rt2x00dev,
164 * Wait until the BBP becomes ready. 168 * Wait until the BBP becomes ready.
165 */ 169 */
166 reg = rt73usb_bbp_check(rt2x00dev); 170 reg = rt73usb_bbp_check(rt2x00dev);
167 if (rt2x00_get_field32(reg, PHY_CSR3_BUSY)) { 171 if (rt2x00_get_field32(reg, PHY_CSR3_BUSY))
168 ERROR(rt2x00dev, "PHY_CSR3 register busy. Read failed.\n"); 172 goto exit_fail;
169 mutex_unlock(&rt2x00dev->usb_cache_mutex);
170 return;
171 }
172 173
173 /* 174 /*
174 * Write the request into the BBP. 175 * Write the request into the BBP.
@@ -184,14 +185,19 @@ static void rt73usb_bbp_read(struct rt2x00_dev *rt2x00dev,
184 * Wait until the BBP becomes ready. 185 * Wait until the BBP becomes ready.
185 */ 186 */
186 reg = rt73usb_bbp_check(rt2x00dev); 187 reg = rt73usb_bbp_check(rt2x00dev);
187 if (rt2x00_get_field32(reg, PHY_CSR3_BUSY)) { 188 if (rt2x00_get_field32(reg, PHY_CSR3_BUSY))
188 ERROR(rt2x00dev, "PHY_CSR3 register busy. Read failed.\n"); 189 goto exit_fail;
189 *value = 0xff;
190 return;
191 }
192 190
193 *value = rt2x00_get_field32(reg, PHY_CSR3_VALUE); 191 *value = rt2x00_get_field32(reg, PHY_CSR3_VALUE);
194 mutex_unlock(&rt2x00dev->usb_cache_mutex); 192 mutex_unlock(&rt2x00dev->usb_cache_mutex);
193
194 return;
195
196exit_fail:
197 mutex_unlock(&rt2x00dev->usb_cache_mutex);
198
199 ERROR(rt2x00dev, "PHY_CSR3 register busy. Read failed.\n");
200 *value = 0xff;
195} 201}
196 202
197static void rt73usb_rf_write(struct rt2x00_dev *rt2x00dev, 203static void rt73usb_rf_write(struct rt2x00_dev *rt2x00dev,
@@ -850,7 +856,7 @@ static char *rt73usb_get_firmware_name(struct rt2x00_dev *rt2x00dev)
850 return FIRMWARE_RT2571; 856 return FIRMWARE_RT2571;
851} 857}
852 858
853static u16 rt73usb_get_firmware_crc(void *data, const size_t len) 859static u16 rt73usb_get_firmware_crc(const void *data, const size_t len)
854{ 860{
855 u16 crc; 861 u16 crc;
856 862
@@ -867,13 +873,13 @@ static u16 rt73usb_get_firmware_crc(void *data, const size_t len)
867 return crc; 873 return crc;
868} 874}
869 875
870static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, void *data, 876static int rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev, const void *data,
871 const size_t len) 877 const size_t len)
872{ 878{
873 unsigned int i; 879 unsigned int i;
874 int status; 880 int status;
875 u32 reg; 881 u32 reg;
876 char *ptr = data; 882 const char *ptr = data;
877 char *cache; 883 char *cache;
878 int buflen; 884 int buflen;
879 int timeout; 885 int timeout;
@@ -1000,6 +1006,15 @@ static int rt73usb_init_registers(struct rt2x00_dev *rt2x00dev)
1000 rt2x00_set_field32(&reg, TXRX_CSR8_ACK_CTS_54MBS, 42); 1006 rt2x00_set_field32(&reg, TXRX_CSR8_ACK_CTS_54MBS, 42);
1001 rt73usb_register_write(rt2x00dev, TXRX_CSR8, reg); 1007 rt73usb_register_write(rt2x00dev, TXRX_CSR8, reg);
1002 1008
1009 rt73usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
1010 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_INTERVAL, 0);
1011 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 0);
1012 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_SYNC, 0);
1013 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 0);
1014 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
1015 rt2x00_set_field32(&reg, TXRX_CSR9_TIMESTAMP_COMPENSATE, 0);
1016 rt73usb_register_write(rt2x00dev, TXRX_CSR9, reg);
1017
1003 rt73usb_register_write(rt2x00dev, TXRX_CSR15, 0x0000000f); 1018 rt73usb_register_write(rt2x00dev, TXRX_CSR15, 0x0000000f);
1004 1019
1005 rt73usb_register_read(rt2x00dev, MAC_CSR6, &reg); 1020 rt73usb_register_read(rt2x00dev, MAC_CSR6, &reg);
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index d5c0c66188ca..78baa0f7926d 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -49,7 +49,7 @@ MODULE_DEVICE_TABLE(usb, zd1201_table);
49static int zd1201_fw_upload(struct usb_device *dev, int apfw) 49static int zd1201_fw_upload(struct usb_device *dev, int apfw)
50{ 50{
51 const struct firmware *fw_entry; 51 const struct firmware *fw_entry;
52 char *data; 52 const char *data;
53 unsigned long len; 53 unsigned long len;
54 int err; 54 int err;
55 unsigned char ret; 55 unsigned char ret;
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 418606ac1c3b..694e95d35fd4 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -765,6 +765,7 @@ static void zd_op_remove_interface(struct ieee80211_hw *hw,
765{ 765{
766 struct zd_mac *mac = zd_hw_mac(hw); 766 struct zd_mac *mac = zd_hw_mac(hw);
767 mac->type = IEEE80211_IF_TYPE_INVALID; 767 mac->type = IEEE80211_IF_TYPE_INVALID;
768 zd_set_beacon_interval(&mac->chip, 0);
768 zd_write_mac_addr(&mac->chip, NULL); 769 zd_write_mac_addr(&mac->chip, NULL);
769} 770}
770 771
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index 8941f5eb96c2..6cdad9764604 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -64,6 +64,7 @@ static struct usb_device_id usb_ids[] = {
64 { USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B }, 64 { USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B },
65 { USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B }, 65 { USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B },
66 { USB_DEVICE(0x050d, 0x705c), .driver_info = DEVICE_ZD1211B }, 66 { USB_DEVICE(0x050d, 0x705c), .driver_info = DEVICE_ZD1211B },
67 { USB_DEVICE(0x083a, 0xe506), .driver_info = DEVICE_ZD1211B },
67 { USB_DEVICE(0x083a, 0x4505), .driver_info = DEVICE_ZD1211B }, 68 { USB_DEVICE(0x083a, 0x4505), .driver_info = DEVICE_ZD1211B },
68 { USB_DEVICE(0x0471, 0x1236), .driver_info = DEVICE_ZD1211B }, 69 { USB_DEVICE(0x0471, 0x1236), .driver_info = DEVICE_ZD1211B },
69 { USB_DEVICE(0x13b1, 0x0024), .driver_info = DEVICE_ZD1211B }, 70 { USB_DEVICE(0x13b1, 0x0024), .driver_info = DEVICE_ZD1211B },
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index d26f69b0184f..ef671d1a3bf0 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1324,7 +1324,7 @@ static int setup_netfront(struct xenbus_device *dev, struct netfront_info *info)
1324 goto fail; 1324 goto fail;
1325 } 1325 }
1326 1326
1327 txs = (struct xen_netif_tx_sring *)get_zeroed_page(GFP_KERNEL); 1327 txs = (struct xen_netif_tx_sring *)get_zeroed_page(GFP_NOIO | __GFP_HIGH);
1328 if (!txs) { 1328 if (!txs) {
1329 err = -ENOMEM; 1329 err = -ENOMEM;
1330 xenbus_dev_fatal(dev, err, "allocating tx ring page"); 1330 xenbus_dev_fatal(dev, err, "allocating tx ring page");
@@ -1340,7 +1340,7 @@ static int setup_netfront(struct xenbus_device *dev, struct netfront_info *info)
1340 } 1340 }
1341 1341
1342 info->tx_ring_ref = err; 1342 info->tx_ring_ref = err;
1343 rxs = (struct xen_netif_rx_sring *)get_zeroed_page(GFP_KERNEL); 1343 rxs = (struct xen_netif_rx_sring *)get_zeroed_page(GFP_NOIO | __GFP_HIGH);
1344 if (!rxs) { 1344 if (!rxs) {
1345 err = -ENOMEM; 1345 err = -ENOMEM;
1346 xenbus_dev_fatal(dev, err, "allocating rx ring page"); 1346 xenbus_dev_fatal(dev, err, "allocating rx ring page");