diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/block/Kconfig | 16 | ||||
| -rw-r--r-- | drivers/block/cciss.c | 49 | ||||
| -rw-r--r-- | drivers/char/Kconfig | 15 | ||||
| -rw-r--r-- | drivers/char/pcmcia/cm4040_cs.c | 3 | ||||
| -rw-r--r-- | drivers/crypto/geode-aes.c | 3 | ||||
| -rw-r--r-- | drivers/mmc/mmc.c | 83 | ||||
| -rw-r--r-- | drivers/mmc/sdhci.c | 39 | ||||
| -rw-r--r-- | drivers/net/3c59x.c | 8 | ||||
| -rw-r--r-- | drivers/net/bonding/bond_main.c | 86 | ||||
| -rw-r--r-- | drivers/net/mv643xx_eth.c | 53 | ||||
| -rw-r--r-- | drivers/net/natsemi.c | 24 | ||||
| -rw-r--r-- | drivers/net/pcnet32.c | 4 | ||||
| -rw-r--r-- | drivers/net/sis900.c | 10 | ||||
| -rw-r--r-- | drivers/net/tulip/de2104x.c | 6 | ||||
| -rw-r--r-- | drivers/net/tulip/dmfe.c | 204 | ||||
| -rw-r--r-- | drivers/net/ucc_geth.c | 17 | ||||
| -rw-r--r-- | drivers/serial/mcfserial.c | 44 | ||||
| -rw-r--r-- | drivers/usb/input/hid-core.c | 21 | ||||
| -rw-r--r-- | drivers/video/Kconfig | 16 | ||||
| -rw-r--r-- | drivers/video/aty/atyfb.h | 3 | ||||
| -rw-r--r-- | drivers/video/nvidia/nv_backlight.c | 5 |
21 files changed, 406 insertions, 303 deletions
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index cacb1c816e35..17ee97f3a99b 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
| @@ -406,22 +406,6 @@ config BLK_DEV_RAM_BLOCKSIZE | |||
| 406 | setups function - apparently needed by the rd_load_image routine | 406 | setups function - apparently needed by the rd_load_image routine |
| 407 | that supposes the filesystem in the image uses a 1024 blocksize. | 407 | that supposes the filesystem in the image uses a 1024 blocksize. |
| 408 | 408 | ||
| 409 | config BLK_DEV_INITRD | ||
| 410 | bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" | ||
| 411 | depends on BROKEN || !FRV | ||
| 412 | help | ||
| 413 | The initial RAM filesystem is a ramfs which is loaded by the | ||
| 414 | boot loader (loadlin or lilo) and that is mounted as root | ||
| 415 | before the normal boot procedure. It is typically used to | ||
| 416 | load modules needed to mount the "real" root file system, | ||
| 417 | etc. See <file:Documentation/initrd.txt> for details. | ||
| 418 | |||
| 419 | If RAM disk support (BLK_DEV_RAM) is also included, this | ||
| 420 | also enables initial RAM disk (initrd) support and adds | ||
| 421 | 15 Kbytes (more on some other architectures) to the kernel size. | ||
| 422 | |||
| 423 | If unsure say Y. | ||
| 424 | |||
| 425 | config CDROM_PKTCDVD | 409 | config CDROM_PKTCDVD |
| 426 | tristate "Packet writing on CD/DVD media" | 410 | tristate "Packet writing on CD/DVD media" |
| 427 | depends on !UML | 411 | depends on !UML |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 05dfe357527c..0c716ee905d7 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
| @@ -1291,13 +1291,19 @@ static void cciss_update_drive_info(int ctlr, int drv_index) | |||
| 1291 | if (inq_buff == NULL) | 1291 | if (inq_buff == NULL) |
| 1292 | goto mem_msg; | 1292 | goto mem_msg; |
| 1293 | 1293 | ||
| 1294 | /* testing to see if 16-byte CDBs are already being used */ | ||
| 1295 | if (h->cciss_read == CCISS_READ_16) { | ||
| 1296 | cciss_read_capacity_16(h->ctlr, drv_index, 1, | ||
| 1297 | &total_size, &block_size); | ||
| 1298 | goto geo_inq; | ||
| 1299 | } | ||
| 1300 | |||
| 1294 | cciss_read_capacity(ctlr, drv_index, 1, | 1301 | cciss_read_capacity(ctlr, drv_index, 1, |
| 1295 | &total_size, &block_size); | 1302 | &total_size, &block_size); |
| 1296 | 1303 | ||
| 1297 | /* total size = last LBA + 1 */ | 1304 | /* if read_capacity returns all F's this volume is >2TB in size */ |
| 1298 | /* FFFFFFFF + 1 = 0, cannot have a logical volume of size 0 */ | 1305 | /* so we switch to 16-byte CDB's for all read/write ops */ |
| 1299 | /* so we assume this volume this must be >2TB in size */ | 1306 | if (total_size == 0xFFFFFFFFULL) { |
| 1300 | if (total_size == (__u32) 0) { | ||
| 1301 | cciss_read_capacity_16(ctlr, drv_index, 1, | 1307 | cciss_read_capacity_16(ctlr, drv_index, 1, |
| 1302 | &total_size, &block_size); | 1308 | &total_size, &block_size); |
| 1303 | h->cciss_read = CCISS_READ_16; | 1309 | h->cciss_read = CCISS_READ_16; |
| @@ -1306,6 +1312,7 @@ static void cciss_update_drive_info(int ctlr, int drv_index) | |||
| 1306 | h->cciss_read = CCISS_READ_10; | 1312 | h->cciss_read = CCISS_READ_10; |
| 1307 | h->cciss_write = CCISS_WRITE_10; | 1313 | h->cciss_write = CCISS_WRITE_10; |
| 1308 | } | 1314 | } |
| 1315 | geo_inq: | ||
| 1309 | cciss_geometry_inquiry(ctlr, drv_index, 1, total_size, block_size, | 1316 | cciss_geometry_inquiry(ctlr, drv_index, 1, total_size, block_size, |
| 1310 | inq_buff, &h->drv[drv_index]); | 1317 | inq_buff, &h->drv[drv_index]); |
| 1311 | 1318 | ||
| @@ -1917,13 +1924,14 @@ static void cciss_geometry_inquiry(int ctlr, int logvol, | |||
| 1917 | drv->raid_level = inq_buff->data_byte[8]; | 1924 | drv->raid_level = inq_buff->data_byte[8]; |
| 1918 | } | 1925 | } |
| 1919 | drv->block_size = block_size; | 1926 | drv->block_size = block_size; |
| 1920 | drv->nr_blocks = total_size; | 1927 | drv->nr_blocks = total_size + 1; |
| 1921 | t = drv->heads * drv->sectors; | 1928 | t = drv->heads * drv->sectors; |
| 1922 | if (t > 1) { | 1929 | if (t > 1) { |
| 1923 | unsigned rem = sector_div(total_size, t); | 1930 | sector_t real_size = total_size + 1; |
| 1931 | unsigned long rem = sector_div(real_size, t); | ||
| 1924 | if (rem) | 1932 | if (rem) |
| 1925 | total_size++; | 1933 | real_size++; |
| 1926 | drv->cylinders = total_size; | 1934 | drv->cylinders = real_size; |
| 1927 | } | 1935 | } |
| 1928 | } else { /* Get geometry failed */ | 1936 | } else { /* Get geometry failed */ |
| 1929 | printk(KERN_WARNING "cciss: reading geometry failed\n"); | 1937 | printk(KERN_WARNING "cciss: reading geometry failed\n"); |
| @@ -1953,16 +1961,16 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
| 1953 | ctlr, buf, sizeof(ReadCapdata_struct), | 1961 | ctlr, buf, sizeof(ReadCapdata_struct), |
| 1954 | 1, logvol, 0, NULL, TYPE_CMD); | 1962 | 1, logvol, 0, NULL, TYPE_CMD); |
| 1955 | if (return_code == IO_OK) { | 1963 | if (return_code == IO_OK) { |
| 1956 | *total_size = be32_to_cpu(*(__u32 *) buf->total_size)+1; | 1964 | *total_size = be32_to_cpu(*(__u32 *) buf->total_size); |
| 1957 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); | 1965 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); |
| 1958 | } else { /* read capacity command failed */ | 1966 | } else { /* read capacity command failed */ |
| 1959 | printk(KERN_WARNING "cciss: read capacity failed\n"); | 1967 | printk(KERN_WARNING "cciss: read capacity failed\n"); |
| 1960 | *total_size = 0; | 1968 | *total_size = 0; |
| 1961 | *block_size = BLOCK_SIZE; | 1969 | *block_size = BLOCK_SIZE; |
| 1962 | } | 1970 | } |
| 1963 | if (*total_size != (__u32) 0) | 1971 | if (*total_size != 0) |
| 1964 | printk(KERN_INFO " blocks= %llu block_size= %d\n", | 1972 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
| 1965 | (unsigned long long)*total_size, *block_size); | 1973 | (unsigned long long)*total_size+1, *block_size); |
| 1966 | kfree(buf); | 1974 | kfree(buf); |
| 1967 | return; | 1975 | return; |
| 1968 | } | 1976 | } |
| @@ -1989,7 +1997,7 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
| 1989 | 1, logvol, 0, NULL, TYPE_CMD); | 1997 | 1, logvol, 0, NULL, TYPE_CMD); |
| 1990 | } | 1998 | } |
| 1991 | if (return_code == IO_OK) { | 1999 | if (return_code == IO_OK) { |
| 1992 | *total_size = be64_to_cpu(*(__u64 *) buf->total_size)+1; | 2000 | *total_size = be64_to_cpu(*(__u64 *) buf->total_size); |
| 1993 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); | 2001 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); |
| 1994 | } else { /* read capacity command failed */ | 2002 | } else { /* read capacity command failed */ |
| 1995 | printk(KERN_WARNING "cciss: read capacity failed\n"); | 2003 | printk(KERN_WARNING "cciss: read capacity failed\n"); |
| @@ -1997,7 +2005,7 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
| 1997 | *block_size = BLOCK_SIZE; | 2005 | *block_size = BLOCK_SIZE; |
| 1998 | } | 2006 | } |
| 1999 | printk(KERN_INFO " blocks= %llu block_size= %d\n", | 2007 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
| 2000 | (unsigned long long)*total_size, *block_size); | 2008 | (unsigned long long)*total_size+1, *block_size); |
| 2001 | kfree(buf); | 2009 | kfree(buf); |
| 2002 | return; | 2010 | return; |
| 2003 | } | 2011 | } |
| @@ -3119,8 +3127,9 @@ static void cciss_getgeometry(int cntl_num) | |||
| 3119 | } | 3127 | } |
| 3120 | cciss_read_capacity(cntl_num, i, 0, &total_size, &block_size); | 3128 | cciss_read_capacity(cntl_num, i, 0, &total_size, &block_size); |
| 3121 | 3129 | ||
| 3122 | /* total_size = last LBA + 1 */ | 3130 | /* If read_capacity returns all F's the logical is >2TB */ |
| 3123 | if(total_size == (__u32) 0) { | 3131 | /* so we switch to 16-byte CDBs for all read/write ops */ |
| 3132 | if(total_size == 0xFFFFFFFFULL) { | ||
| 3124 | cciss_read_capacity_16(cntl_num, i, 0, | 3133 | cciss_read_capacity_16(cntl_num, i, 0, |
| 3125 | &total_size, &block_size); | 3134 | &total_size, &block_size); |
| 3126 | hba[cntl_num]->cciss_read = CCISS_READ_16; | 3135 | hba[cntl_num]->cciss_read = CCISS_READ_16; |
| @@ -3395,7 +3404,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
| 3395 | return -1; | 3404 | return -1; |
| 3396 | } | 3405 | } |
| 3397 | 3406 | ||
| 3398 | static void __devexit cciss_remove_one(struct pci_dev *pdev) | 3407 | static void cciss_remove_one(struct pci_dev *pdev) |
| 3399 | { | 3408 | { |
| 3400 | ctlr_info_t *tmp_ptr; | 3409 | ctlr_info_t *tmp_ptr; |
| 3401 | int i, j; | 3410 | int i, j; |
| @@ -3419,9 +3428,10 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev) | |||
| 3419 | memset(flush_buf, 0, 4); | 3428 | memset(flush_buf, 0, 4); |
| 3420 | return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL, | 3429 | return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL, |
| 3421 | TYPE_CMD); | 3430 | TYPE_CMD); |
| 3422 | if (return_code != IO_OK) { | 3431 | if (return_code == IO_OK) { |
| 3423 | printk(KERN_WARNING "Error Flushing cache on controller %d\n", | 3432 | printk(KERN_INFO "Completed flushing cache on controller %d\n", i); |
| 3424 | i); | 3433 | } else { |
| 3434 | printk(KERN_WARNING "Error flushing cache on controller %d\n", i); | ||
| 3425 | } | 3435 | } |
| 3426 | free_irq(hba[i]->intr[2], hba[i]); | 3436 | free_irq(hba[i]->intr[2], hba[i]); |
| 3427 | 3437 | ||
| @@ -3472,6 +3482,7 @@ static struct pci_driver cciss_pci_driver = { | |||
| 3472 | .probe = cciss_init_one, | 3482 | .probe = cciss_init_one, |
| 3473 | .remove = __devexit_p(cciss_remove_one), | 3483 | .remove = __devexit_p(cciss_remove_one), |
| 3474 | .id_table = cciss_pci_device_id, /* id_table */ | 3484 | .id_table = cciss_pci_device_id, /* id_table */ |
| 3485 | .shutdown = cciss_remove_one, | ||
| 3475 | }; | 3486 | }; |
| 3476 | 3487 | ||
| 3477 | /* | 3488 | /* |
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index d0a6dc53213c..3429ece4ef92 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
| @@ -1026,16 +1026,17 @@ config MMTIMER | |||
| 1026 | source "drivers/char/tpm/Kconfig" | 1026 | source "drivers/char/tpm/Kconfig" |
| 1027 | 1027 | ||
| 1028 | config TELCLOCK | 1028 | config TELCLOCK |
| 1029 | tristate "Telecom clock driver for MPBL0010 ATCA SBC" | 1029 | tristate "Telecom clock driver for ATCA SBC" |
| 1030 | depends on EXPERIMENTAL && X86 | 1030 | depends on EXPERIMENTAL && X86 |
| 1031 | default n | 1031 | default n |
| 1032 | help | 1032 | help |
| 1033 | The telecom clock device is specific to the MPBL0010 ATCA computer and | 1033 | The telecom clock device is specific to the MPCBL0010 and MPCBL0050 |
| 1034 | allows direct userspace access to the configuration of the telecom clock | 1034 | ATCA computers and allows direct userspace access to the |
| 1035 | configuration settings. This device is used for hardware synchronization | 1035 | configuration of the telecom clock configuration settings. This |
| 1036 | across the ATCA backplane fabric. Upon loading, the driver exports a | 1036 | device is used for hardware synchronization across the ATCA backplane |
| 1037 | sysfs directory, /sys/devices/platform/telco_clock, with a number of | 1037 | fabric. Upon loading, the driver exports a sysfs directory, |
| 1038 | files for controlling the behavior of this hardware. | 1038 | /sys/devices/platform/telco_clock, with a number of files for |
| 1039 | controlling the behavior of this hardware. | ||
| 1039 | 1040 | ||
| 1040 | endmenu | 1041 | endmenu |
| 1041 | 1042 | ||
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 0e82968c2f38..f2e4ec4fd407 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
| @@ -273,6 +273,7 @@ static ssize_t cm4040_read(struct file *filp, char __user *buf, | |||
| 273 | DEBUGP(6, dev, "BytesToRead=%lu\n", bytes_to_read); | 273 | DEBUGP(6, dev, "BytesToRead=%lu\n", bytes_to_read); |
| 274 | 274 | ||
| 275 | min_bytes_to_read = min(count, bytes_to_read + 5); | 275 | min_bytes_to_read = min(count, bytes_to_read + 5); |
| 276 | min_bytes_to_read = min_t(size_t, min_bytes_to_read, READ_WRITE_BUFFER_SIZE); | ||
| 276 | 277 | ||
| 277 | DEBUGP(6, dev, "Min=%lu\n", min_bytes_to_read); | 278 | DEBUGP(6, dev, "Min=%lu\n", min_bytes_to_read); |
| 278 | 279 | ||
| @@ -340,7 +341,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf, | |||
| 340 | return 0; | 341 | return 0; |
| 341 | } | 342 | } |
| 342 | 343 | ||
| 343 | if (count < 5) { | 344 | if ((count < 5) || (count > READ_WRITE_BUFFER_SIZE)) { |
| 344 | DEBUGP(2, dev, "<- cm4040_write buffersize=%Zd < 5\n", count); | 345 | DEBUGP(2, dev, "<- cm4040_write buffersize=%Zd < 5\n", count); |
| 345 | return -EIO; | 346 | return -EIO; |
| 346 | } | 347 | } |
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 0eb62841e9b0..6d3840e629de 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c | |||
| @@ -99,9 +99,8 @@ do_crypt(void *src, void *dst, int len, u32 flags) | |||
| 99 | static unsigned int | 99 | static unsigned int |
| 100 | geode_aes_crypt(struct geode_aes_op *op) | 100 | geode_aes_crypt(struct geode_aes_op *op) |
| 101 | { | 101 | { |
| 102 | |||
| 103 | u32 flags = 0; | 102 | u32 flags = 0; |
| 104 | int iflags; | 103 | unsigned long iflags; |
| 105 | 104 | ||
| 106 | if (op->len == 0 || op->src == op->dst) | 105 | if (op->len == 0 || op->src == op->dst) |
| 107 | return 0; | 106 | return 0; |
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 5046a1661342..4a73e8b2428d 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
| @@ -376,10 +376,11 @@ static inline void mmc_set_ios(struct mmc_host *host) | |||
| 376 | { | 376 | { |
| 377 | struct mmc_ios *ios = &host->ios; | 377 | struct mmc_ios *ios = &host->ios; |
| 378 | 378 | ||
| 379 | pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u width %u\n", | 379 | pr_debug("%s: clock %uHz busmode %u powermode %u cs %u Vdd %u " |
| 380 | "width %u timing %u\n", | ||
| 380 | mmc_hostname(host), ios->clock, ios->bus_mode, | 381 | mmc_hostname(host), ios->clock, ios->bus_mode, |
| 381 | ios->power_mode, ios->chip_select, ios->vdd, | 382 | ios->power_mode, ios->chip_select, ios->vdd, |
| 382 | ios->bus_width); | 383 | ios->bus_width, ios->timing); |
| 383 | 384 | ||
| 384 | host->ops->set_ios(host, ios); | 385 | host->ops->set_ios(host, ios); |
| 385 | } | 386 | } |
| @@ -809,6 +810,7 @@ static void mmc_power_up(struct mmc_host *host) | |||
| 809 | host->ios.chip_select = MMC_CS_DONTCARE; | 810 | host->ios.chip_select = MMC_CS_DONTCARE; |
| 810 | host->ios.power_mode = MMC_POWER_UP; | 811 | host->ios.power_mode = MMC_POWER_UP; |
| 811 | host->ios.bus_width = MMC_BUS_WIDTH_1; | 812 | host->ios.bus_width = MMC_BUS_WIDTH_1; |
| 813 | host->ios.timing = MMC_TIMING_LEGACY; | ||
| 812 | mmc_set_ios(host); | 814 | mmc_set_ios(host); |
| 813 | 815 | ||
| 814 | mmc_delay(1); | 816 | mmc_delay(1); |
| @@ -828,6 +830,7 @@ static void mmc_power_off(struct mmc_host *host) | |||
| 828 | host->ios.chip_select = MMC_CS_DONTCARE; | 830 | host->ios.chip_select = MMC_CS_DONTCARE; |
| 829 | host->ios.power_mode = MMC_POWER_OFF; | 831 | host->ios.power_mode = MMC_POWER_OFF; |
| 830 | host->ios.bus_width = MMC_BUS_WIDTH_1; | 832 | host->ios.bus_width = MMC_BUS_WIDTH_1; |
| 833 | host->ios.timing = MMC_TIMING_LEGACY; | ||
| 831 | mmc_set_ios(host); | 834 | mmc_set_ios(host); |
| 832 | } | 835 | } |
| 833 | 836 | ||
| @@ -1112,46 +1115,50 @@ static void mmc_process_ext_csds(struct mmc_host *host) | |||
| 1112 | continue; | 1115 | continue; |
| 1113 | } | 1116 | } |
| 1114 | 1117 | ||
| 1115 | /* Activate highspeed support. */ | 1118 | if (host->caps & MMC_CAP_MMC_HIGHSPEED) { |
| 1116 | cmd.opcode = MMC_SWITCH; | 1119 | /* Activate highspeed support. */ |
| 1117 | cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) | | 1120 | cmd.opcode = MMC_SWITCH; |
| 1118 | (EXT_CSD_HS_TIMING << 16) | | 1121 | cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) | |
| 1119 | (1 << 8) | | 1122 | (EXT_CSD_HS_TIMING << 16) | |
| 1120 | EXT_CSD_CMD_SET_NORMAL; | 1123 | (1 << 8) | |
| 1121 | cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; | 1124 | EXT_CSD_CMD_SET_NORMAL; |
| 1125 | cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; | ||
| 1122 | 1126 | ||
| 1123 | err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); | 1127 | err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); |
| 1124 | if (err != MMC_ERR_NONE) { | 1128 | if (err != MMC_ERR_NONE) { |
| 1125 | printk("%s: failed to switch card to mmc v4 " | 1129 | printk("%s: failed to switch card to mmc v4 " |
| 1126 | "high-speed mode.\n", | 1130 | "high-speed mode.\n", |
| 1127 | mmc_hostname(card->host)); | 1131 | mmc_hostname(card->host)); |
| 1128 | continue; | 1132 | continue; |
| 1129 | } | 1133 | } |
| 1130 | 1134 | ||
| 1131 | mmc_card_set_highspeed(card); | 1135 | mmc_card_set_highspeed(card); |
| 1132 | 1136 | ||
| 1133 | /* Check for host support for wide-bus modes. */ | 1137 | host->ios.timing = MMC_TIMING_SD_HS; |
| 1134 | if (!(host->caps & MMC_CAP_4_BIT_DATA)) { | 1138 | mmc_set_ios(host); |
| 1135 | continue; | ||
| 1136 | } | 1139 | } |
| 1137 | 1140 | ||
| 1138 | /* Activate 4-bit support. */ | 1141 | /* Check for host support for wide-bus modes. */ |
| 1139 | cmd.opcode = MMC_SWITCH; | 1142 | if (host->caps & MMC_CAP_4_BIT_DATA) { |
| 1140 | cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) | | 1143 | /* Activate 4-bit support. */ |
| 1141 | (EXT_CSD_BUS_WIDTH << 16) | | 1144 | cmd.opcode = MMC_SWITCH; |
| 1142 | (EXT_CSD_BUS_WIDTH_4 << 8) | | 1145 | cmd.arg = (MMC_SWITCH_MODE_WRITE_BYTE << 24) | |
| 1143 | EXT_CSD_CMD_SET_NORMAL; | 1146 | (EXT_CSD_BUS_WIDTH << 16) | |
| 1144 | cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; | 1147 | (EXT_CSD_BUS_WIDTH_4 << 8) | |
| 1148 | EXT_CSD_CMD_SET_NORMAL; | ||
| 1149 | cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; | ||
| 1145 | 1150 | ||
| 1146 | err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); | 1151 | err = mmc_wait_for_cmd(host, &cmd, CMD_RETRIES); |
| 1147 | if (err != MMC_ERR_NONE) { | 1152 | if (err != MMC_ERR_NONE) { |
| 1148 | printk("%s: failed to switch card to " | 1153 | printk("%s: failed to switch card to " |
| 1149 | "mmc v4 4-bit bus mode.\n", | 1154 | "mmc v4 4-bit bus mode.\n", |
| 1150 | mmc_hostname(card->host)); | 1155 | mmc_hostname(card->host)); |
| 1151 | continue; | 1156 | continue; |
| 1152 | } | 1157 | } |
| 1153 | 1158 | ||
| 1154 | host->ios.bus_width = MMC_BUS_WIDTH_4; | 1159 | host->ios.bus_width = MMC_BUS_WIDTH_4; |
| 1160 | mmc_set_ios(host); | ||
| 1161 | } | ||
| 1155 | } | 1162 | } |
| 1156 | 1163 | ||
| 1157 | kfree(ext_csd); | 1164 | kfree(ext_csd); |
| @@ -1241,6 +1248,9 @@ static void mmc_read_switch_caps(struct mmc_host *host) | |||
| 1241 | unsigned char *status; | 1248 | unsigned char *status; |
| 1242 | struct scatterlist sg; | 1249 | struct scatterlist sg; |
| 1243 | 1250 | ||
| 1251 | if (!(host->caps & MMC_CAP_SD_HIGHSPEED)) | ||
| 1252 | return; | ||
| 1253 | |||
| 1244 | status = kmalloc(64, GFP_KERNEL); | 1254 | status = kmalloc(64, GFP_KERNEL); |
| 1245 | if (!status) { | 1255 | if (!status) { |
| 1246 | printk(KERN_WARNING "%s: Unable to allocate buffer for " | 1256 | printk(KERN_WARNING "%s: Unable to allocate buffer for " |
| @@ -1332,6 +1342,9 @@ static void mmc_read_switch_caps(struct mmc_host *host) | |||
| 1332 | } | 1342 | } |
| 1333 | 1343 | ||
| 1334 | mmc_card_set_highspeed(card); | 1344 | mmc_card_set_highspeed(card); |
| 1345 | |||
| 1346 | host->ios.timing = MMC_TIMING_SD_HS; | ||
| 1347 | mmc_set_ios(host); | ||
| 1335 | } | 1348 | } |
| 1336 | 1349 | ||
| 1337 | kfree(status); | 1350 | kfree(status); |
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 7522f76b15ec..d749f08601b8 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c | |||
| @@ -606,7 +606,6 @@ static void sdhci_finish_command(struct sdhci_host *host) | |||
| 606 | static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) | 606 | static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) |
| 607 | { | 607 | { |
| 608 | int div; | 608 | int div; |
| 609 | u8 ctrl; | ||
| 610 | u16 clk; | 609 | u16 clk; |
| 611 | unsigned long timeout; | 610 | unsigned long timeout; |
| 612 | 611 | ||
| @@ -615,13 +614,6 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) | |||
| 615 | 614 | ||
| 616 | writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); | 615 | writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); |
| 617 | 616 | ||
| 618 | ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); | ||
| 619 | if (clock > 25000000) | ||
| 620 | ctrl |= SDHCI_CTRL_HISPD; | ||
| 621 | else | ||
| 622 | ctrl &= ~SDHCI_CTRL_HISPD; | ||
| 623 | writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); | ||
| 624 | |||
| 625 | if (clock == 0) | 617 | if (clock == 0) |
| 626 | goto out; | 618 | goto out; |
| 627 | 619 | ||
| @@ -761,10 +753,17 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
| 761 | sdhci_set_power(host, ios->vdd); | 753 | sdhci_set_power(host, ios->vdd); |
| 762 | 754 | ||
| 763 | ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); | 755 | ctrl = readb(host->ioaddr + SDHCI_HOST_CONTROL); |
| 756 | |||
| 764 | if (ios->bus_width == MMC_BUS_WIDTH_4) | 757 | if (ios->bus_width == MMC_BUS_WIDTH_4) |
| 765 | ctrl |= SDHCI_CTRL_4BITBUS; | 758 | ctrl |= SDHCI_CTRL_4BITBUS; |
| 766 | else | 759 | else |
| 767 | ctrl &= ~SDHCI_CTRL_4BITBUS; | 760 | ctrl &= ~SDHCI_CTRL_4BITBUS; |
| 761 | |||
| 762 | if (ios->timing == MMC_TIMING_SD_HS) | ||
| 763 | ctrl |= SDHCI_CTRL_HISPD; | ||
| 764 | else | ||
| 765 | ctrl &= ~SDHCI_CTRL_HISPD; | ||
| 766 | |||
| 768 | writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); | 767 | writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); |
| 769 | 768 | ||
| 770 | mmiowb(); | 769 | mmiowb(); |
| @@ -994,7 +993,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) | |||
| 994 | 993 | ||
| 995 | intmask = readl(host->ioaddr + SDHCI_INT_STATUS); | 994 | intmask = readl(host->ioaddr + SDHCI_INT_STATUS); |
| 996 | 995 | ||
| 997 | if (!intmask) { | 996 | if (!intmask || intmask == 0xffffffff) { |
| 998 | result = IRQ_NONE; | 997 | result = IRQ_NONE; |
| 999 | goto out; | 998 | goto out; |
| 1000 | } | 999 | } |
| @@ -1080,6 +1079,13 @@ static int sdhci_suspend (struct pci_dev *pdev, pm_message_t state) | |||
| 1080 | 1079 | ||
| 1081 | pci_save_state(pdev); | 1080 | pci_save_state(pdev); |
| 1082 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); | 1081 | pci_enable_wake(pdev, pci_choose_state(pdev, state), 0); |
| 1082 | |||
| 1083 | for (i = 0;i < chip->num_slots;i++) { | ||
| 1084 | if (!chip->hosts[i]) | ||
| 1085 | continue; | ||
| 1086 | free_irq(chip->hosts[i]->irq, chip->hosts[i]); | ||
| 1087 | } | ||
| 1088 | |||
| 1083 | pci_disable_device(pdev); | 1089 | pci_disable_device(pdev); |
| 1084 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 1090 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
| 1085 | 1091 | ||
| @@ -1108,6 +1114,11 @@ static int sdhci_resume (struct pci_dev *pdev) | |||
| 1108 | continue; | 1114 | continue; |
| 1109 | if (chip->hosts[i]->flags & SDHCI_USE_DMA) | 1115 | if (chip->hosts[i]->flags & SDHCI_USE_DMA) |
| 1110 | pci_set_master(pdev); | 1116 | pci_set_master(pdev); |
| 1117 | ret = request_irq(chip->hosts[i]->irq, sdhci_irq, | ||
| 1118 | IRQF_SHARED, chip->hosts[i]->slot_descr, | ||
| 1119 | chip->hosts[i]); | ||
| 1120 | if (ret) | ||
| 1121 | return ret; | ||
| 1111 | sdhci_init(chip->hosts[i]); | 1122 | sdhci_init(chip->hosts[i]); |
| 1112 | mmiowb(); | 1123 | mmiowb(); |
| 1113 | ret = mmc_resume_host(chip->hosts[i]->mmc); | 1124 | ret = mmc_resume_host(chip->hosts[i]->mmc); |
| @@ -1274,6 +1285,9 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
| 1274 | mmc->f_max = host->max_clk; | 1285 | mmc->f_max = host->max_clk; |
| 1275 | mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK; | 1286 | mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK; |
| 1276 | 1287 | ||
| 1288 | if (caps & SDHCI_CAN_DO_HISPD) | ||
| 1289 | mmc->caps |= MMC_CAP_SD_HIGHSPEED; | ||
| 1290 | |||
| 1277 | mmc->ocr_avail = 0; | 1291 | mmc->ocr_avail = 0; |
| 1278 | if (caps & SDHCI_CAN_VDD_330) | 1292 | if (caps & SDHCI_CAN_VDD_330) |
| 1279 | mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34; | 1293 | mmc->ocr_avail |= MMC_VDD_32_33|MMC_VDD_33_34; |
| @@ -1282,13 +1296,6 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
| 1282 | if (caps & SDHCI_CAN_VDD_180) | 1296 | if (caps & SDHCI_CAN_VDD_180) |
| 1283 | mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19; | 1297 | mmc->ocr_avail |= MMC_VDD_17_18|MMC_VDD_18_19; |
| 1284 | 1298 | ||
| 1285 | if ((host->max_clk > 25000000) && !(caps & SDHCI_CAN_DO_HISPD)) { | ||
| 1286 | printk(KERN_ERR "%s: Controller reports > 25 MHz base clock," | ||
| 1287 | " but no high speed support.\n", | ||
| 1288 | host->slot_descr); | ||
| 1289 | mmc->f_max = 25000000; | ||
| 1290 | } | ||
| 1291 | |||
| 1292 | if (mmc->ocr_avail == 0) { | 1299 | if (mmc->ocr_avail == 0) { |
| 1293 | printk(KERN_ERR "%s: Hardware doesn't report any " | 1300 | printk(KERN_ERR "%s: Hardware doesn't report any " |
| 1294 | "support voltages.\n", host->slot_descr); | 1301 | "support voltages.\n", host->slot_descr); |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 716a47210aa3..72995777f809 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
| @@ -822,11 +822,17 @@ static int vortex_resume(struct pci_dev *pdev) | |||
| 822 | { | 822 | { |
| 823 | struct net_device *dev = pci_get_drvdata(pdev); | 823 | struct net_device *dev = pci_get_drvdata(pdev); |
| 824 | struct vortex_private *vp = netdev_priv(dev); | 824 | struct vortex_private *vp = netdev_priv(dev); |
| 825 | int err; | ||
| 825 | 826 | ||
| 826 | if (dev && vp) { | 827 | if (dev && vp) { |
| 827 | pci_set_power_state(pdev, PCI_D0); | 828 | pci_set_power_state(pdev, PCI_D0); |
| 828 | pci_restore_state(pdev); | 829 | pci_restore_state(pdev); |
| 829 | pci_enable_device(pdev); | 830 | err = pci_enable_device(pdev); |
| 831 | if (err) { | ||
| 832 | printk(KERN_WARNING "%s: Could not enable device \n", | ||
| 833 | dev->name); | ||
| 834 | return err; | ||
| 835 | } | ||
| 830 | pci_set_master(pdev); | 836 | pci_set_master(pdev); |
| 831 | if (request_irq(dev->irq, vp->full_bus_master_rx ? | 837 | if (request_irq(dev->irq, vp->full_bus_master_rx ? |
| 832 | &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev)) { | 838 | &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev)) { |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index ea73ebff4387..e4724d874e7c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | #include <linux/errno.h> | 60 | #include <linux/errno.h> |
| 61 | #include <linux/netdevice.h> | 61 | #include <linux/netdevice.h> |
| 62 | #include <linux/inetdevice.h> | 62 | #include <linux/inetdevice.h> |
| 63 | #include <linux/igmp.h> | ||
| 63 | #include <linux/etherdevice.h> | 64 | #include <linux/etherdevice.h> |
| 64 | #include <linux/skbuff.h> | 65 | #include <linux/skbuff.h> |
| 65 | #include <net/sock.h> | 66 | #include <net/sock.h> |
| @@ -861,6 +862,28 @@ static void bond_mc_delete(struct bonding *bond, void *addr, int alen) | |||
| 861 | } | 862 | } |
| 862 | } | 863 | } |
| 863 | 864 | ||
| 865 | |||
| 866 | /* | ||
| 867 | * Retrieve the list of registered multicast addresses for the bonding | ||
| 868 | * device and retransmit an IGMP JOIN request to the current active | ||
| 869 | * slave. | ||
| 870 | */ | ||
| 871 | static void bond_resend_igmp_join_requests(struct bonding *bond) | ||
| 872 | { | ||
| 873 | struct in_device *in_dev; | ||
| 874 | struct ip_mc_list *im; | ||
| 875 | |||
| 876 | rcu_read_lock(); | ||
| 877 | in_dev = __in_dev_get_rcu(bond->dev); | ||
| 878 | if (in_dev) { | ||
| 879 | for (im = in_dev->mc_list; im; im = im->next) { | ||
| 880 | ip_mc_rejoin_group(im); | ||
| 881 | } | ||
| 882 | } | ||
| 883 | |||
| 884 | rcu_read_unlock(); | ||
| 885 | } | ||
| 886 | |||
| 864 | /* | 887 | /* |
| 865 | * Totally destroys the mc_list in bond | 888 | * Totally destroys the mc_list in bond |
| 866 | */ | 889 | */ |
| @@ -874,6 +897,7 @@ static void bond_mc_list_destroy(struct bonding *bond) | |||
| 874 | kfree(dmi); | 897 | kfree(dmi); |
| 875 | dmi = bond->mc_list; | 898 | dmi = bond->mc_list; |
| 876 | } | 899 | } |
| 900 | bond->mc_list = NULL; | ||
| 877 | } | 901 | } |
| 878 | 902 | ||
| 879 | /* | 903 | /* |
| @@ -967,6 +991,7 @@ static void bond_mc_swap(struct bonding *bond, struct slave *new_active, struct | |||
| 967 | for (dmi = bond->dev->mc_list; dmi; dmi = dmi->next) { | 991 | for (dmi = bond->dev->mc_list; dmi; dmi = dmi->next) { |
| 968 | dev_mc_add(new_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); | 992 | dev_mc_add(new_active->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); |
| 969 | } | 993 | } |
| 994 | bond_resend_igmp_join_requests(bond); | ||
| 970 | } | 995 | } |
| 971 | } | 996 | } |
| 972 | 997 | ||
| @@ -3423,15 +3448,21 @@ void bond_register_arp(struct bonding *bond) | |||
| 3423 | { | 3448 | { |
| 3424 | struct packet_type *pt = &bond->arp_mon_pt; | 3449 | struct packet_type *pt = &bond->arp_mon_pt; |
| 3425 | 3450 | ||
| 3451 | if (pt->type) | ||
| 3452 | return; | ||
| 3453 | |||
| 3426 | pt->type = htons(ETH_P_ARP); | 3454 | pt->type = htons(ETH_P_ARP); |
| 3427 | pt->dev = NULL; /*bond->dev;XXX*/ | 3455 | pt->dev = bond->dev; |
| 3428 | pt->func = bond_arp_rcv; | 3456 | pt->func = bond_arp_rcv; |
| 3429 | dev_add_pack(pt); | 3457 | dev_add_pack(pt); |
| 3430 | } | 3458 | } |
| 3431 | 3459 | ||
| 3432 | void bond_unregister_arp(struct bonding *bond) | 3460 | void bond_unregister_arp(struct bonding *bond) |
| 3433 | { | 3461 | { |
| 3434 | dev_remove_pack(&bond->arp_mon_pt); | 3462 | struct packet_type *pt = &bond->arp_mon_pt; |
| 3463 | |||
| 3464 | dev_remove_pack(pt); | ||
| 3465 | pt->type = 0; | ||
| 3435 | } | 3466 | } |
| 3436 | 3467 | ||
| 3437 | /*---------------------------- Hashing Policies -----------------------------*/ | 3468 | /*---------------------------- Hashing Policies -----------------------------*/ |
| @@ -4011,42 +4042,6 @@ out: | |||
| 4011 | return 0; | 4042 | return 0; |
| 4012 | } | 4043 | } |
| 4013 | 4044 | ||
| 4014 | static void bond_activebackup_xmit_copy(struct sk_buff *skb, | ||
| 4015 | struct bonding *bond, | ||
| 4016 | struct slave *slave) | ||
| 4017 | { | ||
| 4018 | struct sk_buff *skb2 = skb_copy(skb, GFP_ATOMIC); | ||
| 4019 | struct ethhdr *eth_data; | ||
| 4020 | u8 *hwaddr; | ||
| 4021 | int res; | ||
| 4022 | |||
| 4023 | if (!skb2) { | ||
| 4024 | printk(KERN_ERR DRV_NAME ": Error: " | ||
| 4025 | "bond_activebackup_xmit_copy(): skb_copy() failed\n"); | ||
| 4026 | return; | ||
| 4027 | } | ||
| 4028 | |||
| 4029 | skb2->mac.raw = (unsigned char *)skb2->data; | ||
| 4030 | eth_data = eth_hdr(skb2); | ||
| 4031 | |||
| 4032 | /* Pick an appropriate source MAC address | ||
| 4033 | * -- use slave's perm MAC addr, unless used by bond | ||
| 4034 | * -- otherwise, borrow active slave's perm MAC addr | ||
| 4035 | * since that will not be used | ||
| 4036 | */ | ||
| 4037 | hwaddr = slave->perm_hwaddr; | ||
| 4038 | if (!memcmp(eth_data->h_source, hwaddr, ETH_ALEN)) | ||
| 4039 | hwaddr = bond->curr_active_slave->perm_hwaddr; | ||
| 4040 | |||
| 4041 | /* Set source MAC address appropriately */ | ||
| 4042 | memcpy(eth_data->h_source, hwaddr, ETH_ALEN); | ||
| 4043 | |||
| 4044 | res = bond_dev_queue_xmit(bond, skb2, slave->dev); | ||
| 4045 | if (res) | ||
| 4046 | dev_kfree_skb(skb2); | ||
| 4047 | |||
| 4048 | return; | ||
| 4049 | } | ||
| 4050 | 4045 | ||
| 4051 | /* | 4046 | /* |
| 4052 | * in active-backup mode, we know that bond->curr_active_slave is always valid if | 4047 | * in active-backup mode, we know that bond->curr_active_slave is always valid if |
| @@ -4067,21 +4062,6 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d | |||
| 4067 | if (!bond->curr_active_slave) | 4062 | if (!bond->curr_active_slave) |
| 4068 | goto out; | 4063 | goto out; |
| 4069 | 4064 | ||
| 4070 | /* Xmit IGMP frames on all slaves to ensure rapid fail-over | ||
| 4071 | for multicast traffic on snooping switches */ | ||
| 4072 | if (skb->protocol == __constant_htons(ETH_P_IP) && | ||
| 4073 | skb->nh.iph->protocol == IPPROTO_IGMP) { | ||
| 4074 | struct slave *slave, *active_slave; | ||
| 4075 | int i; | ||
| 4076 | |||
| 4077 | active_slave = bond->curr_active_slave; | ||
| 4078 | bond_for_each_slave_from_to(bond, slave, i, active_slave->next, | ||
| 4079 | active_slave->prev) | ||
| 4080 | if (IS_UP(slave->dev) && | ||
| 4081 | (slave->link == BOND_LINK_UP)) | ||
| 4082 | bond_activebackup_xmit_copy(skb, bond, slave); | ||
| 4083 | } | ||
| 4084 | |||
| 4085 | res = bond_dev_queue_xmit(bond, skb, bond->curr_active_slave->dev); | 4065 | res = bond_dev_queue_xmit(bond, skb, bond->curr_active_slave->dev); |
| 4086 | 4066 | ||
| 4087 | out: | 4067 | out: |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index be2ddbb6ef56..9ba21e0f27c5 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
| @@ -1309,7 +1309,7 @@ static void mv643xx_init_ethtool_cmd(struct net_device *dev, int phy_address, | |||
| 1309 | static int mv643xx_eth_probe(struct platform_device *pdev) | 1309 | static int mv643xx_eth_probe(struct platform_device *pdev) |
| 1310 | { | 1310 | { |
| 1311 | struct mv643xx_eth_platform_data *pd; | 1311 | struct mv643xx_eth_platform_data *pd; |
| 1312 | int port_num = pdev->id; | 1312 | int port_num; |
| 1313 | struct mv643xx_private *mp; | 1313 | struct mv643xx_private *mp; |
| 1314 | struct net_device *dev; | 1314 | struct net_device *dev; |
| 1315 | u8 *p; | 1315 | u8 *p; |
| @@ -1319,6 +1319,12 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
| 1319 | int duplex = DUPLEX_HALF; | 1319 | int duplex = DUPLEX_HALF; |
| 1320 | int speed = 0; /* default to auto-negotiation */ | 1320 | int speed = 0; /* default to auto-negotiation */ |
| 1321 | 1321 | ||
| 1322 | pd = pdev->dev.platform_data; | ||
| 1323 | if (pd == NULL) { | ||
| 1324 | printk(KERN_ERR "No mv643xx_eth_platform_data\n"); | ||
| 1325 | return -ENODEV; | ||
| 1326 | } | ||
| 1327 | |||
| 1322 | dev = alloc_etherdev(sizeof(struct mv643xx_private)); | 1328 | dev = alloc_etherdev(sizeof(struct mv643xx_private)); |
| 1323 | if (!dev) | 1329 | if (!dev) |
| 1324 | return -ENOMEM; | 1330 | return -ENOMEM; |
| @@ -1331,8 +1337,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
| 1331 | BUG_ON(!res); | 1337 | BUG_ON(!res); |
| 1332 | dev->irq = res->start; | 1338 | dev->irq = res->start; |
| 1333 | 1339 | ||
| 1334 | mp->port_num = port_num; | ||
| 1335 | |||
| 1336 | dev->open = mv643xx_eth_open; | 1340 | dev->open = mv643xx_eth_open; |
| 1337 | dev->stop = mv643xx_eth_stop; | 1341 | dev->stop = mv643xx_eth_stop; |
| 1338 | dev->hard_start_xmit = mv643xx_eth_start_xmit; | 1342 | dev->hard_start_xmit = mv643xx_eth_start_xmit; |
| @@ -1373,39 +1377,40 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
| 1373 | 1377 | ||
| 1374 | spin_lock_init(&mp->lock); | 1378 | spin_lock_init(&mp->lock); |
| 1375 | 1379 | ||
| 1380 | port_num = pd->port_number; | ||
| 1381 | |||
| 1376 | /* set default config values */ | 1382 | /* set default config values */ |
| 1377 | eth_port_uc_addr_get(dev, dev->dev_addr); | 1383 | eth_port_uc_addr_get(dev, dev->dev_addr); |
| 1378 | mp->rx_ring_size = MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE; | 1384 | mp->rx_ring_size = MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE; |
| 1379 | mp->tx_ring_size = MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE; | 1385 | mp->tx_ring_size = MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE; |
| 1380 | 1386 | ||
| 1381 | pd = pdev->dev.platform_data; | 1387 | if (is_valid_ether_addr(pd->mac_addr)) |
| 1382 | if (pd) { | 1388 | memcpy(dev->dev_addr, pd->mac_addr, 6); |
| 1383 | if (is_valid_ether_addr(pd->mac_addr)) | ||
| 1384 | memcpy(dev->dev_addr, pd->mac_addr, 6); | ||
| 1385 | 1389 | ||
| 1386 | if (pd->phy_addr || pd->force_phy_addr) | 1390 | if (pd->phy_addr || pd->force_phy_addr) |
| 1387 | ethernet_phy_set(port_num, pd->phy_addr); | 1391 | ethernet_phy_set(port_num, pd->phy_addr); |
| 1388 | 1392 | ||
| 1389 | if (pd->rx_queue_size) | 1393 | if (pd->rx_queue_size) |
| 1390 | mp->rx_ring_size = pd->rx_queue_size; | 1394 | mp->rx_ring_size = pd->rx_queue_size; |
| 1391 | 1395 | ||
| 1392 | if (pd->tx_queue_size) | 1396 | if (pd->tx_queue_size) |
| 1393 | mp->tx_ring_size = pd->tx_queue_size; | 1397 | mp->tx_ring_size = pd->tx_queue_size; |
| 1394 | 1398 | ||
| 1395 | if (pd->tx_sram_size) { | 1399 | if (pd->tx_sram_size) { |
| 1396 | mp->tx_sram_size = pd->tx_sram_size; | 1400 | mp->tx_sram_size = pd->tx_sram_size; |
| 1397 | mp->tx_sram_addr = pd->tx_sram_addr; | 1401 | mp->tx_sram_addr = pd->tx_sram_addr; |
| 1398 | } | 1402 | } |
| 1399 | |||
| 1400 | if (pd->rx_sram_size) { | ||
| 1401 | mp->rx_sram_size = pd->rx_sram_size; | ||
| 1402 | mp->rx_sram_addr = pd->rx_sram_addr; | ||
| 1403 | } | ||
| 1404 | 1403 | ||
| 1405 | duplex = pd->duplex; | 1404 | if (pd->rx_sram_size) { |
| 1406 | speed = pd->speed; | 1405 | mp->rx_sram_size = pd->rx_sram_size; |
| 1406 | mp->rx_sram_addr = pd->rx_sram_addr; | ||
| 1407 | } | 1407 | } |
| 1408 | 1408 | ||
| 1409 | duplex = pd->duplex; | ||
| 1410 | speed = pd->speed; | ||
| 1411 | |||
| 1412 | mp->port_num = port_num; | ||
| 1413 | |||
| 1409 | /* Hook up MII support for ethtool */ | 1414 | /* Hook up MII support for ethtool */ |
| 1410 | mp->mii.dev = dev; | 1415 | mp->mii.dev = dev; |
| 1411 | mp->mii.mdio_read = mv643xx_mdio_read; | 1416 | mp->mii.mdio_read = mv643xx_mdio_read; |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 5c57433cb306..c6172a77a6d7 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
| @@ -2024,6 +2024,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) | |||
| 2024 | struct netdev_private *np = netdev_priv(dev); | 2024 | struct netdev_private *np = netdev_priv(dev); |
| 2025 | void __iomem * ioaddr = ns_ioaddr(dev); | 2025 | void __iomem * ioaddr = ns_ioaddr(dev); |
| 2026 | unsigned entry; | 2026 | unsigned entry; |
| 2027 | unsigned long flags; | ||
| 2027 | 2028 | ||
| 2028 | /* Note: Ordering is important here, set the field with the | 2029 | /* Note: Ordering is important here, set the field with the |
| 2029 | "ownership" bit last, and only then increment cur_tx. */ | 2030 | "ownership" bit last, and only then increment cur_tx. */ |
| @@ -2037,7 +2038,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) | |||
| 2037 | 2038 | ||
| 2038 | np->tx_ring[entry].addr = cpu_to_le32(np->tx_dma[entry]); | 2039 | np->tx_ring[entry].addr = cpu_to_le32(np->tx_dma[entry]); |
| 2039 | 2040 | ||
| 2040 | spin_lock_irq(&np->lock); | 2041 | spin_lock_irqsave(&np->lock, flags); |
| 2041 | 2042 | ||
| 2042 | if (!np->hands_off) { | 2043 | if (!np->hands_off) { |
| 2043 | np->tx_ring[entry].cmd_status = cpu_to_le32(DescOwn | skb->len); | 2044 | np->tx_ring[entry].cmd_status = cpu_to_le32(DescOwn | skb->len); |
| @@ -2056,7 +2057,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) | |||
| 2056 | dev_kfree_skb_irq(skb); | 2057 | dev_kfree_skb_irq(skb); |
| 2057 | np->stats.tx_dropped++; | 2058 | np->stats.tx_dropped++; |
| 2058 | } | 2059 | } |
| 2059 | spin_unlock_irq(&np->lock); | 2060 | spin_unlock_irqrestore(&np->lock, flags); |
| 2060 | 2061 | ||
| 2061 | dev->trans_start = jiffies; | 2062 | dev->trans_start = jiffies; |
| 2062 | 2063 | ||
| @@ -2222,6 +2223,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do) | |||
| 2222 | pkt_len = (desc_status & DescSizeMask) - 4; | 2223 | pkt_len = (desc_status & DescSizeMask) - 4; |
| 2223 | if ((desc_status&(DescMore|DescPktOK|DescRxLong)) != DescPktOK){ | 2224 | if ((desc_status&(DescMore|DescPktOK|DescRxLong)) != DescPktOK){ |
| 2224 | if (desc_status & DescMore) { | 2225 | if (desc_status & DescMore) { |
| 2226 | unsigned long flags; | ||
| 2227 | |||
| 2225 | if (netif_msg_rx_err(np)) | 2228 | if (netif_msg_rx_err(np)) |
| 2226 | printk(KERN_WARNING | 2229 | printk(KERN_WARNING |
| 2227 | "%s: Oversized(?) Ethernet " | 2230 | "%s: Oversized(?) Ethernet " |
| @@ -2236,12 +2239,12 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do) | |||
| 2236 | * reset procedure documented in | 2239 | * reset procedure documented in |
| 2237 | * AN-1287. */ | 2240 | * AN-1287. */ |
| 2238 | 2241 | ||
| 2239 | spin_lock_irq(&np->lock); | 2242 | spin_lock_irqsave(&np->lock, flags); |
| 2240 | reset_rx(dev); | 2243 | reset_rx(dev); |
| 2241 | reinit_rx(dev); | 2244 | reinit_rx(dev); |
| 2242 | writel(np->ring_dma, ioaddr + RxRingPtr); | 2245 | writel(np->ring_dma, ioaddr + RxRingPtr); |
| 2243 | check_link(dev); | 2246 | check_link(dev); |
| 2244 | spin_unlock_irq(&np->lock); | 2247 | spin_unlock_irqrestore(&np->lock, flags); |
| 2245 | 2248 | ||
| 2246 | /* We'll enable RX on exit from this | 2249 | /* We'll enable RX on exit from this |
| 2247 | * function. */ | 2250 | * function. */ |
| @@ -2396,8 +2399,19 @@ static struct net_device_stats *get_stats(struct net_device *dev) | |||
| 2396 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2399 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 2397 | static void natsemi_poll_controller(struct net_device *dev) | 2400 | static void natsemi_poll_controller(struct net_device *dev) |
| 2398 | { | 2401 | { |
| 2402 | struct netdev_private *np = netdev_priv(dev); | ||
| 2403 | |||
| 2399 | disable_irq(dev->irq); | 2404 | disable_irq(dev->irq); |
| 2400 | intr_handler(dev->irq, dev); | 2405 | |
| 2406 | /* | ||
| 2407 | * A real interrupt might have already reached us at this point | ||
| 2408 | * but NAPI might still haven't called us back. As the interrupt | ||
| 2409 | * status register is cleared by reading, we should prevent an | ||
| 2410 | * interrupt loss in this case... | ||
| 2411 | */ | ||
| 2412 | if (!np->intr_status) | ||
| 2413 | intr_handler(dev->irq, dev); | ||
| 2414 | |||
| 2401 | enable_irq(dev->irq); | 2415 | enable_irq(dev->irq); |
| 2402 | } | 2416 | } |
| 2403 | #endif | 2417 | #endif |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 36f9d988278f..4d94ba7899bf 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
| @@ -1234,14 +1234,14 @@ static void pcnet32_rx_entry(struct net_device *dev, | |||
| 1234 | skb_put(skb, pkt_len); /* Make room */ | 1234 | skb_put(skb, pkt_len); /* Make room */ |
| 1235 | pci_dma_sync_single_for_cpu(lp->pci_dev, | 1235 | pci_dma_sync_single_for_cpu(lp->pci_dev, |
| 1236 | lp->rx_dma_addr[entry], | 1236 | lp->rx_dma_addr[entry], |
| 1237 | PKT_BUF_SZ - 2, | 1237 | pkt_len, |
| 1238 | PCI_DMA_FROMDEVICE); | 1238 | PCI_DMA_FROMDEVICE); |
| 1239 | eth_copy_and_sum(skb, | 1239 | eth_copy_and_sum(skb, |
| 1240 | (unsigned char *)(lp->rx_skbuff[entry]->data), | 1240 | (unsigned char *)(lp->rx_skbuff[entry]->data), |
| 1241 | pkt_len, 0); | 1241 | pkt_len, 0); |
| 1242 | pci_dma_sync_single_for_device(lp->pci_dev, | 1242 | pci_dma_sync_single_for_device(lp->pci_dev, |
| 1243 | lp->rx_dma_addr[entry], | 1243 | lp->rx_dma_addr[entry], |
| 1244 | PKT_BUF_SZ - 2, | 1244 | pkt_len, |
| 1245 | PCI_DMA_FROMDEVICE); | 1245 | PCI_DMA_FROMDEVICE); |
| 1246 | } | 1246 | } |
| 1247 | lp->stats.rx_bytes += skb->len; | 1247 | lp->stats.rx_bytes += skb->len; |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index fb2b53051635..b3750f284279 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
| @@ -968,10 +968,10 @@ static void mdio_write(struct net_device *net_dev, int phy_id, int location, | |||
| 968 | 968 | ||
| 969 | static u16 sis900_reset_phy(struct net_device *net_dev, int phy_addr) | 969 | static u16 sis900_reset_phy(struct net_device *net_dev, int phy_addr) |
| 970 | { | 970 | { |
| 971 | int i = 0; | 971 | int i; |
| 972 | u16 status; | 972 | u16 status; |
| 973 | 973 | ||
| 974 | while (i++ < 2) | 974 | for (i = 0; i < 2; i++) |
| 975 | status = mdio_read(net_dev, phy_addr, MII_STATUS); | 975 | status = mdio_read(net_dev, phy_addr, MII_STATUS); |
| 976 | 976 | ||
| 977 | mdio_write( net_dev, phy_addr, MII_CONTROL, MII_CNTL_RESET ); | 977 | mdio_write( net_dev, phy_addr, MII_CONTROL, MII_CNTL_RESET ); |
| @@ -1430,7 +1430,7 @@ static void sis900_auto_negotiate(struct net_device *net_dev, int phy_addr) | |||
| 1430 | int i = 0; | 1430 | int i = 0; |
| 1431 | u32 status; | 1431 | u32 status; |
| 1432 | 1432 | ||
| 1433 | while (i++ < 2) | 1433 | for (i = 0; i < 2; i++) |
| 1434 | status = mdio_read(net_dev, phy_addr, MII_STATUS); | 1434 | status = mdio_read(net_dev, phy_addr, MII_STATUS); |
| 1435 | 1435 | ||
| 1436 | if (!(status & MII_STAT_LINK)){ | 1436 | if (!(status & MII_STAT_LINK)){ |
| @@ -1466,9 +1466,9 @@ static void sis900_read_mode(struct net_device *net_dev, int *speed, int *duplex | |||
| 1466 | int phy_addr = sis_priv->cur_phy; | 1466 | int phy_addr = sis_priv->cur_phy; |
| 1467 | u32 status; | 1467 | u32 status; |
| 1468 | u16 autoadv, autorec; | 1468 | u16 autoadv, autorec; |
| 1469 | int i = 0; | 1469 | int i; |
| 1470 | 1470 | ||
| 1471 | while (i++ < 2) | 1471 | for (i = 0; i < 2; i++) |
| 1472 | status = mdio_read(net_dev, phy_addr, MII_STATUS); | 1472 | status = mdio_read(net_dev, phy_addr, MII_STATUS); |
| 1473 | 1473 | ||
| 1474 | if (!(status & MII_STAT_LINK)) | 1474 | if (!(status & MII_STAT_LINK)) |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index dacea4fd3337..c82befa209a2 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
| @@ -1685,7 +1685,7 @@ static const struct ethtool_ops de_ethtool_ops = { | |||
| 1685 | .get_regs = de_get_regs, | 1685 | .get_regs = de_get_regs, |
| 1686 | }; | 1686 | }; |
| 1687 | 1687 | ||
| 1688 | static void __init de21040_get_mac_address (struct de_private *de) | 1688 | static void __devinit de21040_get_mac_address (struct de_private *de) |
| 1689 | { | 1689 | { |
| 1690 | unsigned i; | 1690 | unsigned i; |
| 1691 | 1691 | ||
| @@ -1703,7 +1703,7 @@ static void __init de21040_get_mac_address (struct de_private *de) | |||
| 1703 | } | 1703 | } |
| 1704 | } | 1704 | } |
| 1705 | 1705 | ||
| 1706 | static void __init de21040_get_media_info(struct de_private *de) | 1706 | static void __devinit de21040_get_media_info(struct de_private *de) |
| 1707 | { | 1707 | { |
| 1708 | unsigned int i; | 1708 | unsigned int i; |
| 1709 | 1709 | ||
| @@ -1765,7 +1765,7 @@ static unsigned __devinit tulip_read_eeprom(void __iomem *regs, int location, in | |||
| 1765 | return retval; | 1765 | return retval; |
| 1766 | } | 1766 | } |
| 1767 | 1767 | ||
| 1768 | static void __init de21041_get_srom_info (struct de_private *de) | 1768 | static void __devinit de21041_get_srom_info (struct de_private *de) |
| 1769 | { | 1769 | { |
| 1770 | unsigned i, sa_offset = 0, ofs; | 1770 | unsigned i, sa_offset = 0, ofs; |
| 1771 | u8 ee_data[DE_EEPROM_SIZE + 6] = {}; | 1771 | u8 ee_data[DE_EEPROM_SIZE + 6] = {}; |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 7f59a3d4fda2..24a29c99ba94 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
| @@ -143,9 +143,16 @@ | |||
| 143 | #define DMFE_TX_TIMEOUT ((3*HZ)/2) /* tx packet time-out time 1.5 s" */ | 143 | #define DMFE_TX_TIMEOUT ((3*HZ)/2) /* tx packet time-out time 1.5 s" */ |
| 144 | #define DMFE_TX_KICK (HZ/2) /* tx packet Kick-out time 0.5 s" */ | 144 | #define DMFE_TX_KICK (HZ/2) /* tx packet Kick-out time 0.5 s" */ |
| 145 | 145 | ||
| 146 | #define DMFE_DBUG(dbug_now, msg, value) if (dmfe_debug || (dbug_now)) printk(KERN_ERR DRV_NAME ": %s %lx\n", (msg), (long) (value)) | 146 | #define DMFE_DBUG(dbug_now, msg, value) \ |
| 147 | do { \ | ||
| 148 | if (dmfe_debug || (dbug_now)) \ | ||
| 149 | printk(KERN_ERR DRV_NAME ": %s %lx\n",\ | ||
| 150 | (msg), (long) (value)); \ | ||
| 151 | } while (0) | ||
| 147 | 152 | ||
| 148 | #define SHOW_MEDIA_TYPE(mode) printk(KERN_ERR DRV_NAME ": Change Speed to %sMhz %s duplex\n",mode & 1 ?"100":"10", mode & 4 ? "full":"half"); | 153 | #define SHOW_MEDIA_TYPE(mode) \ |
| 154 | printk (KERN_INFO DRV_NAME ": Change Speed to %sMhz %s duplex\n" , \ | ||
| 155 | (mode & 1) ? "100":"10", (mode & 4) ? "full":"half"); | ||
| 149 | 156 | ||
| 150 | 157 | ||
| 151 | /* CR9 definition: SROM/MII */ | 158 | /* CR9 definition: SROM/MII */ |
| @@ -163,10 +170,20 @@ | |||
| 163 | 170 | ||
| 164 | #define SROM_V41_CODE 0x14 | 171 | #define SROM_V41_CODE 0x14 |
| 165 | 172 | ||
| 166 | #define SROM_CLK_WRITE(data, ioaddr) outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr);udelay(5);outl(data|CR9_SROM_READ|CR9_SRCS|CR9_SRCLK,ioaddr);udelay(5);outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr);udelay(5); | 173 | #define SROM_CLK_WRITE(data, ioaddr) \ |
| 174 | outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr); \ | ||
| 175 | udelay(5); \ | ||
| 176 | outl(data|CR9_SROM_READ|CR9_SRCS|CR9_SRCLK,ioaddr); \ | ||
| 177 | udelay(5); \ | ||
| 178 | outl(data|CR9_SROM_READ|CR9_SRCS,ioaddr); \ | ||
| 179 | udelay(5); | ||
| 180 | |||
| 181 | #define __CHK_IO_SIZE(pci_id, dev_rev) \ | ||
| 182 | (( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x02000030) ) ? \ | ||
| 183 | DM9102A_IO_SIZE: DM9102_IO_SIZE) | ||
| 167 | 184 | ||
| 168 | #define __CHK_IO_SIZE(pci_id, dev_rev) ( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x02000030) ) ? DM9102A_IO_SIZE: DM9102_IO_SIZE | 185 | #define CHK_IO_SIZE(pci_dev, dev_rev) \ |
| 169 | #define CHK_IO_SIZE(pci_dev, dev_rev) __CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, dev_rev) | 186 | (__CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, dev_rev)) |
| 170 | 187 | ||
| 171 | /* Sten Check */ | 188 | /* Sten Check */ |
| 172 | #define DEVICE net_device | 189 | #define DEVICE net_device |
| @@ -187,7 +204,7 @@ struct rx_desc { | |||
| 187 | struct dmfe_board_info { | 204 | struct dmfe_board_info { |
| 188 | u32 chip_id; /* Chip vendor/Device ID */ | 205 | u32 chip_id; /* Chip vendor/Device ID */ |
| 189 | u32 chip_revision; /* Chip revision */ | 206 | u32 chip_revision; /* Chip revision */ |
| 190 | struct DEVICE *dev; /* net device */ | 207 | struct DEVICE *next_dev; /* next device */ |
| 191 | struct pci_dev *pdev; /* PCI device */ | 208 | struct pci_dev *pdev; /* PCI device */ |
| 192 | spinlock_t lock; | 209 | spinlock_t lock; |
| 193 | 210 | ||
| @@ -231,7 +248,6 @@ struct dmfe_board_info { | |||
| 231 | u8 media_mode; /* user specify media mode */ | 248 | u8 media_mode; /* user specify media mode */ |
| 232 | u8 op_mode; /* real work media mode */ | 249 | u8 op_mode; /* real work media mode */ |
| 233 | u8 phy_addr; | 250 | u8 phy_addr; |
| 234 | u8 link_failed; /* Ever link failed */ | ||
| 235 | u8 wait_reset; /* Hardware failed, need to reset */ | 251 | u8 wait_reset; /* Hardware failed, need to reset */ |
| 236 | u8 dm910x_chk_mode; /* Operating mode check */ | 252 | u8 dm910x_chk_mode; /* Operating mode check */ |
| 237 | u8 first_in_callback; /* Flag to record state */ | 253 | u8 first_in_callback; /* Flag to record state */ |
| @@ -329,7 +345,7 @@ static void dmfe_program_DM9802(struct dmfe_board_info *); | |||
| 329 | static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * ); | 345 | static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * ); |
| 330 | static void dmfe_set_phyxcer(struct dmfe_board_info *); | 346 | static void dmfe_set_phyxcer(struct dmfe_board_info *); |
| 331 | 347 | ||
| 332 | /* DM910X network baord routine ---------------------------- */ | 348 | /* DM910X network board routine ---------------------------- */ |
| 333 | 349 | ||
| 334 | /* | 350 | /* |
| 335 | * Search DM910X board ,allocate space and register it | 351 | * Search DM910X board ,allocate space and register it |
| @@ -356,7 +372,8 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
| 356 | SET_NETDEV_DEV(dev, &pdev->dev); | 372 | SET_NETDEV_DEV(dev, &pdev->dev); |
| 357 | 373 | ||
| 358 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { | 374 | if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { |
| 359 | printk(KERN_WARNING DRV_NAME ": 32-bit PCI DMA not available.\n"); | 375 | printk(KERN_WARNING DRV_NAME |
| 376 | ": 32-bit PCI DMA not available.\n"); | ||
| 360 | err = -ENODEV; | 377 | err = -ENODEV; |
| 361 | goto err_out_free; | 378 | goto err_out_free; |
| 362 | } | 379 | } |
| @@ -399,11 +416,12 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
| 399 | /* Init system & device */ | 416 | /* Init system & device */ |
| 400 | db = netdev_priv(dev); | 417 | db = netdev_priv(dev); |
| 401 | 418 | ||
| 402 | db->dev = dev; | ||
| 403 | |||
| 404 | /* Allocate Tx/Rx descriptor memory */ | 419 | /* Allocate Tx/Rx descriptor memory */ |
| 405 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); | 420 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * |
| 406 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); | 421 | DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); |
| 422 | |||
| 423 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * | ||
| 424 | TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); | ||
| 407 | 425 | ||
| 408 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; | 426 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; |
| 409 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; | 427 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; |
| @@ -428,7 +446,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
| 428 | dev->poll_controller = &poll_dmfe; | 446 | dev->poll_controller = &poll_dmfe; |
| 429 | #endif | 447 | #endif |
| 430 | dev->ethtool_ops = &netdev_ethtool_ops; | 448 | dev->ethtool_ops = &netdev_ethtool_ops; |
| 431 | netif_carrier_off(db->dev); | 449 | netif_carrier_off(dev); |
| 432 | spin_lock_init(&db->lock); | 450 | spin_lock_init(&db->lock); |
| 433 | 451 | ||
| 434 | pci_read_config_dword(pdev, 0x50, &pci_pmr); | 452 | pci_read_config_dword(pdev, 0x50, &pci_pmr); |
| @@ -440,7 +458,8 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
| 440 | 458 | ||
| 441 | /* read 64 word srom data */ | 459 | /* read 64 word srom data */ |
| 442 | for (i = 0; i < 64; i++) | 460 | for (i = 0; i < 64; i++) |
| 443 | ((u16 *) db->srom)[i] = cpu_to_le16(read_srom_word(db->ioaddr, i)); | 461 | ((u16 *) db->srom)[i] = |
| 462 | cpu_to_le16(read_srom_word(db->ioaddr, i)); | ||
| 444 | 463 | ||
| 445 | /* Set Node address */ | 464 | /* Set Node address */ |
| 446 | for (i = 0; i < 6; i++) | 465 | for (i = 0; i < 6; i++) |
| @@ -482,14 +501,17 @@ static void __devexit dmfe_remove_one (struct pci_dev *pdev) | |||
| 482 | DMFE_DBUG(0, "dmfe_remove_one()", 0); | 501 | DMFE_DBUG(0, "dmfe_remove_one()", 0); |
| 483 | 502 | ||
| 484 | if (dev) { | 503 | if (dev) { |
| 504 | |||
| 505 | unregister_netdev(dev); | ||
| 506 | |||
| 485 | pci_free_consistent(db->pdev, sizeof(struct tx_desc) * | 507 | pci_free_consistent(db->pdev, sizeof(struct tx_desc) * |
| 486 | DESC_ALL_CNT + 0x20, db->desc_pool_ptr, | 508 | DESC_ALL_CNT + 0x20, db->desc_pool_ptr, |
| 487 | db->desc_pool_dma_ptr); | 509 | db->desc_pool_dma_ptr); |
| 488 | pci_free_consistent(db->pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, | 510 | pci_free_consistent(db->pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, |
| 489 | db->buf_pool_ptr, db->buf_pool_dma_ptr); | 511 | db->buf_pool_ptr, db->buf_pool_dma_ptr); |
| 490 | unregister_netdev(dev); | ||
| 491 | pci_release_regions(pdev); | 512 | pci_release_regions(pdev); |
| 492 | free_netdev(dev); /* free board information */ | 513 | free_netdev(dev); /* free board information */ |
| 514 | |||
| 493 | pci_set_drvdata(pdev, NULL); | 515 | pci_set_drvdata(pdev, NULL); |
| 494 | } | 516 | } |
| 495 | 517 | ||
| @@ -509,7 +531,8 @@ static int dmfe_open(struct DEVICE *dev) | |||
| 509 | 531 | ||
| 510 | DMFE_DBUG(0, "dmfe_open", 0); | 532 | DMFE_DBUG(0, "dmfe_open", 0); |
| 511 | 533 | ||
| 512 | ret = request_irq(dev->irq, &dmfe_interrupt, IRQF_SHARED, dev->name, dev); | 534 | ret = request_irq(dev->irq, &dmfe_interrupt, |
| 535 | IRQF_SHARED, dev->name, dev); | ||
| 513 | if (ret) | 536 | if (ret) |
| 514 | return ret; | 537 | return ret; |
| 515 | 538 | ||
| @@ -518,7 +541,6 @@ static int dmfe_open(struct DEVICE *dev) | |||
| 518 | db->tx_packet_cnt = 0; | 541 | db->tx_packet_cnt = 0; |
| 519 | db->tx_queue_cnt = 0; | 542 | db->tx_queue_cnt = 0; |
| 520 | db->rx_avail_cnt = 0; | 543 | db->rx_avail_cnt = 0; |
| 521 | db->link_failed = 1; | ||
| 522 | db->wait_reset = 0; | 544 | db->wait_reset = 0; |
| 523 | 545 | ||
| 524 | db->first_in_callback = 0; | 546 | db->first_in_callback = 0; |
| @@ -650,7 +672,8 @@ static int dmfe_start_xmit(struct sk_buff *skb, struct DEVICE *dev) | |||
| 650 | /* No Tx resource check, it never happen nromally */ | 672 | /* No Tx resource check, it never happen nromally */ |
| 651 | if (db->tx_queue_cnt >= TX_FREE_DESC_CNT) { | 673 | if (db->tx_queue_cnt >= TX_FREE_DESC_CNT) { |
| 652 | spin_unlock_irqrestore(&db->lock, flags); | 674 | spin_unlock_irqrestore(&db->lock, flags); |
| 653 | printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n", db->tx_queue_cnt); | 675 | printk(KERN_ERR DRV_NAME ": No Tx resource %ld\n", |
| 676 | db->tx_queue_cnt); | ||
| 654 | return 1; | 677 | return 1; |
| 655 | } | 678 | } |
| 656 | 679 | ||
| @@ -722,7 +745,8 @@ static int dmfe_stop(struct DEVICE *dev) | |||
| 722 | 745 | ||
| 723 | #if 0 | 746 | #if 0 |
| 724 | /* show statistic counter */ | 747 | /* show statistic counter */ |
| 725 | printk(DRV_NAME ": FU:%lx EC:%lx LC:%lx NC:%lx LOC:%lx TXJT:%lx RESET:%lx RCR8:%lx FAL:%lx TT:%lx\n", | 748 | printk(DRV_NAME ": FU:%lx EC:%lx LC:%lx NC:%lx" |
| 749 | " LOC:%lx TXJT:%lx RESET:%lx RCR8:%lx FAL:%lx TT:%lx\n", | ||
| 726 | db->tx_fifo_underrun, db->tx_excessive_collision, | 750 | db->tx_fifo_underrun, db->tx_excessive_collision, |
| 727 | db->tx_late_collision, db->tx_no_carrier, db->tx_loss_carrier, | 751 | db->tx_late_collision, db->tx_no_carrier, db->tx_loss_carrier, |
| 728 | db->tx_jabber_timeout, db->reset_count, db->reset_cr8, | 752 | db->tx_jabber_timeout, db->reset_count, db->reset_cr8, |
| @@ -905,7 +929,7 @@ static inline u32 cal_CRC(unsigned char * Data, unsigned int Len, u8 flag) | |||
| 905 | static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db) | 929 | static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db) |
| 906 | { | 930 | { |
| 907 | struct rx_desc *rxptr; | 931 | struct rx_desc *rxptr; |
| 908 | struct sk_buff *skb; | 932 | struct sk_buff *skb, *newskb; |
| 909 | int rxlen; | 933 | int rxlen; |
| 910 | u32 rdes0; | 934 | u32 rdes0; |
| 911 | 935 | ||
| @@ -919,7 +943,9 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db) | |||
| 919 | db->rx_avail_cnt--; | 943 | db->rx_avail_cnt--; |
| 920 | db->interval_rx_cnt++; | 944 | db->interval_rx_cnt++; |
| 921 | 945 | ||
| 922 | pci_unmap_single(db->pdev, le32_to_cpu(rxptr->rdes2), RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE); | 946 | pci_unmap_single(db->pdev, le32_to_cpu(rxptr->rdes2), |
| 947 | RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE); | ||
| 948 | |||
| 923 | if ( (rdes0 & 0x300) != 0x300) { | 949 | if ( (rdes0 & 0x300) != 0x300) { |
| 924 | /* A packet without First/Last flag */ | 950 | /* A packet without First/Last flag */ |
| 925 | /* reuse this SKB */ | 951 | /* reuse this SKB */ |
| @@ -956,9 +982,11 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db) | |||
| 956 | } else { | 982 | } else { |
| 957 | /* Good packet, send to upper layer */ | 983 | /* Good packet, send to upper layer */ |
| 958 | /* Shorst packet used new SKB */ | 984 | /* Shorst packet used new SKB */ |
| 959 | if ( (rxlen < RX_COPY_SIZE) && | 985 | if ((rxlen < RX_COPY_SIZE) && |
| 960 | ( (skb = dev_alloc_skb(rxlen + 2) ) | 986 | ((newskb = dev_alloc_skb(rxlen + 2)) |
| 961 | != NULL) ) { | 987 | != NULL)) { |
| 988 | |||
| 989 | skb = newskb; | ||
| 962 | /* size less than COPY_SIZE, allocate a rxlen SKB */ | 990 | /* size less than COPY_SIZE, allocate a rxlen SKB */ |
| 963 | skb->dev = dev; | 991 | skb->dev = dev; |
| 964 | skb_reserve(skb, 2); /* 16byte align */ | 992 | skb_reserve(skb, 2); /* 16byte align */ |
| @@ -1069,6 +1097,8 @@ static void dmfe_timer(unsigned long data) | |||
| 1069 | struct dmfe_board_info *db = netdev_priv(dev); | 1097 | struct dmfe_board_info *db = netdev_priv(dev); |
| 1070 | unsigned long flags; | 1098 | unsigned long flags; |
| 1071 | 1099 | ||
| 1100 | int link_ok, link_ok_phy; | ||
| 1101 | |||
| 1072 | DMFE_DBUG(0, "dmfe_timer()", 0); | 1102 | DMFE_DBUG(0, "dmfe_timer()", 0); |
| 1073 | spin_lock_irqsave(&db->lock, flags); | 1103 | spin_lock_irqsave(&db->lock, flags); |
| 1074 | 1104 | ||
| @@ -1078,7 +1108,8 @@ static void dmfe_timer(unsigned long data) | |||
| 1078 | if (db->chip_type && (db->chip_id==PCI_DM9102_ID)) { | 1108 | if (db->chip_type && (db->chip_id==PCI_DM9102_ID)) { |
| 1079 | db->cr6_data &= ~0x40000; | 1109 | db->cr6_data &= ~0x40000; |
| 1080 | update_cr6(db->cr6_data, db->ioaddr); | 1110 | update_cr6(db->cr6_data, db->ioaddr); |
| 1081 | phy_write(db->ioaddr, db->phy_addr, 0, 0x1000, db->chip_id); | 1111 | phy_write(db->ioaddr, |
| 1112 | db->phy_addr, 0, 0x1000, db->chip_id); | ||
| 1082 | db->cr6_data |= 0x40000; | 1113 | db->cr6_data |= 0x40000; |
| 1083 | update_cr6(db->cr6_data, db->ioaddr); | 1114 | update_cr6(db->cr6_data, db->ioaddr); |
| 1084 | db->timer.expires = DMFE_TIMER_WUT + HZ * 2; | 1115 | db->timer.expires = DMFE_TIMER_WUT + HZ * 2; |
| @@ -1139,21 +1170,41 @@ static void dmfe_timer(unsigned long data) | |||
| 1139 | (db->chip_revision == 0x02000010)) ) { | 1170 | (db->chip_revision == 0x02000010)) ) { |
| 1140 | /* DM9102A Chip */ | 1171 | /* DM9102A Chip */ |
| 1141 | if (tmp_cr12 & 2) | 1172 | if (tmp_cr12 & 2) |
| 1142 | tmp_cr12 = 0x0; /* Link failed */ | 1173 | link_ok = 0; |
| 1143 | else | 1174 | else |
| 1144 | tmp_cr12 = 0x3; /* Link OK */ | 1175 | link_ok = 1; |
| 1145 | } | 1176 | } |
| 1177 | else | ||
| 1178 | /*0x43 is used instead of 0x3 because bit 6 should represent | ||
| 1179 | link status of external PHY */ | ||
| 1180 | link_ok = (tmp_cr12 & 0x43) ? 1 : 0; | ||
| 1181 | |||
| 1182 | |||
| 1183 | /* If chip reports that link is failed it could be because external | ||
| 1184 | PHY link status pin is not conected correctly to chip | ||
| 1185 | To be sure ask PHY too. | ||
| 1186 | */ | ||
| 1187 | |||
| 1188 | /* need a dummy read because of PHY's register latch*/ | ||
| 1189 | phy_read (db->ioaddr, db->phy_addr, 1, db->chip_id); | ||
| 1190 | link_ok_phy = (phy_read (db->ioaddr, | ||
| 1191 | db->phy_addr, 1, db->chip_id) & 0x4) ? 1 : 0; | ||
| 1146 | 1192 | ||
| 1147 | if ( !(tmp_cr12 & 0x3) && !db->link_failed ) { | 1193 | if (link_ok_phy != link_ok) { |
| 1194 | DMFE_DBUG (0, "PHY and chip report different link status", 0); | ||
| 1195 | link_ok = link_ok | link_ok_phy; | ||
| 1196 | } | ||
| 1197 | |||
| 1198 | if ( !link_ok && netif_carrier_ok(dev)) { | ||
| 1148 | /* Link Failed */ | 1199 | /* Link Failed */ |
| 1149 | DMFE_DBUG(0, "Link Failed", tmp_cr12); | 1200 | DMFE_DBUG(0, "Link Failed", tmp_cr12); |
| 1150 | db->link_failed = 1; | 1201 | netif_carrier_off(dev); |
| 1151 | netif_carrier_off(db->dev); | ||
| 1152 | 1202 | ||
| 1153 | /* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */ | 1203 | /* For Force 10/100M Half/Full mode: Enable Auto-Nego mode */ |
| 1154 | /* AUTO or force 1M Homerun/Longrun don't need */ | 1204 | /* AUTO or force 1M Homerun/Longrun don't need */ |
| 1155 | if ( !(db->media_mode & 0x38) ) | 1205 | if ( !(db->media_mode & 0x38) ) |
| 1156 | phy_write(db->ioaddr, db->phy_addr, 0, 0x1000, db->chip_id); | 1206 | phy_write(db->ioaddr, db->phy_addr, |
| 1207 | 0, 0x1000, db->chip_id); | ||
| 1157 | 1208 | ||
| 1158 | /* AUTO mode, if INT phyxcer link failed, select EXT device */ | 1209 | /* AUTO mode, if INT phyxcer link failed, select EXT device */ |
| 1159 | if (db->media_mode & DMFE_AUTO) { | 1210 | if (db->media_mode & DMFE_AUTO) { |
| @@ -1162,21 +1213,19 @@ static void dmfe_timer(unsigned long data) | |||
| 1162 | db->cr6_data&=~0x00000200; /* bit9=0, HD mode */ | 1213 | db->cr6_data&=~0x00000200; /* bit9=0, HD mode */ |
| 1163 | update_cr6(db->cr6_data, db->ioaddr); | 1214 | update_cr6(db->cr6_data, db->ioaddr); |
| 1164 | } | 1215 | } |
| 1165 | } else | 1216 | } else if (!netif_carrier_ok(dev)) { |
| 1166 | if ((tmp_cr12 & 0x3) && db->link_failed) { | 1217 | |
| 1167 | DMFE_DBUG(0, "Link link OK", tmp_cr12); | 1218 | DMFE_DBUG(0, "Link link OK", tmp_cr12); |
| 1168 | db->link_failed = 0; | 1219 | |
| 1169 | 1220 | /* Auto Sense Speed */ | |
| 1170 | /* Auto Sense Speed */ | 1221 | if ( !(db->media_mode & DMFE_AUTO) || !dmfe_sense_speed(db)) { |
| 1171 | if ( (db->media_mode & DMFE_AUTO) && | 1222 | netif_carrier_on(dev); |
| 1172 | dmfe_sense_speed(db) ) | 1223 | SHOW_MEDIA_TYPE(db->op_mode); |
| 1173 | db->link_failed = 1; | ||
| 1174 | else | ||
| 1175 | netif_carrier_on(db->dev); | ||
| 1176 | dmfe_process_mode(db); | ||
| 1177 | /* SHOW_MEDIA_TYPE(db->op_mode); */ | ||
| 1178 | } | 1224 | } |
| 1179 | 1225 | ||
| 1226 | dmfe_process_mode(db); | ||
| 1227 | } | ||
| 1228 | |||
| 1180 | /* HPNA remote command check */ | 1229 | /* HPNA remote command check */ |
| 1181 | if (db->HPNA_command & 0xf00) { | 1230 | if (db->HPNA_command & 0xf00) { |
| 1182 | db->HPNA_timer--; | 1231 | db->HPNA_timer--; |
| @@ -1221,7 +1270,7 @@ static void dmfe_dynamic_reset(struct DEVICE *dev) | |||
| 1221 | db->tx_packet_cnt = 0; | 1270 | db->tx_packet_cnt = 0; |
| 1222 | db->tx_queue_cnt = 0; | 1271 | db->tx_queue_cnt = 0; |
| 1223 | db->rx_avail_cnt = 0; | 1272 | db->rx_avail_cnt = 0; |
| 1224 | db->link_failed = 1; | 1273 | netif_carrier_off(dev); |
| 1225 | db->wait_reset = 0; | 1274 | db->wait_reset = 0; |
| 1226 | 1275 | ||
| 1227 | /* Re-initilize DM910X board */ | 1276 | /* Re-initilize DM910X board */ |
| @@ -1259,7 +1308,8 @@ static void dmfe_reuse_skb(struct dmfe_board_info *db, struct sk_buff * skb) | |||
| 1259 | 1308 | ||
| 1260 | if (!(rxptr->rdes0 & cpu_to_le32(0x80000000))) { | 1309 | if (!(rxptr->rdes0 & cpu_to_le32(0x80000000))) { |
| 1261 | rxptr->rx_skb_ptr = skb; | 1310 | rxptr->rx_skb_ptr = skb; |
| 1262 | rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->data, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); | 1311 | rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, |
| 1312 | skb->data, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); | ||
| 1263 | wmb(); | 1313 | wmb(); |
| 1264 | rxptr->rdes0 = cpu_to_le32(0x80000000); | 1314 | rxptr->rdes0 = cpu_to_le32(0x80000000); |
| 1265 | db->rx_avail_cnt++; | 1315 | db->rx_avail_cnt++; |
| @@ -1291,8 +1341,11 @@ static void dmfe_descriptor_init(struct dmfe_board_info *db, unsigned long ioadd | |||
| 1291 | outl(db->first_tx_desc_dma, ioaddr + DCR4); /* TX DESC address */ | 1341 | outl(db->first_tx_desc_dma, ioaddr + DCR4); /* TX DESC address */ |
| 1292 | 1342 | ||
| 1293 | /* rx descriptor start pointer */ | 1343 | /* rx descriptor start pointer */ |
| 1294 | db->first_rx_desc = (void *)db->first_tx_desc + sizeof(struct tx_desc) * TX_DESC_CNT; | 1344 | db->first_rx_desc = (void *)db->first_tx_desc + |
| 1295 | db->first_rx_desc_dma = db->first_tx_desc_dma + sizeof(struct tx_desc) * TX_DESC_CNT; | 1345 | sizeof(struct tx_desc) * TX_DESC_CNT; |
| 1346 | |||
| 1347 | db->first_rx_desc_dma = db->first_tx_desc_dma + | ||
| 1348 | sizeof(struct tx_desc) * TX_DESC_CNT; | ||
| 1296 | db->rx_insert_ptr = db->first_rx_desc; | 1349 | db->rx_insert_ptr = db->first_rx_desc; |
| 1297 | db->rx_ready_ptr = db->first_rx_desc; | 1350 | db->rx_ready_ptr = db->first_rx_desc; |
| 1298 | outl(db->first_rx_desc_dma, ioaddr + DCR3); /* RX DESC address */ | 1351 | outl(db->first_rx_desc_dma, ioaddr + DCR3); /* RX DESC address */ |
| @@ -1470,7 +1523,8 @@ static void allocate_rx_buffer(struct dmfe_board_info *db) | |||
| 1470 | if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL ) | 1523 | if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL ) |
| 1471 | break; | 1524 | break; |
| 1472 | rxptr->rx_skb_ptr = skb; /* FIXME (?) */ | 1525 | rxptr->rx_skb_ptr = skb; /* FIXME (?) */ |
| 1473 | rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->data, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); | 1526 | rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->data, |
| 1527 | RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); | ||
| 1474 | wmb(); | 1528 | wmb(); |
| 1475 | rxptr->rdes0 = cpu_to_le32(0x80000000); | 1529 | rxptr->rdes0 = cpu_to_le32(0x80000000); |
| 1476 | rxptr = rxptr->next_rx_desc; | 1530 | rxptr = rxptr->next_rx_desc; |
| @@ -1510,7 +1564,8 @@ static u16 read_srom_word(long ioaddr, int offset) | |||
| 1510 | for (i = 16; i > 0; i--) { | 1564 | for (i = 16; i > 0; i--) { |
| 1511 | outl(CR9_SROM_READ | CR9_SRCS | CR9_SRCLK, cr9_ioaddr); | 1565 | outl(CR9_SROM_READ | CR9_SRCS | CR9_SRCLK, cr9_ioaddr); |
| 1512 | udelay(5); | 1566 | udelay(5); |
| 1513 | srom_data = (srom_data << 1) | ((inl(cr9_ioaddr) & CR9_CRDOUT) ? 1 : 0); | 1567 | srom_data = (srom_data << 1) | |
| 1568 | ((inl(cr9_ioaddr) & CR9_CRDOUT) ? 1 : 0); | ||
| 1514 | outl(CR9_SROM_READ | CR9_SRCS, cr9_ioaddr); | 1569 | outl(CR9_SROM_READ | CR9_SRCS, cr9_ioaddr); |
| 1515 | udelay(5); | 1570 | udelay(5); |
| 1516 | } | 1571 | } |
| @@ -1537,9 +1592,11 @@ static u8 dmfe_sense_speed(struct dmfe_board_info * db) | |||
| 1537 | 1592 | ||
| 1538 | if ( (phy_mode & 0x24) == 0x24 ) { | 1593 | if ( (phy_mode & 0x24) == 0x24 ) { |
| 1539 | if (db->chip_id == PCI_DM9132_ID) /* DM9132 */ | 1594 | if (db->chip_id == PCI_DM9132_ID) /* DM9132 */ |
| 1540 | phy_mode = phy_read(db->ioaddr, db->phy_addr, 7, db->chip_id) & 0xf000; | 1595 | phy_mode = phy_read(db->ioaddr, |
| 1596 | db->phy_addr, 7, db->chip_id) & 0xf000; | ||
| 1541 | else /* DM9102/DM9102A */ | 1597 | else /* DM9102/DM9102A */ |
| 1542 | phy_mode = phy_read(db->ioaddr, db->phy_addr, 17, db->chip_id) & 0xf000; | 1598 | phy_mode = phy_read(db->ioaddr, |
| 1599 | db->phy_addr, 17, db->chip_id) & 0xf000; | ||
| 1543 | /* printk(DRV_NAME ": Phy_mode %x ",phy_mode); */ | 1600 | /* printk(DRV_NAME ": Phy_mode %x ",phy_mode); */ |
| 1544 | switch (phy_mode) { | 1601 | switch (phy_mode) { |
| 1545 | case 0x1000: db->op_mode = DMFE_10MHF; break; | 1602 | case 0x1000: db->op_mode = DMFE_10MHF; break; |
| @@ -1576,8 +1633,11 @@ static void dmfe_set_phyxcer(struct dmfe_board_info *db) | |||
| 1576 | 1633 | ||
| 1577 | /* DM9009 Chip: Phyxcer reg18 bit12=0 */ | 1634 | /* DM9009 Chip: Phyxcer reg18 bit12=0 */ |
| 1578 | if (db->chip_id == PCI_DM9009_ID) { | 1635 | if (db->chip_id == PCI_DM9009_ID) { |
| 1579 | phy_reg = phy_read(db->ioaddr, db->phy_addr, 18, db->chip_id) & ~0x1000; | 1636 | phy_reg = phy_read(db->ioaddr, |
| 1580 | phy_write(db->ioaddr, db->phy_addr, 18, phy_reg, db->chip_id); | 1637 | db->phy_addr, 18, db->chip_id) & ~0x1000; |
| 1638 | |||
| 1639 | phy_write(db->ioaddr, | ||
| 1640 | db->phy_addr, 18, phy_reg, db->chip_id); | ||
| 1581 | } | 1641 | } |
| 1582 | 1642 | ||
| 1583 | /* Phyxcer capability setting */ | 1643 | /* Phyxcer capability setting */ |
| @@ -1650,10 +1710,12 @@ static void dmfe_process_mode(struct dmfe_board_info *db) | |||
| 1650 | case DMFE_100MHF: phy_reg = 0x2000; break; | 1710 | case DMFE_100MHF: phy_reg = 0x2000; break; |
| 1651 | case DMFE_100MFD: phy_reg = 0x2100; break; | 1711 | case DMFE_100MFD: phy_reg = 0x2100; break; |
| 1652 | } | 1712 | } |
| 1653 | phy_write(db->ioaddr, db->phy_addr, 0, phy_reg, db->chip_id); | 1713 | phy_write(db->ioaddr, |
| 1714 | db->phy_addr, 0, phy_reg, db->chip_id); | ||
| 1654 | if ( db->chip_type && (db->chip_id == PCI_DM9102_ID) ) | 1715 | if ( db->chip_type && (db->chip_id == PCI_DM9102_ID) ) |
| 1655 | mdelay(20); | 1716 | mdelay(20); |
| 1656 | phy_write(db->ioaddr, db->phy_addr, 0, phy_reg, db->chip_id); | 1717 | phy_write(db->ioaddr, |
| 1718 | db->phy_addr, 0, phy_reg, db->chip_id); | ||
| 1657 | } | 1719 | } |
| 1658 | } | 1720 | } |
| 1659 | } | 1721 | } |
| @@ -1663,7 +1725,8 @@ static void dmfe_process_mode(struct dmfe_board_info *db) | |||
| 1663 | * Write a word to Phy register | 1725 | * Write a word to Phy register |
| 1664 | */ | 1726 | */ |
| 1665 | 1727 | ||
| 1666 | static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data, u32 chip_id) | 1728 | static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset, |
| 1729 | u16 phy_data, u32 chip_id) | ||
| 1667 | { | 1730 | { |
| 1668 | u16 i; | 1731 | u16 i; |
| 1669 | unsigned long ioaddr; | 1732 | unsigned long ioaddr; |
| @@ -1689,11 +1752,13 @@ static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data | |||
| 1689 | 1752 | ||
| 1690 | /* Send Phy address */ | 1753 | /* Send Phy address */ |
| 1691 | for (i = 0x10; i > 0; i = i >> 1) | 1754 | for (i = 0x10; i > 0; i = i >> 1) |
| 1692 | phy_write_1bit(ioaddr, phy_addr & i ? PHY_DATA_1 : PHY_DATA_0); | 1755 | phy_write_1bit(ioaddr, |
| 1756 | phy_addr & i ? PHY_DATA_1 : PHY_DATA_0); | ||
| 1693 | 1757 | ||
| 1694 | /* Send register address */ | 1758 | /* Send register address */ |
| 1695 | for (i = 0x10; i > 0; i = i >> 1) | 1759 | for (i = 0x10; i > 0; i = i >> 1) |
| 1696 | phy_write_1bit(ioaddr, offset & i ? PHY_DATA_1 : PHY_DATA_0); | 1760 | phy_write_1bit(ioaddr, |
| 1761 | offset & i ? PHY_DATA_1 : PHY_DATA_0); | ||
| 1697 | 1762 | ||
| 1698 | /* written trasnition */ | 1763 | /* written trasnition */ |
| 1699 | phy_write_1bit(ioaddr, PHY_DATA_1); | 1764 | phy_write_1bit(ioaddr, PHY_DATA_1); |
| @@ -1701,7 +1766,8 @@ static void phy_write(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data | |||
| 1701 | 1766 | ||
| 1702 | /* Write a word data to PHY controller */ | 1767 | /* Write a word data to PHY controller */ |
| 1703 | for ( i = 0x8000; i > 0; i >>= 1) | 1768 | for ( i = 0x8000; i > 0; i >>= 1) |
| 1704 | phy_write_1bit(ioaddr, phy_data & i ? PHY_DATA_1 : PHY_DATA_0); | 1769 | phy_write_1bit(ioaddr, |
| 1770 | phy_data & i ? PHY_DATA_1 : PHY_DATA_0); | ||
| 1705 | } | 1771 | } |
| 1706 | } | 1772 | } |
| 1707 | 1773 | ||
| @@ -1738,11 +1804,13 @@ static u16 phy_read(unsigned long iobase, u8 phy_addr, u8 offset, u32 chip_id) | |||
| 1738 | 1804 | ||
| 1739 | /* Send Phy address */ | 1805 | /* Send Phy address */ |
| 1740 | for (i = 0x10; i > 0; i = i >> 1) | 1806 | for (i = 0x10; i > 0; i = i >> 1) |
| 1741 | phy_write_1bit(ioaddr, phy_addr & i ? PHY_DATA_1 : PHY_DATA_0); | 1807 | phy_write_1bit(ioaddr, |
| 1808 | phy_addr & i ? PHY_DATA_1 : PHY_DATA_0); | ||
| 1742 | 1809 | ||
| 1743 | /* Send register address */ | 1810 | /* Send register address */ |
| 1744 | for (i = 0x10; i > 0; i = i >> 1) | 1811 | for (i = 0x10; i > 0; i = i >> 1) |
| 1745 | phy_write_1bit(ioaddr, offset & i ? PHY_DATA_1 : PHY_DATA_0); | 1812 | phy_write_1bit(ioaddr, |
| 1813 | offset & i ? PHY_DATA_1 : PHY_DATA_0); | ||
| 1746 | 1814 | ||
| 1747 | /* Skip transition state */ | 1815 | /* Skip transition state */ |
| 1748 | phy_read_1bit(ioaddr); | 1816 | phy_read_1bit(ioaddr); |
| @@ -1963,7 +2031,8 @@ static void dmfe_HPNA_remote_cmd_chk(struct dmfe_board_info * db) | |||
| 1963 | 2031 | ||
| 1964 | /* Check remote device status match our setting ot not */ | 2032 | /* Check remote device status match our setting ot not */ |
| 1965 | if ( phy_reg != (db->HPNA_command & 0x0f00) ) { | 2033 | if ( phy_reg != (db->HPNA_command & 0x0f00) ) { |
| 1966 | phy_write(db->ioaddr, db->phy_addr, 16, db->HPNA_command, db->chip_id); | 2034 | phy_write(db->ioaddr, db->phy_addr, 16, db->HPNA_command, |
| 2035 | db->chip_id); | ||
| 1967 | db->HPNA_timer=8; | 2036 | db->HPNA_timer=8; |
| 1968 | } else | 2037 | } else |
| 1969 | db->HPNA_timer=600; /* Match, every 10 minutes, check */ | 2038 | db->HPNA_timer=600; /* Match, every 10 minutes, check */ |
| @@ -2003,8 +2072,11 @@ module_param(HPNA_tx_cmd, byte, 0); | |||
| 2003 | module_param(HPNA_NoiseFloor, byte, 0); | 2072 | module_param(HPNA_NoiseFloor, byte, 0); |
| 2004 | module_param(SF_mode, byte, 0); | 2073 | module_param(SF_mode, byte, 0); |
| 2005 | MODULE_PARM_DESC(debug, "Davicom DM9xxx enable debugging (0-1)"); | 2074 | MODULE_PARM_DESC(debug, "Davicom DM9xxx enable debugging (0-1)"); |
| 2006 | MODULE_PARM_DESC(mode, "Davicom DM9xxx: Bit 0: 10/100Mbps, bit 2: duplex, bit 8: HomePNA"); | 2075 | MODULE_PARM_DESC(mode, "Davicom DM9xxx: " |
| 2007 | MODULE_PARM_DESC(SF_mode, "Davicom DM9xxx special function (bit 0: VLAN, bit 1 Flow Control, bit 2: TX pause packet)"); | 2076 | "Bit 0: 10/100Mbps, bit 2: duplex, bit 8: HomePNA"); |
| 2077 | |||
| 2078 | MODULE_PARM_DESC(SF_mode, "Davicom DM9xxx special function " | ||
| 2079 | "(bit 0: VLAN, bit 1 Flow Control, bit 2: TX pause packet)"); | ||
| 2008 | 2080 | ||
| 2009 | /* Description: | 2081 | /* Description: |
| 2010 | * when user used insmod to add module, system invoked init_module() | 2082 | * when user used insmod to add module, system invoked init_module() |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 885e73d731c2..dab88b958d6e 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
| @@ -3598,17 +3598,20 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 3598 | 3598 | ||
| 3599 | /* Move to next BD in the ring */ | 3599 | /* Move to next BD in the ring */ |
| 3600 | if (!(bd_status & T_W)) | 3600 | if (!(bd_status & T_W)) |
| 3601 | ugeth->txBd[txQ] = bd + sizeof(struct qe_bd); | 3601 | bd += sizeof(struct qe_bd); |
| 3602 | else | 3602 | else |
| 3603 | ugeth->txBd[txQ] = ugeth->p_tx_bd_ring[txQ]; | 3603 | bd = ugeth->p_tx_bd_ring[txQ]; |
| 3604 | 3604 | ||
| 3605 | /* If the next BD still needs to be cleaned up, then the bds | 3605 | /* If the next BD still needs to be cleaned up, then the bds |
| 3606 | are full. We need to tell the kernel to stop sending us stuff. */ | 3606 | are full. We need to tell the kernel to stop sending us stuff. */ |
| 3607 | if (bd == ugeth->confBd[txQ]) { | 3607 | if (bd == ugeth->confBd[txQ]) { |
| 3608 | if (!netif_queue_stopped(dev)) | 3608 | if (!netif_queue_stopped(dev)) |
| 3609 | netif_stop_queue(dev); | 3609 | netif_stop_queue(dev); |
| 3610 | return NETDEV_TX_BUSY; | ||
| 3610 | } | 3611 | } |
| 3611 | 3612 | ||
| 3613 | ugeth->txBd[txQ] = bd; | ||
| 3614 | |||
| 3612 | if (ugeth->p_scheduler) { | 3615 | if (ugeth->p_scheduler) { |
| 3613 | ugeth->cpucount[txQ]++; | 3616 | ugeth->cpucount[txQ]++; |
| 3614 | /* Indicate to QE that there are more Tx bds ready for | 3617 | /* Indicate to QE that there are more Tx bds ready for |
| @@ -3620,7 +3623,7 @@ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 3620 | 3623 | ||
| 3621 | spin_unlock_irq(&ugeth->lock); | 3624 | spin_unlock_irq(&ugeth->lock); |
| 3622 | 3625 | ||
| 3623 | return 0; | 3626 | return NETDEV_TX_OK; |
| 3624 | } | 3627 | } |
| 3625 | 3628 | ||
| 3626 | static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit) | 3629 | static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit) |
| @@ -3722,7 +3725,7 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ) | |||
| 3722 | /* Handle the transmitted buffer and release */ | 3725 | /* Handle the transmitted buffer and release */ |
| 3723 | /* the BD to be used with the current frame */ | 3726 | /* the BD to be used with the current frame */ |
| 3724 | 3727 | ||
| 3725 | if ((bd = ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0)) | 3728 | if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0)) |
| 3726 | break; | 3729 | break; |
| 3727 | 3730 | ||
| 3728 | ugeth->stats.tx_packets++; | 3731 | ugeth->stats.tx_packets++; |
| @@ -3741,10 +3744,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ) | |||
| 3741 | 3744 | ||
| 3742 | /* Advance the confirmation BD pointer */ | 3745 | /* Advance the confirmation BD pointer */ |
| 3743 | if (!(bd_status & T_W)) | 3746 | if (!(bd_status & T_W)) |
| 3744 | ugeth->confBd[txQ] += sizeof(struct qe_bd); | 3747 | bd += sizeof(struct qe_bd); |
| 3745 | else | 3748 | else |
| 3746 | ugeth->confBd[txQ] = ugeth->p_tx_bd_ring[txQ]; | 3749 | bd = ugeth->p_tx_bd_ring[txQ]; |
| 3750 | bd_status = in_be32((u32 *)bd); | ||
| 3747 | } | 3751 | } |
| 3752 | ugeth->confBd[txQ] = bd; | ||
| 3748 | return 0; | 3753 | return 0; |
| 3749 | } | 3754 | } |
| 3750 | 3755 | ||
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c index 08430961a895..99af084c7cec 100644 --- a/drivers/serial/mcfserial.c +++ b/drivers/serial/mcfserial.c | |||
| @@ -425,15 +425,13 @@ irqreturn_t mcfrs_interrupt(int irq, void *dev_id) | |||
| 425 | * ------------------------------------------------------------------- | 425 | * ------------------------------------------------------------------- |
| 426 | */ | 426 | */ |
| 427 | 427 | ||
| 428 | static void mcfrs_offintr(void *private) | 428 | static void mcfrs_offintr(struct work_struct *work) |
| 429 | { | 429 | { |
| 430 | struct mcf_serial *info = (struct mcf_serial *) private; | 430 | struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue); |
| 431 | struct tty_struct *tty; | 431 | struct tty_struct *tty = info->tty; |
| 432 | 432 | ||
| 433 | tty = info->tty; | 433 | if (tty) |
| 434 | if (!tty) | 434 | tty_wakeup(tty); |
| 435 | return; | ||
| 436 | tty_wakeup(tty); | ||
| 437 | } | 435 | } |
| 438 | 436 | ||
| 439 | 437 | ||
| @@ -497,16 +495,13 @@ static void mcfrs_timer(void) | |||
| 497 | * do_serial_hangup() -> tty->hangup() -> mcfrs_hangup() | 495 | * do_serial_hangup() -> tty->hangup() -> mcfrs_hangup() |
| 498 | * | 496 | * |
| 499 | */ | 497 | */ |
| 500 | static void do_serial_hangup(void *private) | 498 | static void do_serial_hangup(struct work_struct *work) |
| 501 | { | 499 | { |
| 502 | struct mcf_serial *info = (struct mcf_serial *) private; | 500 | struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue_hangup); |
| 503 | struct tty_struct *tty; | 501 | struct tty_struct *tty = info->tty; |
| 504 | 502 | ||
| 505 | tty = info->tty; | 503 | if (tty) |
| 506 | if (!tty) | 504 | tty_hangup(tty); |
| 507 | return; | ||
| 508 | |||
| 509 | tty_hangup(tty); | ||
| 510 | } | 505 | } |
| 511 | 506 | ||
| 512 | static int startup(struct mcf_serial * info) | 507 | static int startup(struct mcf_serial * info) |
| @@ -857,7 +852,7 @@ static void mcfrs_throttle(struct tty_struct * tty) | |||
| 857 | #ifdef SERIAL_DEBUG_THROTTLE | 852 | #ifdef SERIAL_DEBUG_THROTTLE |
| 858 | char buf[64]; | 853 | char buf[64]; |
| 859 | 854 | ||
| 860 | printk("throttle %s: %d....\n", _tty_name(tty, buf), | 855 | printk("throttle %s: %d....\n", tty_name(tty, buf), |
| 861 | tty->ldisc.chars_in_buffer(tty)); | 856 | tty->ldisc.chars_in_buffer(tty)); |
| 862 | #endif | 857 | #endif |
| 863 | 858 | ||
| @@ -876,7 +871,7 @@ static void mcfrs_unthrottle(struct tty_struct * tty) | |||
| 876 | #ifdef SERIAL_DEBUG_THROTTLE | 871 | #ifdef SERIAL_DEBUG_THROTTLE |
| 877 | char buf[64]; | 872 | char buf[64]; |
| 878 | 873 | ||
| 879 | printk("unthrottle %s: %d....\n", _tty_name(tty, buf), | 874 | printk("unthrottle %s: %d....\n", tty_name(tty, buf), |
| 880 | tty->ldisc.chars_in_buffer(tty)); | 875 | tty->ldisc.chars_in_buffer(tty)); |
| 881 | #endif | 876 | #endif |
| 882 | 877 | ||
| @@ -1541,8 +1536,8 @@ static void mcfrs_irqinit(struct mcf_serial *info) | |||
| 1541 | * External Pin Mask Setting & Enable External Pin for Interface | 1536 | * External Pin Mask Setting & Enable External Pin for Interface |
| 1542 | * mrcbis@aliceposta.it | 1537 | * mrcbis@aliceposta.it |
| 1543 | */ | 1538 | */ |
| 1544 | unsigned short *serpin_enable_mask; | 1539 | u16 *serpin_enable_mask; |
| 1545 | serpin_enable_mask = (MCF_IPSBAR + MCF_GPIO_PAR_UART); | 1540 | serpin_enable_mask = (u16 *) (MCF_IPSBAR + MCF_GPIO_PAR_UART); |
| 1546 | if (info->line == 0) | 1541 | if (info->line == 0) |
| 1547 | *serpin_enable_mask |= UART0_ENABLE_MASK; | 1542 | *serpin_enable_mask |= UART0_ENABLE_MASK; |
| 1548 | else if (info->line == 1) | 1543 | else if (info->line == 1) |
| @@ -1551,6 +1546,13 @@ static void mcfrs_irqinit(struct mcf_serial *info) | |||
| 1551 | *serpin_enable_mask |= UART2_ENABLE_MASK; | 1546 | *serpin_enable_mask |= UART2_ENABLE_MASK; |
| 1552 | } | 1547 | } |
| 1553 | #endif | 1548 | #endif |
| 1549 | #if defined(CONFIG_M528x) | ||
| 1550 | /* make sure PUAPAR is set for UART0 and UART1 */ | ||
| 1551 | if (info->line < 2) { | ||
| 1552 | volatile unsigned char *portp = (volatile unsigned char *) (MCF_MBAR + MCF5282_GPIO_PUAPAR); | ||
| 1553 | *portp |= (0x03 << (info->line * 2)); | ||
| 1554 | } | ||
| 1555 | #endif | ||
| 1554 | #elif defined(CONFIG_M520x) | 1556 | #elif defined(CONFIG_M520x) |
| 1555 | volatile unsigned char *icrp, *uartp; | 1557 | volatile unsigned char *icrp, *uartp; |
| 1556 | volatile unsigned long *imrp; | 1558 | volatile unsigned long *imrp; |
| @@ -1783,8 +1785,8 @@ mcfrs_init(void) | |||
| 1783 | info->event = 0; | 1785 | info->event = 0; |
| 1784 | info->count = 0; | 1786 | info->count = 0; |
| 1785 | info->blocked_open = 0; | 1787 | info->blocked_open = 0; |
| 1786 | INIT_WORK(&info->tqueue, mcfrs_offintr, info); | 1788 | INIT_WORK(&info->tqueue, mcfrs_offintr); |
| 1787 | INIT_WORK(&info->tqueue_hangup, do_serial_hangup, info); | 1789 | INIT_WORK(&info->tqueue_hangup, do_serial_hangup); |
| 1788 | init_waitqueue_head(&info->open_wait); | 1790 | init_waitqueue_head(&info->open_wait); |
| 1789 | init_waitqueue_head(&info->close_wait); | 1791 | init_waitqueue_head(&info->close_wait); |
| 1790 | 1792 | ||
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 12ec8b432953..827a75a186ba 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
| @@ -686,10 +686,8 @@ void usbhid_init_reports(struct hid_device *hid) | |||
| 686 | #define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802 | 686 | #define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802 |
| 687 | 687 | ||
| 688 | #define USB_VENDOR_ID_CODEMERCS 0x07c0 | 688 | #define USB_VENDOR_ID_CODEMERCS 0x07c0 |
| 689 | #define USB_DEVICE_ID_CODEMERCS_IOW40 0x1500 | 689 | #define USB_DEVICE_ID_CODEMERCS_IOW_FIRST 0x1500 |
| 690 | #define USB_DEVICE_ID_CODEMERCS_IOW24 0x1501 | 690 | #define USB_DEVICE_ID_CODEMERCS_IOW_LAST 0x15ff |
| 691 | #define USB_DEVICE_ID_CODEMERCS_IOW48 0x1502 | ||
| 692 | #define USB_DEVICE_ID_CODEMERCS_IOW28 0x1503 | ||
| 693 | 691 | ||
| 694 | #define USB_VENDOR_ID_DELORME 0x1163 | 692 | #define USB_VENDOR_ID_DELORME 0x1163 |
| 695 | #define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100 | 693 | #define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100 |
| @@ -789,10 +787,6 @@ static const struct hid_blacklist { | |||
| 789 | { USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1, HID_QUIRK_IGNORE }, | 787 | { USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1, HID_QUIRK_IGNORE }, |
| 790 | { USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232, HID_QUIRK_IGNORE }, | 788 | { USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232, HID_QUIRK_IGNORE }, |
| 791 | { USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE }, | 789 | { USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE }, |
| 792 | { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW40, HID_QUIRK_IGNORE }, | ||
| 793 | { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW24, HID_QUIRK_IGNORE }, | ||
| 794 | { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW48, HID_QUIRK_IGNORE }, | ||
| 795 | { USB_VENDOR_ID_CODEMERCS, USB_DEVICE_ID_CODEMERCS_IOW28, HID_QUIRK_IGNORE }, | ||
| 796 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE }, | 790 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE }, |
| 797 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_ULTRAMOUSE, HID_QUIRK_IGNORE }, | 791 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_ULTRAMOUSE, HID_QUIRK_IGNORE }, |
| 798 | { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE }, | 792 | { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE }, |
| @@ -1070,9 +1064,14 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
| 1070 | int n, len, insize = 0; | 1064 | int n, len, insize = 0; |
| 1071 | struct usbhid_device *usbhid; | 1065 | struct usbhid_device *usbhid; |
| 1072 | 1066 | ||
| 1073 | /* Ignore all Wacom devices */ | 1067 | /* Ignore all Wacom devices */ |
| 1074 | if (le16_to_cpu(dev->descriptor.idVendor) == USB_VENDOR_ID_WACOM) | 1068 | if (le16_to_cpu(dev->descriptor.idVendor) == USB_VENDOR_ID_WACOM) |
| 1075 | return NULL; | 1069 | return NULL; |
| 1070 | /* ignore all Code Mercenaries IOWarrior devices */ | ||
| 1071 | if (le16_to_cpu(dev->descriptor.idVendor) == USB_VENDOR_ID_CODEMERCS) | ||
| 1072 | if (le16_to_cpu(dev->descriptor.idProduct) >= USB_DEVICE_ID_CODEMERCS_IOW_FIRST && | ||
| 1073 | le16_to_cpu(dev->descriptor.idProduct) <= USB_DEVICE_ID_CODEMERCS_IOW_LAST) | ||
| 1074 | return NULL; | ||
| 1076 | 1075 | ||
| 1077 | for (n = 0; hid_blacklist[n].idVendor; n++) | 1076 | for (n = 0; hid_blacklist[n].idVendor; n++) |
| 1078 | if ((hid_blacklist[n].idVendor == le16_to_cpu(dev->descriptor.idVendor)) && | 1077 | if ((hid_blacklist[n].idVendor == le16_to_cpu(dev->descriptor.idVendor)) && |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index b8f0a11e8f31..7f5a59836818 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
| @@ -677,8 +677,6 @@ config FB_S1D13XXX | |||
| 677 | config FB_NVIDIA | 677 | config FB_NVIDIA |
| 678 | tristate "nVidia Framebuffer Support" | 678 | tristate "nVidia Framebuffer Support" |
| 679 | depends on FB && PCI | 679 | depends on FB && PCI |
| 680 | select I2C_ALGOBIT if FB_NVIDIA_I2C | ||
| 681 | select I2C if FB_NVIDIA_I2C | ||
| 682 | select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT | 680 | select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT |
| 683 | select FB_MODE_HELPERS | 681 | select FB_MODE_HELPERS |
| 684 | select FB_CFB_FILLRECT | 682 | select FB_CFB_FILLRECT |
| @@ -697,6 +695,7 @@ config FB_NVIDIA | |||
| 697 | config FB_NVIDIA_I2C | 695 | config FB_NVIDIA_I2C |
| 698 | bool "Enable DDC Support" | 696 | bool "Enable DDC Support" |
| 699 | depends on FB_NVIDIA | 697 | depends on FB_NVIDIA |
| 698 | select FB_DDC | ||
| 700 | help | 699 | help |
| 701 | This enables I2C support for nVidia Chipsets. This is used | 700 | This enables I2C support for nVidia Chipsets. This is used |
| 702 | only for getting EDID information from the attached display | 701 | only for getting EDID information from the attached display |
| @@ -716,7 +715,6 @@ config FB_NVIDIA_BACKLIGHT | |||
| 716 | config FB_RIVA | 715 | config FB_RIVA |
| 717 | tristate "nVidia Riva support" | 716 | tristate "nVidia Riva support" |
| 718 | depends on FB && PCI | 717 | depends on FB && PCI |
| 719 | select FB_DDC if FB_RIVA_I2C | ||
| 720 | select FB_BACKLIGHT if FB_RIVA_BACKLIGHT | 718 | select FB_BACKLIGHT if FB_RIVA_BACKLIGHT |
| 721 | select FB_MODE_HELPERS | 719 | select FB_MODE_HELPERS |
| 722 | select FB_CFB_FILLRECT | 720 | select FB_CFB_FILLRECT |
| @@ -734,6 +732,7 @@ config FB_RIVA | |||
| 734 | config FB_RIVA_I2C | 732 | config FB_RIVA_I2C |
| 735 | bool "Enable DDC Support" | 733 | bool "Enable DDC Support" |
| 736 | depends on FB_RIVA | 734 | depends on FB_RIVA |
| 735 | select FB_DDC | ||
| 737 | help | 736 | help |
| 738 | This enables I2C support for nVidia Chipsets. This is used | 737 | This enables I2C support for nVidia Chipsets. This is used |
| 739 | only for getting EDID information from the attached display | 738 | only for getting EDID information from the attached display |
| @@ -812,8 +811,6 @@ config FB_INTEL | |||
| 812 | depends on FB && EXPERIMENTAL && PCI && X86 | 811 | depends on FB && EXPERIMENTAL && PCI && X86 |
| 813 | select AGP | 812 | select AGP |
| 814 | select AGP_INTEL | 813 | select AGP_INTEL |
| 815 | select I2C_ALGOBIT if FB_INTEL_I2C | ||
| 816 | select I2C if FB_INTEL_I2C | ||
| 817 | select FB_MODE_HELPERS | 814 | select FB_MODE_HELPERS |
| 818 | select FB_CFB_FILLRECT | 815 | select FB_CFB_FILLRECT |
| 819 | select FB_CFB_COPYAREA | 816 | select FB_CFB_COPYAREA |
| @@ -846,6 +843,7 @@ config FB_INTEL_DEBUG | |||
| 846 | config FB_INTEL_I2C | 843 | config FB_INTEL_I2C |
| 847 | bool "DDC/I2C for Intel framebuffer support" | 844 | bool "DDC/I2C for Intel framebuffer support" |
| 848 | depends on FB_INTEL | 845 | depends on FB_INTEL |
| 846 | select FB_DDC | ||
| 849 | default y | 847 | default y |
| 850 | help | 848 | help |
| 851 | Say Y here if you want DDC/I2C support for your on-board Intel graphics. | 849 | Say Y here if you want DDC/I2C support for your on-board Intel graphics. |
| @@ -924,8 +922,8 @@ config FB_MATROX_G | |||
| 924 | 922 | ||
| 925 | config FB_MATROX_I2C | 923 | config FB_MATROX_I2C |
| 926 | tristate "Matrox I2C support" | 924 | tristate "Matrox I2C support" |
| 927 | depends on FB_MATROX && I2C | 925 | depends on FB_MATROX |
| 928 | select I2C_ALGOBIT | 926 | select FB_DDC |
| 929 | ---help--- | 927 | ---help--- |
| 930 | This drivers creates I2C buses which are needed for accessing the | 928 | This drivers creates I2C buses which are needed for accessing the |
| 931 | DDC (I2C) bus present on all Matroxes, an I2C bus which | 929 | DDC (I2C) bus present on all Matroxes, an I2C bus which |
| @@ -993,7 +991,6 @@ config FB_MATROX_MULTIHEAD | |||
| 993 | config FB_RADEON | 991 | config FB_RADEON |
| 994 | tristate "ATI Radeon display support" | 992 | tristate "ATI Radeon display support" |
| 995 | depends on FB && PCI | 993 | depends on FB && PCI |
| 996 | select FB_DDC if FB_RADEON_I2C | ||
| 997 | select FB_BACKLIGHT if FB_RADEON_BACKLIGHT | 994 | select FB_BACKLIGHT if FB_RADEON_BACKLIGHT |
| 998 | select FB_MODE_HELPERS | 995 | select FB_MODE_HELPERS |
| 999 | select FB_CFB_FILLRECT | 996 | select FB_CFB_FILLRECT |
| @@ -1018,6 +1015,7 @@ config FB_RADEON | |||
| 1018 | config FB_RADEON_I2C | 1015 | config FB_RADEON_I2C |
| 1019 | bool "DDC/I2C for ATI Radeon support" | 1016 | bool "DDC/I2C for ATI Radeon support" |
| 1020 | depends on FB_RADEON | 1017 | depends on FB_RADEON |
| 1018 | select FB_DDC | ||
| 1021 | default y | 1019 | default y |
| 1022 | help | 1020 | help |
| 1023 | Say Y here if you want DDC/I2C support for your Radeon board. | 1021 | Say Y here if you want DDC/I2C support for your Radeon board. |
| @@ -1125,7 +1123,6 @@ config FB_S3 | |||
| 1125 | config FB_SAVAGE | 1123 | config FB_SAVAGE |
| 1126 | tristate "S3 Savage support" | 1124 | tristate "S3 Savage support" |
| 1127 | depends on FB && PCI && EXPERIMENTAL | 1125 | depends on FB && PCI && EXPERIMENTAL |
| 1128 | select FB_DDC if FB_SAVAGE_I2C | ||
| 1129 | select FB_MODE_HELPERS | 1126 | select FB_MODE_HELPERS |
| 1130 | select FB_CFB_FILLRECT | 1127 | select FB_CFB_FILLRECT |
| 1131 | select FB_CFB_COPYAREA | 1128 | select FB_CFB_COPYAREA |
| @@ -1142,6 +1139,7 @@ config FB_SAVAGE | |||
| 1142 | config FB_SAVAGE_I2C | 1139 | config FB_SAVAGE_I2C |
| 1143 | bool "Enable DDC2 Support" | 1140 | bool "Enable DDC2 Support" |
| 1144 | depends on FB_SAVAGE | 1141 | depends on FB_SAVAGE |
| 1142 | select FB_DDC | ||
| 1145 | help | 1143 | help |
| 1146 | This enables I2C support for S3 Savage Chipsets. This is used | 1144 | This enables I2C support for S3 Savage Chipsets. This is used |
| 1147 | only for getting EDID information from the attached display | 1145 | only for getting EDID information from the attached display |
diff --git a/drivers/video/aty/atyfb.h b/drivers/video/aty/atyfb.h index f72faff33c0c..dc62f8e282b4 100644 --- a/drivers/video/aty/atyfb.h +++ b/drivers/video/aty/atyfb.h | |||
| @@ -284,7 +284,8 @@ static inline void aty_st_8(int regindex, u8 val, const struct atyfb_par *par) | |||
| 284 | #endif | 284 | #endif |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | #if defined(CONFIG_PM) || defined(CONFIG_PMAC_BACKLIGHT) || defined (CONFIG_FB_ATY_GENERIC_LCD) | 287 | #if defined(CONFIG_PM) || defined(CONFIG_PMAC_BACKLIGHT) || \ |
| 288 | defined (CONFIG_FB_ATY_GENERIC_LCD) || defined (CONFIG_FB_ATY_BACKLIGHT) | ||
| 288 | extern void aty_st_lcd(int index, u32 val, const struct atyfb_par *par); | 289 | extern void aty_st_lcd(int index, u32 val, const struct atyfb_par *par); |
| 289 | extern u32 aty_ld_lcd(int index, const struct atyfb_par *par); | 290 | extern u32 aty_ld_lcd(int index, const struct atyfb_par *par); |
| 290 | #endif | 291 | #endif |
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c index a50b303093a7..43f62d8ee41d 100644 --- a/drivers/video/nvidia/nv_backlight.c +++ b/drivers/video/nvidia/nv_backlight.c | |||
| @@ -12,6 +12,11 @@ | |||
| 12 | #include <linux/backlight.h> | 12 | #include <linux/backlight.h> |
| 13 | #include <linux/fb.h> | 13 | #include <linux/fb.h> |
| 14 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
| 15 | |||
| 16 | #ifdef CONFIG_PMAC_BACKLIGHT | ||
| 17 | #include <asm/backlight.h> | ||
| 18 | #endif | ||
| 19 | |||
| 15 | #include "nv_local.h" | 20 | #include "nv_local.h" |
| 16 | #include "nv_type.h" | 21 | #include "nv_type.h" |
| 17 | #include "nv_proto.h" | 22 | #include "nv_proto.h" |
