aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-04-15 14:38:29 -0400
committerSteve French <sfrench@us.ibm.com>2008-04-15 14:38:29 -0400
commite48d199ba10bb8267f491a3a585ca4a833e950a4 (patch)
treec7d308a42479c8f21aaef889abfa004b0f1bb482 /drivers
parentcce246ee5f3c7f4d3539ea41d13feb7a07859145 (diff)
parent0de19a456cb59106420864927fdec152310f70b6 (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/processor_core.c2
-rw-r--r--drivers/acpi/thermal.c2
-rw-r--r--drivers/acpi/video.c2
-rw-r--r--drivers/ata/libata-core.c41
-rw-r--r--drivers/ata/pata_ali.c40
-rw-r--r--drivers/ata/pata_sil680.c2
-rw-r--r--drivers/ata/sata_fsl.c3
-rw-r--r--drivers/ata/sata_svw.c4
-rw-r--r--drivers/block/cciss.c1
-rw-r--r--drivers/block/ub.c38
-rw-r--r--drivers/char/drm/i915_drv.h4
-rw-r--r--drivers/char/hpet.c51
-rw-r--r--drivers/firmware/dmi_scan.c2
-rw-r--r--drivers/i2c/busses/i2c-davinci.c17
-rw-r--r--drivers/i2c/busses/i2c-ibm_iic.c2
-rw-r--r--drivers/i2c/busses/i2c-tiny-usb.c12
-rw-r--r--drivers/ide/pci/siimage.c2
-rw-r--r--drivers/isdn/i4l/isdn_net.c1
-rw-r--r--drivers/md/raid5.c51
-rw-r--r--drivers/media/Makefile3
-rw-r--r--drivers/media/dvb/frontends/s5h1409.c2
-rw-r--r--drivers/media/video/bt8xx/bt832.c12
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.c39
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c10
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c1
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0020.c1
-rw-r--r--drivers/net/bnx2x.c6
-rw-r--r--drivers/net/ehea/ehea.h3
-rw-r--r--drivers/net/ehea/ehea_main.c24
-rw-r--r--drivers/net/forcedeth.c31
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c3
-rw-r--r--drivers/net/macb.c14
-rw-r--r--drivers/net/phy/marvell.c2
-rw-r--r--drivers/net/sc92031.c1
-rw-r--r--drivers/net/sky2.c1
-rw-r--r--drivers/net/smc91x.c2
-rw-r--r--drivers/net/smc91x.h8
-rw-r--r--drivers/net/starfire.c11
-rw-r--r--drivers/net/tg3.c157
-rw-r--r--drivers/net/tg3.h79
-rw-r--r--drivers/net/tokenring/olympic.c21
-rw-r--r--drivers/net/tun.c38
-rw-r--r--drivers/net/ucc_geth.c53
-rw-r--r--drivers/net/virtio_net.c6
-rw-r--r--drivers/net/wan/Kconfig6
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c39
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c7
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c203
-rw-r--r--drivers/net/wireless/ipw2200.c8
-rw-r--r--drivers/net/wireless/iwlwifi/Kconfig1
-rw-r--r--drivers/net/wireless/libertas/assoc.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c4
-rw-r--r--drivers/parport/parport_pc.c3
-rw-r--r--drivers/rtc/Kconfig1
-rw-r--r--drivers/rtc/rtc-at32ap700x.c2
-rw-r--r--drivers/rtc/rtc-at91rm9200.c1
-rw-r--r--drivers/rtc/rtc-bfin.c1
-rw-r--r--drivers/rtc/rtc-cmos.c3
-rw-r--r--drivers/rtc/rtc-ds1216.c1
-rw-r--r--drivers/rtc/rtc-ds1511.c3
-rw-r--r--drivers/rtc/rtc-ds1553.c3
-rw-r--r--drivers/rtc/rtc-ds1742.c1
-rw-r--r--drivers/rtc/rtc-ep93xx.c3
-rw-r--r--drivers/rtc/rtc-m48t59.c3
-rw-r--r--drivers/rtc/rtc-m48t86.c1
-rw-r--r--drivers/rtc/rtc-omap.c2
-rw-r--r--drivers/rtc/rtc-rs5c313.c1
-rw-r--r--drivers/rtc/rtc-s3c.c1
-rw-r--r--drivers/rtc/rtc-sa1100.c1
-rw-r--r--drivers/rtc/rtc-sh.c1
-rw-r--r--drivers/rtc/rtc-stk17ta8.c3
-rw-r--r--drivers/rtc/rtc-v3020.c1
-rw-r--r--drivers/rtc/rtc-vr41xx.c3
-rw-r--r--drivers/scsi/scsi.c22
-rw-r--r--drivers/spi/atmel_spi.c1
-rw-r--r--drivers/spi/au1550_spi.c3
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c3
-rw-r--r--drivers/spi/omap2_mcspi.c3
-rw-r--r--drivers/spi/omap_uwire.c4
-rw-r--r--drivers/spi/pxa2xx_spi.c2
-rw-r--r--drivers/spi/spi_bfin5xx.c19
-rw-r--r--drivers/spi/spi_imx.c4
-rw-r--r--drivers/spi/spi_mpc83xx.c5
-rw-r--r--drivers/spi/spi_s3c24xx.c2
-rw-r--r--drivers/spi/spi_s3c24xx_gpio.c2
-rw-r--r--drivers/spi/spi_sh_sci.c1
-rw-r--r--drivers/spi/spi_txx9.c3
-rw-r--r--drivers/spi/xilinx_spi.c3
-rw-r--r--drivers/ssb/driver_mipscore.c13
-rw-r--r--drivers/ssb/driver_pcicore.c2
-rw-r--r--drivers/ssb/main.c6
-rw-r--r--drivers/usb/gadget/at91_udc.c1
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c2
-rw-r--r--drivers/usb/gadget/fsl_usb2_udc.c1
-rw-r--r--drivers/usb/gadget/lh7a40x_udc.c1
-rw-r--r--drivers/usb/gadget/m66592-udc.c2
-rw-r--r--drivers/usb/gadget/omap_udc.c2
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c2
-rw-r--r--drivers/usb/gadget/s3c2410_udc.c2
-rw-r--r--drivers/usb/host/isp116x-hcd.c8
-rw-r--r--drivers/usb/host/ohci-at91.c3
-rw-r--r--drivers/usb/host/ohci-au1xxx.c1
-rw-r--r--drivers/usb/host/ohci-ep93xx.c2
-rw-r--r--drivers/usb/host/ohci-lh7a404.c1
-rw-r--r--drivers/usb/host/ohci-omap.c1
-rw-r--r--drivers/usb/host/ohci-pnx4008.c4
-rw-r--r--drivers/usb/host/ohci-pnx8550.c5
-rw-r--r--drivers/usb/host/ohci-ppc-soc.c1
-rw-r--r--drivers/usb/host/ohci-pxa27x.c3
-rw-r--r--drivers/usb/host/ohci-s3c2410.c1
-rw-r--r--drivers/usb/host/ohci-sh.c1
-rw-r--r--drivers/usb/host/ohci-sm501.c1
-rw-r--r--drivers/usb/host/r8a66597-hcd.c2
-rw-r--r--drivers/usb/host/sl811-hcd.c1
-rw-r--r--drivers/usb/host/u132-hcd.c1
-rw-r--r--drivers/virtio/virtio_ring.c3
-rw-r--r--drivers/watchdog/at32ap700x_wdt.c3
-rw-r--r--drivers/watchdog/at91rm9200_wdt.c1
-rw-r--r--drivers/watchdog/davinci_wdt.c2
-rw-r--r--drivers/watchdog/it8712f_wdt.c2
-rw-r--r--drivers/watchdog/ks8695_wdt.c1
-rw-r--r--drivers/watchdog/mpc83xx_wdt.c2
-rw-r--r--drivers/watchdog/mpcore_wdt.c3
-rw-r--r--drivers/watchdog/mtx-1_wdt.c2
-rw-r--r--drivers/watchdog/mv64x60_wdt.c1
-rw-r--r--drivers/watchdog/omap_wdt.c1
-rw-r--r--drivers/watchdog/pnx4008_wdt.c2
-rw-r--r--drivers/watchdog/s3c2410_wdt.c1
-rw-r--r--drivers/watchdog/txx9wdt.c1
-rw-r--r--drivers/xen/grant-table.c16
130 files changed, 953 insertions, 349 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 36a68fa114e3..a825b431b64f 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -822,7 +822,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
822 } 822 }
823 823
824 processors[pr->id] = NULL; 824 processors[pr->id] = NULL;
825 825 processor_device_array[pr->id] = NULL;
826 kfree(pr); 826 kfree(pr);
827 827
828 return 0; 828 return 0;
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index c4e00ac8ea85..1bcecc7dd2ca 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -1125,7 +1125,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
1125 tz->trips.active[i].flags.valid; i++, trips++); 1125 tz->trips.active[i].flags.valid; i++, trips++);
1126 tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone", 1126 tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone",
1127 trips, tz, &acpi_thermal_zone_ops); 1127 trips, tz, &acpi_thermal_zone_ops);
1128 if (!tz->thermal_zone) 1128 if (IS_ERR(tz->thermal_zone))
1129 return -ENODEV; 1129 return -ENODEV;
1130 1130
1131 result = sysfs_create_link(&tz->device->dev.kobj, 1131 result = sysfs_create_link(&tz->device->dev.kobj,
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 12fb44f16766..980a74188781 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -713,7 +713,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
713 713
714 kfree(obj); 714 kfree(obj);
715 715
716 if (device->cap._BCL && device->cap._BCM && max_level > 0) { 716 if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){
717 int result; 717 int result;
718 static int count = 0; 718 static int count = 0;
719 char *name; 719 char *name;
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 48519887f94a..be95fdb69726 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -326,6 +326,44 @@ static void ata_force_horkage(struct ata_device *dev)
326} 326}
327 327
328/** 328/**
329 * atapi_cmd_type - Determine ATAPI command type from SCSI opcode
330 * @opcode: SCSI opcode
331 *
332 * Determine ATAPI command type from @opcode.
333 *
334 * LOCKING:
335 * None.
336 *
337 * RETURNS:
338 * ATAPI_{READ|WRITE|READ_CD|PASS_THRU|MISC}
339 */
340int atapi_cmd_type(u8 opcode)
341{
342 switch (opcode) {
343 case GPCMD_READ_10:
344 case GPCMD_READ_12:
345 return ATAPI_READ;
346
347 case GPCMD_WRITE_10:
348 case GPCMD_WRITE_12:
349 case GPCMD_WRITE_AND_VERIFY_10:
350 return ATAPI_WRITE;
351
352 case GPCMD_READ_CD:
353 case GPCMD_READ_CD_MSF:
354 return ATAPI_READ_CD;
355
356 case ATA_16:
357 case ATA_12:
358 if (atapi_passthru16)
359 return ATAPI_PASS_THRU;
360 /* fall thru */
361 default:
362 return ATAPI_MISC;
363 }
364}
365
366/**
329 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure 367 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
330 * @tf: Taskfile to convert 368 * @tf: Taskfile to convert
331 * @pmp: Port multiplier port 369 * @pmp: Port multiplier port
@@ -2660,7 +2698,7 @@ int ata_bus_probe(struct ata_port *ap)
2660 specific sequence bass-ackwards so that PDIAG- is released by 2698 specific sequence bass-ackwards so that PDIAG- is released by
2661 the slave device */ 2699 the slave device */
2662 2700
2663 ata_link_for_each_dev(dev, &ap->link) { 2701 ata_link_for_each_dev_reverse(dev, &ap->link) {
2664 if (tries[dev->devno]) 2702 if (tries[dev->devno])
2665 dev->class = classes[dev->devno]; 2703 dev->class = classes[dev->devno];
2666 2704
@@ -7774,6 +7812,7 @@ EXPORT_SYMBOL_GPL(ata_tf_read);
7774EXPORT_SYMBOL_GPL(ata_noop_dev_select); 7812EXPORT_SYMBOL_GPL(ata_noop_dev_select);
7775EXPORT_SYMBOL_GPL(ata_std_dev_select); 7813EXPORT_SYMBOL_GPL(ata_std_dev_select);
7776EXPORT_SYMBOL_GPL(sata_print_link_status); 7814EXPORT_SYMBOL_GPL(sata_print_link_status);
7815EXPORT_SYMBOL_GPL(atapi_cmd_type);
7777EXPORT_SYMBOL_GPL(ata_tf_to_fis); 7816EXPORT_SYMBOL_GPL(ata_tf_to_fis);
7778EXPORT_SYMBOL_GPL(ata_tf_from_fis); 7817EXPORT_SYMBOL_GPL(ata_tf_from_fis);
7779EXPORT_SYMBOL_GPL(ata_pack_xfermask); 7818EXPORT_SYMBOL_GPL(ata_pack_xfermask);
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 8786455c901d..511a830b6256 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -36,6 +36,10 @@
36#define DRV_NAME "pata_ali" 36#define DRV_NAME "pata_ali"
37#define DRV_VERSION "0.7.5" 37#define DRV_VERSION "0.7.5"
38 38
39static int ali_atapi_dma = 0;
40module_param_named(atapi_dma, ali_atapi_dma, int, 0644);
41MODULE_PARM_DESC(atapi_dma, "Enable ATAPI DMA (0=disable, 1=enable)");
42
39/* 43/*
40 * Cable special cases 44 * Cable special cases
41 */ 45 */
@@ -270,6 +274,27 @@ static void ali_set_dmamode(struct ata_port *ap, struct ata_device *adev)
270} 274}
271 275
272/** 276/**
277 * ali_warn_atapi_dma - Warn about ATAPI DMA disablement
278 * @adev: Device
279 *
280 * Whine about ATAPI DMA disablement if @adev is an ATAPI device.
281 * Can be used as ->dev_config.
282 */
283
284static void ali_warn_atapi_dma(struct ata_device *adev)
285{
286 struct ata_eh_context *ehc = &adev->link->eh_context;
287 int print_info = ehc->i.flags & ATA_EHI_PRINTINFO;
288
289 if (print_info && adev->class == ATA_DEV_ATAPI && !ali_atapi_dma) {
290 ata_dev_printk(adev, KERN_WARNING,
291 "WARNING: ATAPI DMA disabled for reliablity issues. It can be enabled\n");
292 ata_dev_printk(adev, KERN_WARNING,
293 "WARNING: via pata_ali.atapi_dma modparam or corresponding sysfs node.\n");
294 }
295}
296
297/**
273 * ali_lock_sectors - Keep older devices to 255 sector mode 298 * ali_lock_sectors - Keep older devices to 255 sector mode
274 * @adev: Device 299 * @adev: Device
275 * 300 *
@@ -283,6 +308,7 @@ static void ali_set_dmamode(struct ata_port *ap, struct ata_device *adev)
283static void ali_lock_sectors(struct ata_device *adev) 308static void ali_lock_sectors(struct ata_device *adev)
284{ 309{
285 adev->max_sectors = 255; 310 adev->max_sectors = 255;
311 ali_warn_atapi_dma(adev);
286} 312}
287 313
288/** 314/**
@@ -294,6 +320,18 @@ static void ali_lock_sectors(struct ata_device *adev)
294 320
295static int ali_check_atapi_dma(struct ata_queued_cmd *qc) 321static int ali_check_atapi_dma(struct ata_queued_cmd *qc)
296{ 322{
323 if (!ali_atapi_dma) {
324 /* FIXME: pata_ali can't do ATAPI DMA reliably but the
325 * IDE alim15x3 driver can. I tried lots of things
326 * but couldn't find what the actual difference was.
327 * If you got an idea, please write it to
328 * linux-ide@vger.kernel.org and cc htejun@gmail.com.
329 *
330 * Disable ATAPI DMA for now.
331 */
332 return -EOPNOTSUPP;
333 }
334
297 /* If its not a media command, its not worth it */ 335 /* If its not a media command, its not worth it */
298 if (atapi_cmd_type(qc->cdb[0]) == ATAPI_MISC) 336 if (atapi_cmd_type(qc->cdb[0]) == ATAPI_MISC)
299 return -EOPNOTSUPP; 337 return -EOPNOTSUPP;
@@ -359,6 +397,7 @@ static struct ata_port_operations ali_20_port_ops = {
359 397
360 .tf_load = ata_tf_load, 398 .tf_load = ata_tf_load,
361 .tf_read = ata_tf_read, 399 .tf_read = ata_tf_read,
400 .check_atapi_dma = ali_check_atapi_dma,
362 .check_status = ata_check_status, 401 .check_status = ata_check_status,
363 .exec_command = ata_exec_command, 402 .exec_command = ata_exec_command,
364 .dev_select = ata_std_dev_select, 403 .dev_select = ata_std_dev_select,
@@ -438,6 +477,7 @@ static struct ata_port_operations ali_c5_port_ops = {
438 .check_status = ata_check_status, 477 .check_status = ata_check_status,
439 .exec_command = ata_exec_command, 478 .exec_command = ata_exec_command,
440 .dev_select = ata_std_dev_select, 479 .dev_select = ata_std_dev_select,
480 .dev_config = ali_warn_atapi_dma,
441 481
442 .freeze = ata_bmdma_freeze, 482 .freeze = ata_bmdma_freeze,
443 .thaw = ata_bmdma_thaw, 483 .thaw = ata_bmdma_thaw,
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 3988e44f4934..7c5b2dd9a1a1 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -270,7 +270,7 @@ static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
270 tmpbyte & 1, tmpbyte & 0x30); 270 tmpbyte & 1, tmpbyte & 0x30);
271 271
272 *try_mmio = 0; 272 *try_mmio = 0;
273#ifdef CONFIG_PPC 273#ifdef CONFIG_PPC_MERGE
274 if (machine_is(cell)) 274 if (machine_is(cell))
275 *try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5); 275 *try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5);
276#endif 276#endif
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index 4c1985511548..9d1e3cad4aa9 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1256,7 +1256,6 @@ static int sata_fsl_probe(struct of_device *ofdev,
1256 void __iomem *ssr_base = NULL; 1256 void __iomem *ssr_base = NULL;
1257 void __iomem *csr_base = NULL; 1257 void __iomem *csr_base = NULL;
1258 struct sata_fsl_host_priv *host_priv = NULL; 1258 struct sata_fsl_host_priv *host_priv = NULL;
1259 struct resource *r;
1260 int irq; 1259 int irq;
1261 struct ata_host *host; 1260 struct ata_host *host;
1262 1261
@@ -1266,8 +1265,6 @@ static int sata_fsl_probe(struct of_device *ofdev,
1266 dev_printk(KERN_INFO, &ofdev->dev, 1265 dev_printk(KERN_INFO, &ofdev->dev,
1267 "Sata FSL Platform/CSB Driver init\n"); 1266 "Sata FSL Platform/CSB Driver init\n");
1268 1267
1269 r = kmalloc(sizeof(struct resource), GFP_KERNEL);
1270
1271 hcr_base = of_iomap(ofdev->node, 0); 1268 hcr_base = of_iomap(ofdev->node, 0);
1272 if (!hcr_base) 1269 if (!hcr_base)
1273 goto error_exit_with_cleanup; 1270 goto error_exit_with_cleanup;
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index 840d1c4a7850..019e367b59fc 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -531,8 +531,8 @@ static int k2_sata_init_one(struct pci_dev *pdev, const struct pci_device_id *en
531 * */ 531 * */
532static const struct pci_device_id k2_sata_pci_tbl[] = { 532static const struct pci_device_id k2_sata_pci_tbl[] = {
533 { PCI_VDEVICE(SERVERWORKS, 0x0240), chip_svw4 }, 533 { PCI_VDEVICE(SERVERWORKS, 0x0240), chip_svw4 },
534 { PCI_VDEVICE(SERVERWORKS, 0x0241), chip_svw4 }, 534 { PCI_VDEVICE(SERVERWORKS, 0x0241), chip_svw8 },
535 { PCI_VDEVICE(SERVERWORKS, 0x0242), chip_svw8 }, 535 { PCI_VDEVICE(SERVERWORKS, 0x0242), chip_svw4 },
536 { PCI_VDEVICE(SERVERWORKS, 0x024a), chip_svw4 }, 536 { PCI_VDEVICE(SERVERWORKS, 0x024a), chip_svw4 },
537 { PCI_VDEVICE(SERVERWORKS, 0x024b), chip_svw4 }, 537 { PCI_VDEVICE(SERVERWORKS, 0x024b), chip_svw4 },
538 { PCI_VDEVICE(SERVERWORKS, 0x0410), chip_svw42 }, 538 { PCI_VDEVICE(SERVERWORKS, 0x0410), chip_svw42 },
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 55bd35c0f082..9c9627e8e334 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -50,6 +50,7 @@
50#include <scsi/sg.h> 50#include <scsi/sg.h>
51#include <scsi/scsi_ioctl.h> 51#include <scsi/scsi_ioctl.h>
52#include <linux/cdrom.h> 52#include <linux/cdrom.h>
53#include <linux/scatterlist.h>
53 54
54#define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin)) 55#define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
55#define DRIVER_NAME "HP CISS Driver (v 3.6.14)" 56#define DRIVER_NAME "HP CISS Driver (v 3.6.14)"
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index c452e2d355ee..27bfe72aab59 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -8,6 +8,7 @@
8 * and is not licensed separately. See file COPYING for details. 8 * and is not licensed separately. See file COPYING for details.
9 * 9 *
10 * TODO (sorted by decreasing priority) 10 * TODO (sorted by decreasing priority)
11 * -- Return sense now that rq allows it (we always auto-sense anyway).
11 * -- set readonly flag for CDs, set removable flag for CF readers 12 * -- set readonly flag for CDs, set removable flag for CF readers
12 * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch) 13 * -- do inquiry and verify we got a disk and not a tape (for LUN mismatch)
13 * -- verify the 13 conditions and do bulk resets 14 * -- verify the 13 conditions and do bulk resets
@@ -359,7 +360,8 @@ static void ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
359static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun, 360static void ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun,
360 struct ub_scsi_cmd *cmd, struct ub_request *urq); 361 struct ub_scsi_cmd *cmd, struct ub_request *urq);
361static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd); 362static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd);
362static void ub_end_rq(struct request *rq, unsigned int status); 363static void ub_end_rq(struct request *rq, unsigned int status,
364 unsigned int cmd_len);
363static int ub_rw_cmd_retry(struct ub_dev *sc, struct ub_lun *lun, 365static int ub_rw_cmd_retry(struct ub_dev *sc, struct ub_lun *lun,
364 struct ub_request *urq, struct ub_scsi_cmd *cmd); 366 struct ub_request *urq, struct ub_scsi_cmd *cmd);
365static int ub_submit_scsi(struct ub_dev *sc, struct ub_scsi_cmd *cmd); 367static int ub_submit_scsi(struct ub_dev *sc, struct ub_scsi_cmd *cmd);
@@ -642,13 +644,13 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
642 644
643 if (atomic_read(&sc->poison)) { 645 if (atomic_read(&sc->poison)) {
644 blkdev_dequeue_request(rq); 646 blkdev_dequeue_request(rq);
645 ub_end_rq(rq, DID_NO_CONNECT << 16); 647 ub_end_rq(rq, DID_NO_CONNECT << 16, blk_rq_bytes(rq));
646 return 0; 648 return 0;
647 } 649 }
648 650
649 if (lun->changed && !blk_pc_request(rq)) { 651 if (lun->changed && !blk_pc_request(rq)) {
650 blkdev_dequeue_request(rq); 652 blkdev_dequeue_request(rq);
651 ub_end_rq(rq, SAM_STAT_CHECK_CONDITION); 653 ub_end_rq(rq, SAM_STAT_CHECK_CONDITION, blk_rq_bytes(rq));
652 return 0; 654 return 0;
653 } 655 }
654 656
@@ -701,7 +703,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
701 703
702drop: 704drop:
703 ub_put_cmd(lun, cmd); 705 ub_put_cmd(lun, cmd);
704 ub_end_rq(rq, DID_ERROR << 16); 706 ub_end_rq(rq, DID_ERROR << 16, blk_rq_bytes(rq));
705 return 0; 707 return 0;
706} 708}
707 709
@@ -770,6 +772,7 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
770 struct ub_request *urq = cmd->back; 772 struct ub_request *urq = cmd->back;
771 struct request *rq; 773 struct request *rq;
772 unsigned int scsi_status; 774 unsigned int scsi_status;
775 unsigned int cmd_len;
773 776
774 rq = urq->rq; 777 rq = urq->rq;
775 778
@@ -779,8 +782,18 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
779 rq->data_len = 0; 782 rq->data_len = 0;
780 else 783 else
781 rq->data_len -= cmd->act_len; 784 rq->data_len -= cmd->act_len;
785 scsi_status = 0;
786 } else {
787 if (cmd->act_len != cmd->len) {
788 if ((cmd->key == MEDIUM_ERROR ||
789 cmd->key == UNIT_ATTENTION) &&
790 ub_rw_cmd_retry(sc, lun, urq, cmd) == 0)
791 return;
792 scsi_status = SAM_STAT_CHECK_CONDITION;
793 } else {
794 scsi_status = 0;
795 }
782 } 796 }
783 scsi_status = 0;
784 } else { 797 } else {
785 if (blk_pc_request(rq)) { 798 if (blk_pc_request(rq)) {
786 /* UB_SENSE_SIZE is smaller than SCSI_SENSE_BUFFERSIZE */ 799 /* UB_SENSE_SIZE is smaller than SCSI_SENSE_BUFFERSIZE */
@@ -801,14 +814,17 @@ static void ub_rw_cmd_done(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
801 814
802 urq->rq = NULL; 815 urq->rq = NULL;
803 816
817 cmd_len = cmd->len;
804 ub_put_cmd(lun, cmd); 818 ub_put_cmd(lun, cmd);
805 ub_end_rq(rq, scsi_status); 819 ub_end_rq(rq, scsi_status, cmd_len);
806 blk_start_queue(lun->disk->queue); 820 blk_start_queue(lun->disk->queue);
807} 821}
808 822
809static void ub_end_rq(struct request *rq, unsigned int scsi_status) 823static void ub_end_rq(struct request *rq, unsigned int scsi_status,
824 unsigned int cmd_len)
810{ 825{
811 int error; 826 int error;
827 long rqlen;
812 828
813 if (scsi_status == 0) { 829 if (scsi_status == 0) {
814 error = 0; 830 error = 0;
@@ -816,8 +832,12 @@ static void ub_end_rq(struct request *rq, unsigned int scsi_status)
816 error = -EIO; 832 error = -EIO;
817 rq->errors = scsi_status; 833 rq->errors = scsi_status;
818 } 834 }
819 if (__blk_end_request(rq, error, blk_rq_bytes(rq))) 835 rqlen = blk_rq_bytes(rq); /* Oddly enough, this is the residue. */
820 BUG(); 836 if (__blk_end_request(rq, error, cmd_len)) {
837 printk(KERN_WARNING DRV_NAME
838 ": __blk_end_request blew, %s-cmd total %u rqlen %ld\n",
839 blk_pc_request(rq)? "pc": "fs", cmd_len, rqlen);
840 }
821} 841}
822 842
823static int ub_rw_cmd_retry(struct ub_dev *sc, struct ub_lun *lun, 843static int ub_rw_cmd_retry(struct ub_dev *sc, struct ub_lun *lun,
diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h
index c10d128e34db..675d88bda066 100644
--- a/drivers/char/drm/i915_drv.h
+++ b/drivers/char/drm/i915_drv.h
@@ -1092,8 +1092,8 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
1092#define IS_I915G(dev) ((dev)->pci_device == 0x2582 || (dev)->pci_device == 0x258a) 1092#define IS_I915G(dev) ((dev)->pci_device == 0x2582 || (dev)->pci_device == 0x258a)
1093#define IS_I915GM(dev) ((dev)->pci_device == 0x2592) 1093#define IS_I915GM(dev) ((dev)->pci_device == 0x2592)
1094#define IS_I945G(dev) ((dev)->pci_device == 0x2772) 1094#define IS_I945G(dev) ((dev)->pci_device == 0x2772)
1095#define IS_I945GM(dev) ((dev)->pci_device == 0x27A2) 1095#define IS_I945GM(dev) ((dev)->pci_device == 0x27A2 ||\
1096 1096 (dev)->pci_device == 0x27AE)
1097#define IS_I965G(dev) ((dev)->pci_device == 0x2972 || \ 1097#define IS_I965G(dev) ((dev)->pci_device == 0x2972 || \
1098 (dev)->pci_device == 0x2982 || \ 1098 (dev)->pci_device == 0x2982 || \
1099 (dev)->pci_device == 0x2992 || \ 1099 (dev)->pci_device == 0x2992 || \
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 465ad35ed38f..1399971be689 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -731,14 +731,14 @@ static unsigned long hpet_calibrate(struct hpets *hpetp)
731 731
732int hpet_alloc(struct hpet_data *hdp) 732int hpet_alloc(struct hpet_data *hdp)
733{ 733{
734 u64 cap, mcfg, hpet_config; 734 u64 cap, mcfg;
735 struct hpet_dev *devp; 735 struct hpet_dev *devp;
736 u32 i, ntimer, irq; 736 u32 i, ntimer;
737 struct hpets *hpetp; 737 struct hpets *hpetp;
738 size_t siz; 738 size_t siz;
739 struct hpet __iomem *hpet; 739 struct hpet __iomem *hpet;
740 static struct hpets *last = NULL; 740 static struct hpets *last = NULL;
741 unsigned long period, irq_bitmap; 741 unsigned long period;
742 unsigned long long temp; 742 unsigned long long temp;
743 743
744 /* 744 /*
@@ -765,47 +765,11 @@ int hpet_alloc(struct hpet_data *hdp)
765 hpetp->hp_hpet_phys = hdp->hd_phys_address; 765 hpetp->hp_hpet_phys = hdp->hd_phys_address;
766 766
767 hpetp->hp_ntimer = hdp->hd_nirqs; 767 hpetp->hp_ntimer = hdp->hd_nirqs;
768 hpet = hpetp->hp_hpet;
769
770 /* Assign IRQs statically for legacy devices */
771 hpetp->hp_dev[0].hd_hdwirq = hdp->hd_irq[0];
772 hpetp->hp_dev[1].hd_hdwirq = hdp->hd_irq[1];
773
774 /* Assign IRQs dynamically for the others */
775 for (i = 2, devp = &hpetp->hp_dev[2]; i < hdp->hd_nirqs; i++, devp++) {
776 struct hpet_timer __iomem *timer;
777 768
778 timer = &hpet->hpet_timers[devp - hpetp->hp_dev]; 769 for (i = 0; i < hdp->hd_nirqs; i++)
770 hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i];
779 771
780 /* Check if there's already an IRQ assigned to the timer */ 772 hpet = hpetp->hp_hpet;
781 if (hdp->hd_irq[i]) {
782 hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i];
783 continue;
784 }
785
786 hpet_config = readq(&timer->hpet_config);
787 irq_bitmap = (hpet_config & Tn_INT_ROUTE_CAP_MASK)
788 >> Tn_INT_ROUTE_CAP_SHIFT;
789 if (!irq_bitmap)
790 irq = 0; /* No valid IRQ Assignable */
791 else {
792 irq = find_first_bit(&irq_bitmap, 32);
793 do {
794 hpet_config |= irq << Tn_INT_ROUTE_CNF_SHIFT;
795 writeq(hpet_config, &timer->hpet_config);
796
797 /*
798 * Verify whether we have written a valid
799 * IRQ number by reading it back again
800 */
801 hpet_config = readq(&timer->hpet_config);
802 if (irq == (hpet_config & Tn_INT_ROUTE_CNF_MASK)
803 >> Tn_INT_ROUTE_CNF_SHIFT)
804 break; /* Success */
805 } while ((irq = (find_next_bit(&irq_bitmap, 32, irq))));
806 }
807 hpetp->hp_dev[i].hd_hdwirq = irq;
808 }
809 773
810 cap = readq(&hpet->hpet_cap); 774 cap = readq(&hpet->hpet_cap);
811 775
@@ -836,8 +800,7 @@ int hpet_alloc(struct hpet_data *hdp)
836 hpetp->hp_which, hdp->hd_phys_address, 800 hpetp->hp_which, hdp->hd_phys_address,
837 hpetp->hp_ntimer > 1 ? "s" : ""); 801 hpetp->hp_ntimer > 1 ? "s" : "");
838 for (i = 0; i < hpetp->hp_ntimer; i++) 802 for (i = 0; i < hpetp->hp_ntimer; i++)
839 printk("%s %d", i > 0 ? "," : "", 803 printk("%s %d", i > 0 ? "," : "", hdp->hd_irq[i]);
840 hpetp->hp_dev[i].hd_hdwirq);
841 printk("\n"); 804 printk("\n");
842 805
843 printk(KERN_INFO "hpet%u: %u %d-bit timers, %Lu Hz\n", 806 printk(KERN_INFO "hpet%u: %u %d-bit timers, %Lu Hz\n",
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 4072449ad1cd..c5e3ed7e903b 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -266,7 +266,7 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
266 dev->name = "IPMI controller"; 266 dev->name = "IPMI controller";
267 dev->device_data = data; 267 dev->device_data = data;
268 268
269 list_add(&dev->list, &dmi_devices); 269 list_add_tail(&dev->list, &dmi_devices);
270} 270}
271 271
272static void __init dmi_save_extended_devices(const struct dmi_header *dm) 272static void __init dmi_save_extended_devices(const struct dmi_header *dm)
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index cce5a614758d..fde26345a379 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -382,9 +382,8 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
382 break; 382 break;
383 383
384 case DAVINCI_I2C_IVR_ARDY: 384 case DAVINCI_I2C_IVR_ARDY:
385 w = davinci_i2c_read_reg(dev, DAVINCI_I2C_STR_REG); 385 davinci_i2c_write_reg(dev,
386 MOD_REG_BIT(w, DAVINCI_I2C_STR_ARDY, 1); 386 DAVINCI_I2C_STR_REG, DAVINCI_I2C_STR_ARDY);
387 davinci_i2c_write_reg(dev, DAVINCI_I2C_STR_REG, w);
388 complete(&dev->cmd_complete); 387 complete(&dev->cmd_complete);
389 break; 388 break;
390 389
@@ -397,12 +396,9 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
397 if (dev->buf_len) 396 if (dev->buf_len)
398 continue; 397 continue;
399 398
400 w = davinci_i2c_read_reg(dev,
401 DAVINCI_I2C_STR_REG);
402 MOD_REG_BIT(w, DAVINCI_I2C_IMR_RRDY, 0);
403 davinci_i2c_write_reg(dev, 399 davinci_i2c_write_reg(dev,
404 DAVINCI_I2C_STR_REG, 400 DAVINCI_I2C_STR_REG,
405 w); 401 DAVINCI_I2C_IMR_RRDY);
406 } else 402 } else
407 dev_err(dev->dev, "RDR IRQ while no " 403 dev_err(dev->dev, "RDR IRQ while no "
408 "data requested\n"); 404 "data requested\n");
@@ -428,9 +424,8 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id)
428 break; 424 break;
429 425
430 case DAVINCI_I2C_IVR_SCD: 426 case DAVINCI_I2C_IVR_SCD:
431 w = davinci_i2c_read_reg(dev, DAVINCI_I2C_STR_REG); 427 davinci_i2c_write_reg(dev,
432 MOD_REG_BIT(w, DAVINCI_I2C_STR_SCD, 1); 428 DAVINCI_I2C_STR_REG, DAVINCI_I2C_STR_SCD);
433 davinci_i2c_write_reg(dev, DAVINCI_I2C_STR_REG, w);
434 complete(&dev->cmd_complete); 429 complete(&dev->cmd_complete);
435 break; 430 break;
436 431
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 7c7eb0cfeceb..22bb247d0e60 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -55,7 +55,7 @@ MODULE_PARM_DESC(iic_force_poll, "Force polling mode");
55 55
56static int iic_force_fast; 56static int iic_force_fast;
57module_param(iic_force_fast, bool, 0); 57module_param(iic_force_fast, bool, 0);
58MODULE_PARM_DESC(iic_fast_poll, "Force fast mode (400 kHz)"); 58MODULE_PARM_DESC(iic_force_fast, "Force fast mode (400 kHz)");
59 59
60#define DBG_LEVEL 0 60#define DBG_LEVEL 0
61 61
diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c
index cb9abe7565a7..b1c050ff311d 100644
--- a/drivers/i2c/busses/i2c-tiny-usb.c
+++ b/drivers/i2c/busses/i2c-tiny-usb.c
@@ -131,11 +131,15 @@ static const struct i2c_algorithm usb_algorithm = {
131 131
132/* ----- begin of usb layer ---------------------------------------------- */ 132/* ----- begin of usb layer ---------------------------------------------- */
133 133
134/* The usb i2c interface uses a vid/pid pair donated by */ 134/*
135/* Future Technology Devices International Ltd. */ 135 * Initially the usb i2c interface uses a vid/pid pair donated by
136 * Future Technology Devices International Ltd., later a pair was
137 * bought from EZPrototypes
138 */
136static struct usb_device_id i2c_tiny_usb_table [] = { 139static struct usb_device_id i2c_tiny_usb_table [] = {
137 { USB_DEVICE(0x0403, 0xc631) }, 140 { USB_DEVICE(0x0403, 0xc631) }, /* FTDI */
138 { } /* Terminating entry */ 141 { USB_DEVICE(0x1c40, 0x0534) }, /* EZPrototypes */
142 { } /* Terminating entry */
139}; 143};
140 144
141MODULE_DEVICE_TABLE(usb, i2c_tiny_usb_table); 145MODULE_DEVICE_TABLE(usb, i2c_tiny_usb_table);
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index cc4be9621bc0..8d624afe8529 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -492,7 +492,7 @@ static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char *
492 492
493static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name) 493static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name)
494{ 494{
495 unsigned long bar5 = pci_resource_start(dev, 5); 495 resource_size_t bar5 = pci_resource_start(dev, 5);
496 unsigned long barsize = pci_resource_len(dev, 5); 496 unsigned long barsize = pci_resource_len(dev, 5);
497 u8 tmpbyte = 0; 497 u8 tmpbyte = 0;
498 void __iomem *ioaddr; 498 void __iomem *ioaddr;
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index ced83c202cac..ef1a300068dc 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -2010,6 +2010,7 @@ isdn_net_init(struct net_device *ndev)
2010 ndev->flags = IFF_NOARP|IFF_POINTOPOINT; 2010 ndev->flags = IFF_NOARP|IFF_POINTOPOINT;
2011 ndev->type = ARPHRD_ETHER; 2011 ndev->type = ARPHRD_ETHER;
2012 ndev->addr_len = ETH_ALEN; 2012 ndev->addr_len = ETH_ALEN;
2013 ndev->validate_addr = NULL;
2013 2014
2014 /* for clients with MPPP maybe higher values better */ 2015 /* for clients with MPPP maybe higher values better */
2015 ndev->tx_queue_len = 30; 2016 ndev->tx_queue_len = 30;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index c574cf5efb5c..b162b839a662 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2348,25 +2348,15 @@ static void handle_issuing_new_write_requests6(raid5_conf_t *conf,
2348static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh, 2348static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
2349 struct stripe_head_state *s, int disks) 2349 struct stripe_head_state *s, int disks)
2350{ 2350{
2351 int canceled_check = 0;
2352
2351 set_bit(STRIPE_HANDLE, &sh->state); 2353 set_bit(STRIPE_HANDLE, &sh->state);
2352 /* Take one of the following actions:
2353 * 1/ start a check parity operation if (uptodate == disks)
2354 * 2/ finish a check parity operation and act on the result
2355 * 3/ skip to the writeback section if we previously
2356 * initiated a recovery operation
2357 */
2358 if (s->failed == 0 &&
2359 !test_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending)) {
2360 if (!test_and_set_bit(STRIPE_OP_CHECK, &sh->ops.pending)) {
2361 BUG_ON(s->uptodate != disks);
2362 clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags);
2363 sh->ops.count++;
2364 s->uptodate--;
2365 } else if (
2366 test_and_clear_bit(STRIPE_OP_CHECK, &sh->ops.complete)) {
2367 clear_bit(STRIPE_OP_CHECK, &sh->ops.ack);
2368 clear_bit(STRIPE_OP_CHECK, &sh->ops.pending);
2369 2354
2355 /* complete a check operation */
2356 if (test_and_clear_bit(STRIPE_OP_CHECK, &sh->ops.complete)) {
2357 clear_bit(STRIPE_OP_CHECK, &sh->ops.ack);
2358 clear_bit(STRIPE_OP_CHECK, &sh->ops.pending);
2359 if (s->failed == 0) {
2370 if (sh->ops.zero_sum_result == 0) 2360 if (sh->ops.zero_sum_result == 0)
2371 /* parity is correct (on disc, 2361 /* parity is correct (on disc,
2372 * not in buffer any more) 2362 * not in buffer any more)
@@ -2391,7 +2381,8 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
2391 s->uptodate++; 2381 s->uptodate++;
2392 } 2382 }
2393 } 2383 }
2394 } 2384 } else
2385 canceled_check = 1; /* STRIPE_INSYNC is not set */
2395 } 2386 }
2396 2387
2397 /* check if we can clear a parity disk reconstruct */ 2388 /* check if we can clear a parity disk reconstruct */
@@ -2404,12 +2395,28 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
2404 clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending); 2395 clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending);
2405 } 2396 }
2406 2397
2398 /* start a new check operation if there are no failures, the stripe is
2399 * not insync, and a repair is not in flight
2400 */
2401 if (s->failed == 0 &&
2402 !test_bit(STRIPE_INSYNC, &sh->state) &&
2403 !test_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending)) {
2404 if (!test_and_set_bit(STRIPE_OP_CHECK, &sh->ops.pending)) {
2405 BUG_ON(s->uptodate != disks);
2406 clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags);
2407 sh->ops.count++;
2408 s->uptodate--;
2409 }
2410 }
2411
2407 /* Wait for check parity and compute block operations to complete 2412 /* Wait for check parity and compute block operations to complete
2408 * before write-back 2413 * before write-back. If a failure occurred while the check operation
2414 * was in flight we need to cycle this stripe through handle_stripe
2415 * since the parity block may not be uptodate
2409 */ 2416 */
2410 if (!test_bit(STRIPE_INSYNC, &sh->state) && 2417 if (!canceled_check && !test_bit(STRIPE_INSYNC, &sh->state) &&
2411 !test_bit(STRIPE_OP_CHECK, &sh->ops.pending) && 2418 !test_bit(STRIPE_OP_CHECK, &sh->ops.pending) &&
2412 !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending)) { 2419 !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending)) {
2413 struct r5dev *dev; 2420 struct r5dev *dev;
2414 /* either failed parity check, or recovery is happening */ 2421 /* either failed parity check, or recovery is happening */
2415 if (s->failed == 0) 2422 if (s->failed == 0)
diff --git a/drivers/media/Makefile b/drivers/media/Makefile
index 8cf91353b56a..7b8bb6949f5e 100644
--- a/drivers/media/Makefile
+++ b/drivers/media/Makefile
@@ -6,3 +6,6 @@ obj-y := common/
6obj-y += video/ 6obj-y += video/
7obj-$(CONFIG_VIDEO_DEV) += radio/ 7obj-$(CONFIG_VIDEO_DEV) += radio/
8obj-$(CONFIG_DVB_CORE) += dvb/ 8obj-$(CONFIG_DVB_CORE) += dvb/
9ifeq ($(CONFIG_DVB_CORE),)
10 obj-$(CONFIG_VIDEO_TUNER) += dvb/frontends/
11endif
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c
index 819433485d3b..1a4d8319773c 100644
--- a/drivers/media/dvb/frontends/s5h1409.c
+++ b/drivers/media/dvb/frontends/s5h1409.c
@@ -445,7 +445,7 @@ static int s5h1409_set_gpio(struct dvb_frontend* fe, int enable)
445 s5h1409_readreg(state, 0xe3) | 0x1100); 445 s5h1409_readreg(state, 0xe3) | 0x1100);
446 else 446 else
447 return s5h1409_writereg(state, 0xe3, 447 return s5h1409_writereg(state, 0xe3,
448 s5h1409_readreg(state, 0xe3) & 0xeeff); 448 s5h1409_readreg(state, 0xe3) & 0xfeff);
449} 449}
450 450
451static int s5h1409_sleep(struct dvb_frontend* fe, int enable) 451static int s5h1409_sleep(struct dvb_frontend* fe, int enable)
diff --git a/drivers/media/video/bt8xx/bt832.c b/drivers/media/video/bt8xx/bt832.c
index a51876137880..f92f06dec0d0 100644
--- a/drivers/media/video/bt8xx/bt832.c
+++ b/drivers/media/video/bt8xx/bt832.c
@@ -97,6 +97,11 @@ int bt832_init(struct i2c_client *i2c_client_s)
97 int rc; 97 int rc;
98 98
99 buf=kmalloc(65,GFP_KERNEL); 99 buf=kmalloc(65,GFP_KERNEL);
100 if (!buf) {
101 v4l_err(&t->client,
102 "Unable to allocate memory. Detaching.\n");
103 return 0;
104 }
100 bt832_hexdump(i2c_client_s,buf); 105 bt832_hexdump(i2c_client_s,buf);
101 106
102 if(buf[0x40] != 0x31) { 107 if(buf[0x40] != 0x31) {
@@ -211,7 +216,12 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
211 switch (cmd) { 216 switch (cmd) {
212 case BT832_HEXDUMP: { 217 case BT832_HEXDUMP: {
213 unsigned char *buf; 218 unsigned char *buf;
214 buf=kmalloc(65,GFP_KERNEL); 219 buf = kmalloc(65, GFP_KERNEL);
220 if (!buf) {
221 v4l_err(&t->client,
222 "Unable to allocate memory\n");
223 break;
224 }
215 bt832_hexdump(&t->client,buf); 225 bt832_hexdump(&t->client,buf);
216 kfree(buf); 226 kfree(buf);
217 } 227 }
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
index 4df6d6d936fc..fe9991c10cf4 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
@@ -155,6 +155,41 @@ static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
155 155
156 156
157/*------------------------------------------------------------------------*/ 157/*------------------------------------------------------------------------*/
158/* Hauppauge PVR-USB2 Model 73xxx */
159
160static const char *pvr2_client_73xxx[] = {
161 "cx25840",
162 "tuner",
163};
164
165static const char *pvr2_fw1_names_73xxx[] = {
166 "v4l-pvrusb2-73xxx-01.fw",
167};
168
169static const struct pvr2_device_desc pvr2_device_73xxx = {
170 .description = "WinTV PVR USB2 Model Category 73xxxx",
171 .shortname = "73xxx",
172 .client_modules.lst = pvr2_client_73xxx,
173 .client_modules.cnt = ARRAY_SIZE(pvr2_client_73xxx),
174 .fx2_firmware.lst = pvr2_fw1_names_73xxx,
175 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_73xxx),
176 .flag_has_cx25840 = !0,
177 .flag_has_hauppauge_rom = !0,
178#if 0
179 .flag_has_analogtuner = !0,
180 .flag_has_composite = !0,
181 .flag_has_svideo = !0,
182 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
183 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
184 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
185#else
186 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
187#endif
188};
189
190
191
192/*------------------------------------------------------------------------*/
158/* Hauppauge PVR-USB2 Model 75xxx */ 193/* Hauppauge PVR-USB2 Model 75xxx */
159 194
160static const char *pvr2_client_75xxx[] = { 195static const char *pvr2_client_75xxx[] = {
@@ -198,8 +233,12 @@ struct usb_device_id pvr2_device_table[] = {
198 { USB_DEVICE(0x11ba, 0x1001), 233 { USB_DEVICE(0x11ba, 0x1001),
199 .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2}, 234 .driver_info = (kernel_ulong_t)&pvr2_device_onair_usb2},
200#endif 235#endif
236 { USB_DEVICE(0x2040, 0x7300),
237 .driver_info = (kernel_ulong_t)&pvr2_device_73xxx},
201 { USB_DEVICE(0x2040, 0x7500), 238 { USB_DEVICE(0x2040, 0x7500),
202 .driver_info = (kernel_ulong_t)&pvr2_device_75xxx}, 239 .driver_info = (kernel_ulong_t)&pvr2_device_75xxx},
240 { USB_DEVICE(0x2040, 0x7501),
241 .driver_info = (kernel_ulong_t)&pvr2_device_75xxx},
203 { } 242 { }
204}; 243};
205 244
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index 47794d23a42e..0080452531d6 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -718,7 +718,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
718 /* Someone else might have been playing with it. */ 718 /* Someone else might have been playing with it. */
719 return -EAGAIN; 719 return -EAGAIN;
720 } 720 }
721 721 /* Fall through */
722 case FL_READY: 722 case FL_READY:
723 case FL_CFI_QUERY: 723 case FL_CFI_QUERY:
724 case FL_JEDEC_QUERY: 724 case FL_JEDEC_QUERY:
@@ -778,14 +778,14 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
778 chip->state = FL_READY; 778 chip->state = FL_READY;
779 return 0; 779 return 0;
780 780
781 case FL_SHUTDOWN:
782 /* The machine is rebooting now,so no one can get chip anymore */
783 return -EIO;
781 case FL_POINT: 784 case FL_POINT:
782 /* Only if there's no operation suspended... */ 785 /* Only if there's no operation suspended... */
783 if (mode == FL_READY && chip->oldstate == FL_READY) 786 if (mode == FL_READY && chip->oldstate == FL_READY)
784 return 0; 787 return 0;
785 788 /* Fall through */
786 case FL_SHUTDOWN:
787 /* The machine is rebooting now,so no one can get chip anymore */
788 return -EIO;
789 default: 789 default:
790 sleep: 790 sleep:
791 set_current_state(TASK_UNINTERRUPTIBLE); 791 set_current_state(TASK_UNINTERRUPTIBLE);
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index d072e87ce4e2..458d477614d6 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1763,6 +1763,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd)
1763 1763
1764 default: 1764 default:
1765 /* Not an idle state */ 1765 /* Not an idle state */
1766 set_current_state(TASK_UNINTERRUPTIBLE);
1766 add_wait_queue(&chip->wq, &wait); 1767 add_wait_queue(&chip->wq, &wait);
1767 1768
1768 spin_unlock(chip->mutex); 1769 spin_unlock(chip->mutex);
diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
index b344ff858b2d..492e2ab27420 100644
--- a/drivers/mtd/chips/cfi_cmdset_0020.c
+++ b/drivers/mtd/chips/cfi_cmdset_0020.c
@@ -1015,6 +1015,7 @@ static void cfi_staa_sync (struct mtd_info *mtd)
1015 1015
1016 default: 1016 default:
1017 /* Not an idle state */ 1017 /* Not an idle state */
1018 set_current_state(TASK_UNINTERRUPTIBLE);
1018 add_wait_queue(&chip->wq, &wait); 1019 add_wait_queue(&chip->wq, &wait);
1019 1020
1020 spin_unlock_bh(chip->mutex); 1021 spin_unlock_bh(chip->mutex);
diff --git a/drivers/net/bnx2x.c b/drivers/net/bnx2x.c
index de32b3fba322..7bdb5af35951 100644
--- a/drivers/net/bnx2x.c
+++ b/drivers/net/bnx2x.c
@@ -63,8 +63,8 @@
63#include "bnx2x.h" 63#include "bnx2x.h"
64#include "bnx2x_init.h" 64#include "bnx2x_init.h"
65 65
66#define DRV_MODULE_VERSION "1.42.3" 66#define DRV_MODULE_VERSION "1.42.4"
67#define DRV_MODULE_RELDATE "2008/3/9" 67#define DRV_MODULE_RELDATE "2008/4/9"
68#define BNX2X_BC_VER 0x040200 68#define BNX2X_BC_VER 0x040200
69 69
70/* Time in jiffies before concluding the transmitter is hung. */ 70/* Time in jiffies before concluding the transmitter is hung. */
@@ -6153,7 +6153,7 @@ static int bnx2x_function_init(struct bnx2x *bp, int mode)
6153 func, mode); 6153 func, mode);
6154 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 6154 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET,
6155 0xffffffff); 6155 0xffffffff);
6156 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 6156 REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET,
6157 0xfffc); 6157 0xfffc);
6158 bnx2x_init_block(bp, MISC_COMMON_START, MISC_COMMON_END); 6158 bnx2x_init_block(bp, MISC_COMMON_START, MISC_COMMON_END);
6159 6159
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 93b7fb246960..a8d3280923e8 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -40,7 +40,7 @@
40#include <asm/io.h> 40#include <asm/io.h>
41 41
42#define DRV_NAME "ehea" 42#define DRV_NAME "ehea"
43#define DRV_VERSION "EHEA_0089" 43#define DRV_VERSION "EHEA_0090"
44 44
45/* eHEA capability flags */ 45/* eHEA capability flags */
46#define DLPAR_PORT_ADD_REM 1 46#define DLPAR_PORT_ADD_REM 1
@@ -371,6 +371,7 @@ struct ehea_port_res {
371 struct ehea_q_skb_arr rq2_skba; 371 struct ehea_q_skb_arr rq2_skba;
372 struct ehea_q_skb_arr rq3_skba; 372 struct ehea_q_skb_arr rq3_skba;
373 struct ehea_q_skb_arr sq_skba; 373 struct ehea_q_skb_arr sq_skba;
374 int sq_skba_size;
374 spinlock_t netif_queue; 375 spinlock_t netif_queue;
375 int queue_stopped; 376 int queue_stopped;
376 int swqe_refill_th; 377 int swqe_refill_th;
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 07c742dd3f09..f460b623c077 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -349,7 +349,8 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes)
349 pr->rq1_skba.os_skbs = 0; 349 pr->rq1_skba.os_skbs = 0;
350 350
351 if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) { 351 if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) {
352 pr->rq1_skba.index = index; 352 if (nr_of_wqes > 0)
353 pr->rq1_skba.index = index;
353 pr->rq1_skba.os_skbs = fill_wqes; 354 pr->rq1_skba.os_skbs = fill_wqes;
354 return; 355 return;
355 } 356 }
@@ -1464,7 +1465,9 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr,
1464 init_attr->act_nr_rwqes_rq2, 1465 init_attr->act_nr_rwqes_rq2,
1465 init_attr->act_nr_rwqes_rq3); 1466 init_attr->act_nr_rwqes_rq3);
1466 1467
1467 ret = ehea_init_q_skba(&pr->sq_skba, init_attr->act_nr_send_wqes + 1); 1468 pr->sq_skba_size = init_attr->act_nr_send_wqes + 1;
1469
1470 ret = ehea_init_q_skba(&pr->sq_skba, pr->sq_skba_size);
1468 ret |= ehea_init_q_skba(&pr->rq1_skba, init_attr->act_nr_rwqes_rq1 + 1); 1471 ret |= ehea_init_q_skba(&pr->rq1_skba, init_attr->act_nr_rwqes_rq1 + 1);
1469 ret |= ehea_init_q_skba(&pr->rq2_skba, init_attr->act_nr_rwqes_rq2 + 1); 1472 ret |= ehea_init_q_skba(&pr->rq2_skba, init_attr->act_nr_rwqes_rq2 + 1);
1470 ret |= ehea_init_q_skba(&pr->rq3_skba, init_attr->act_nr_rwqes_rq3 + 1); 1473 ret |= ehea_init_q_skba(&pr->rq3_skba, init_attr->act_nr_rwqes_rq3 + 1);
@@ -2621,6 +2624,22 @@ void ehea_purge_sq(struct ehea_qp *orig_qp)
2621 } 2624 }
2622} 2625}
2623 2626
2627void ehea_flush_sq(struct ehea_port *port)
2628{
2629 int i;
2630
2631 for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
2632 struct ehea_port_res *pr = &port->port_res[i];
2633 int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count;
2634 int k = 0;
2635 while (atomic_read(&pr->swqe_avail) < swqe_max) {
2636 msleep(5);
2637 if (++k == 20)
2638 break;
2639 }
2640 }
2641}
2642
2624int ehea_stop_qps(struct net_device *dev) 2643int ehea_stop_qps(struct net_device *dev)
2625{ 2644{
2626 struct ehea_port *port = netdev_priv(dev); 2645 struct ehea_port *port = netdev_priv(dev);
@@ -2845,6 +2864,7 @@ static void ehea_rereg_mrs(struct work_struct *work)
2845 if (dev->flags & IFF_UP) { 2864 if (dev->flags & IFF_UP) {
2846 down(&port->port_lock); 2865 down(&port->port_lock);
2847 netif_stop_queue(dev); 2866 netif_stop_queue(dev);
2867 ehea_flush_sq(port);
2848 ret = ehea_stop_qps(dev); 2868 ret = ehea_stop_qps(dev);
2849 if (ret) { 2869 if (ret) {
2850 up(&port->port_lock); 2870 up(&port->port_lock);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 980c2c229a71..9f088a47d8b1 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -2112,9 +2112,8 @@ static inline void nv_tx_flip_ownership(struct net_device *dev)
2112 2112
2113 np->tx_pkts_in_progress--; 2113 np->tx_pkts_in_progress--;
2114 if (np->tx_change_owner) { 2114 if (np->tx_change_owner) {
2115 __le32 flaglen = le32_to_cpu(np->tx_change_owner->first_tx_desc->flaglen); 2115 np->tx_change_owner->first_tx_desc->flaglen |=
2116 flaglen |= NV_TX2_VALID; 2116 cpu_to_le32(NV_TX2_VALID);
2117 np->tx_change_owner->first_tx_desc->flaglen = cpu_to_le32(flaglen);
2118 np->tx_pkts_in_progress++; 2117 np->tx_pkts_in_progress++;
2119 2118
2120 np->tx_change_owner = np->tx_change_owner->next_tx_ctx; 2119 np->tx_change_owner = np->tx_change_owner->next_tx_ctx;
@@ -5317,8 +5316,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5317 5316
5318 /* check the workaround bit for correct mac address order */ 5317 /* check the workaround bit for correct mac address order */
5319 txreg = readl(base + NvRegTransmitPoll); 5318 txreg = readl(base + NvRegTransmitPoll);
5320 if ((txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) || 5319 if (id->driver_data & DEV_HAS_CORRECT_MACADDR) {
5321 (id->driver_data & DEV_HAS_CORRECT_MACADDR)) {
5322 /* mac address is already in correct order */ 5320 /* mac address is already in correct order */
5323 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff; 5321 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff;
5324 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff; 5322 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff;
@@ -5326,6 +5324,22 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5326 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff; 5324 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff;
5327 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff; 5325 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff;
5328 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff; 5326 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff;
5327 } else if (txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) {
5328 /* mac address is already in correct order */
5329 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff;
5330 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff;
5331 dev->dev_addr[2] = (np->orig_mac[0] >> 16) & 0xff;
5332 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff;
5333 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff;
5334 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff;
5335 /*
5336 * Set orig mac address back to the reversed version.
5337 * This flag will be cleared during low power transition.
5338 * Therefore, we should always put back the reversed address.
5339 */
5340 np->orig_mac[0] = (dev->dev_addr[5] << 0) + (dev->dev_addr[4] << 8) +
5341 (dev->dev_addr[3] << 16) + (dev->dev_addr[2] << 24);
5342 np->orig_mac[1] = (dev->dev_addr[1] << 0) + (dev->dev_addr[0] << 8);
5329 } else { 5343 } else {
5330 /* need to reverse mac address to correct order */ 5344 /* need to reverse mac address to correct order */
5331 dev->dev_addr[0] = (np->orig_mac[1] >> 8) & 0xff; 5345 dev->dev_addr[0] = (np->orig_mac[1] >> 8) & 0xff;
@@ -5596,7 +5610,9 @@ out:
5596static int nv_resume(struct pci_dev *pdev) 5610static int nv_resume(struct pci_dev *pdev)
5597{ 5611{
5598 struct net_device *dev = pci_get_drvdata(pdev); 5612 struct net_device *dev = pci_get_drvdata(pdev);
5613 u8 __iomem *base = get_hwbase(dev);
5599 int rc = 0; 5614 int rc = 0;
5615 u32 txreg;
5600 5616
5601 if (!netif_running(dev)) 5617 if (!netif_running(dev))
5602 goto out; 5618 goto out;
@@ -5607,6 +5623,11 @@ static int nv_resume(struct pci_dev *pdev)
5607 pci_restore_state(pdev); 5623 pci_restore_state(pdev);
5608 pci_enable_wake(pdev, PCI_D0, 0); 5624 pci_enable_wake(pdev, PCI_D0, 0);
5609 5625
5626 /* restore mac address reverse flag */
5627 txreg = readl(base + NvRegTransmitPoll);
5628 txreg |= NVREG_TRANSMITPOLL_MAC_ADDR_REV;
5629 writel(txreg, base + NvRegTransmitPoll);
5630
5610 rc = nv_open(dev); 5631 rc = nv_open(dev);
5611out: 5632out:
5612 return rc; 5633 return rc;
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index af869cf9ae7d..940e2041ba38 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -835,7 +835,8 @@ static int fs_enet_close(struct net_device *dev)
835 835
836 netif_stop_queue(dev); 836 netif_stop_queue(dev);
837 netif_carrier_off(dev); 837 netif_carrier_off(dev);
838 napi_disable(&fep->napi); 838 if (fep->fpi->use_napi)
839 napi_disable(&fep->napi);
839 phy_stop(fep->phydev); 840 phy_stop(fep->phydev);
840 841
841 spin_lock_irqsave(&fep->lock, flags); 842 spin_lock_irqsave(&fep->lock, flags);
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 1d210ed46130..489c7c3b90d9 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -242,12 +242,12 @@ static int macb_mii_init(struct macb *bp)
242 /* Enable managment port */ 242 /* Enable managment port */
243 macb_writel(bp, NCR, MACB_BIT(MPE)); 243 macb_writel(bp, NCR, MACB_BIT(MPE));
244 244
245 bp->mii_bus.name = "MACB_mii_bus", 245 bp->mii_bus.name = "MACB_mii_bus";
246 bp->mii_bus.read = &macb_mdio_read, 246 bp->mii_bus.read = &macb_mdio_read;
247 bp->mii_bus.write = &macb_mdio_write, 247 bp->mii_bus.write = &macb_mdio_write;
248 bp->mii_bus.reset = &macb_mdio_reset, 248 bp->mii_bus.reset = &macb_mdio_reset;
249 bp->mii_bus.id = bp->pdev->id, 249 bp->mii_bus.id = bp->pdev->id;
250 bp->mii_bus.priv = bp, 250 bp->mii_bus.priv = bp;
251 bp->mii_bus.dev = &bp->dev->dev; 251 bp->mii_bus.dev = &bp->dev->dev;
252 pdata = bp->pdev->dev.platform_data; 252 pdata = bp->pdev->dev.platform_data;
253 253
@@ -1257,6 +1257,8 @@ static int __exit macb_remove(struct platform_device *pdev)
1257 1257
1258 if (dev) { 1258 if (dev) {
1259 bp = netdev_priv(dev); 1259 bp = netdev_priv(dev);
1260 if (bp->phy_dev)
1261 phy_disconnect(bp->phy_dev);
1260 mdiobus_unregister(&bp->mii_bus); 1262 mdiobus_unregister(&bp->mii_bus);
1261 kfree(bp->mii_bus.irq); 1263 kfree(bp->mii_bus.irq);
1262 unregister_netdev(dev); 1264 unregister_netdev(dev);
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 33539917e9b8..32a8503a7acd 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -211,8 +211,6 @@ static int m88e1111_config_init(struct phy_device *phydev)
211 } 211 }
212 212
213 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { 213 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
214 int temp;
215
216 temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); 214 temp = phy_read(phydev, MII_M1111_PHY_EXT_SR);
217 if (temp < 0) 215 if (temp < 0)
218 return temp; 216 return temp;
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 37b42394560d..15fcee55284e 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -1446,6 +1446,7 @@ static int __devinit sc92031_probe(struct pci_dev *pdev,
1446 } 1446 }
1447 1447
1448 pci_set_drvdata(pdev, dev); 1448 pci_set_drvdata(pdev, dev);
1449 SET_NETDEV_DEV(dev, &pdev->dev);
1449 1450
1450#if SC92031_USE_BAR == 0 1451#if SC92031_USE_BAR == 0
1451 dev->mem_start = pci_resource_start(pdev, SC92031_USE_BAR); 1452 dev->mem_start = pci_resource_start(pdev, SC92031_USE_BAR);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 853bce0ac478..f226bcac7d17 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -154,6 +154,7 @@ static const char *yukon2_name[] = {
154 "EC", /* 0xb6 */ 154 "EC", /* 0xb6 */
155 "FE", /* 0xb7 */ 155 "FE", /* 0xb7 */
156 "FE+", /* 0xb8 */ 156 "FE+", /* 0xb8 */
157 "Supreme", /* 0xb9 */
157}; 158};
158 159
159static void sky2_set_multicast(struct net_device *dev); 160static void sky2_set_multicast(struct net_device *dev);
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 4020e9e955b3..63a54e29d563 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1326,9 +1326,11 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1326 SMC_SET_INT_MASK(mask); 1326 SMC_SET_INT_MASK(mask);
1327 spin_unlock(&lp->lock); 1327 spin_unlock(&lp->lock);
1328 1328
1329#ifndef CONFIG_NET_POLL_CONTROLLER
1329 if (timeout == MAX_IRQ_LOOPS) 1330 if (timeout == MAX_IRQ_LOOPS)
1330 PRINTK("%s: spurious interrupt (mask = 0x%02x)\n", 1331 PRINTK("%s: spurious interrupt (mask = 0x%02x)\n",
1331 dev->name, mask); 1332 dev->name, mask);
1333#endif
1332 DBG(3, "%s: Interrupt done (%d loops)\n", 1334 DBG(3, "%s: Interrupt done (%d loops)\n",
1333 dev->name, MAX_IRQ_LOOPS - timeout); 1335 dev->name, MAX_IRQ_LOOPS - timeout);
1334 1336
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index 98a832a75539..51d4134b37b1 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -92,14 +92,14 @@
92#define SMC_insw(a, r, p, l) insw ((unsigned long *)((a) + (r)), p, l) 92#define SMC_insw(a, r, p, l) insw ((unsigned long *)((a) + (r)), p, l)
93# endif 93# endif
94/* check if the mac in reg is valid */ 94/* check if the mac in reg is valid */
95#define SMC_GET_MAC_ADDR(lp, addr) \ 95#define SMC_GET_MAC_ADDR(addr) \
96 do { \ 96 do { \
97 unsigned int __v; \ 97 unsigned int __v; \
98 __v = SMC_inw(ioaddr, ADDR0_REG(lp)); \ 98 __v = SMC_inw(ioaddr, ADDR0_REG); \
99 addr[0] = __v; addr[1] = __v >> 8; \ 99 addr[0] = __v; addr[1] = __v >> 8; \
100 __v = SMC_inw(ioaddr, ADDR1_REG(lp)); \ 100 __v = SMC_inw(ioaddr, ADDR1_REG); \
101 addr[2] = __v; addr[3] = __v >> 8; \ 101 addr[2] = __v; addr[3] = __v >> 8; \
102 __v = SMC_inw(ioaddr, ADDR2_REG(lp)); \ 102 __v = SMC_inw(ioaddr, ADDR2_REG); \
103 addr[4] = __v; addr[5] = __v >> 8; \ 103 addr[4] = __v; addr[5] = __v >> 8; \
104 if (*(u32 *)(&addr[0]) == 0xFFFFFFFF) { \ 104 if (*(u32 *)(&addr[0]) == 0xFFFFFFFF) { \
105 random_ether_addr(addr); \ 105 random_ether_addr(addr); \
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index c49214feae91..7b7b1717b0d1 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -1472,13 +1472,12 @@ static int __netdev_rx(struct net_device *dev, int *quota)
1472#ifndef final_version /* Remove after testing. */ 1472#ifndef final_version /* Remove after testing. */
1473 /* You will want this info for the initial debug. */ 1473 /* You will want this info for the initial debug. */
1474 if (debug > 5) { 1474 if (debug > 5) {
1475 DECLARE_MAC_BUF(mac); 1475 printk(KERN_DEBUG " Rx data " MAC_FMT " " MAC_FMT
1476 DECLARE_MAC_BUF(mac2);
1477
1478 printk(KERN_DEBUG " Rx data %s %s"
1479 " %2.2x%2.2x.\n", 1476 " %2.2x%2.2x.\n",
1480 print_mac(mac, &skb->data[0]), 1477 skb->data[0], skb->data[1], skb->data[2],
1481 print_mac(mac2, &skb->data[6]), 1478 skb->data[3], skb->data[4], skb->data[5],
1479 skb->data[6], skb->data[7], skb->data[8],
1480 skb->data[9], skb->data[10], skb->data[11],
1482 skb->data[12], skb->data[13]); 1481 skb->data[12], skb->data[13]);
1483 } 1482 }
1484#endif 1483#endif
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index f9ef8bd8b11e..96043c5746d0 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.88" 67#define DRV_MODULE_VERSION "3.90"
68#define DRV_MODULE_RELDATE "March 20, 2008" 68#define DRV_MODULE_RELDATE "April 12, 2008"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -804,6 +804,12 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val)
804 return ret; 804 return ret;
805} 805}
806 806
807static void tg3_phydsp_write(struct tg3 *tp, u32 reg, u32 val)
808{
809 tg3_writephy(tp, MII_TG3_DSP_ADDRESS, reg);
810 tg3_writephy(tp, MII_TG3_DSP_RW_PORT, val);
811}
812
807static void tg3_phy_toggle_automdix(struct tg3 *tp, int enable) 813static void tg3_phy_toggle_automdix(struct tg3 *tp, int enable)
808{ 814{
809 u32 phy; 815 u32 phy;
@@ -886,6 +892,49 @@ static int tg3_bmcr_reset(struct tg3 *tp)
886 return 0; 892 return 0;
887} 893}
888 894
895static void tg3_phy_apply_otp(struct tg3 *tp)
896{
897 u32 otp, phy;
898
899 if (!tp->phy_otp)
900 return;
901
902 otp = tp->phy_otp;
903
904 /* Enable SM_DSP clock and tx 6dB coding. */
905 phy = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
906 MII_TG3_AUXCTL_ACTL_SMDSP_ENA |
907 MII_TG3_AUXCTL_ACTL_TX_6DB;
908 tg3_writephy(tp, MII_TG3_AUX_CTRL, phy);
909
910 phy = ((otp & TG3_OTP_AGCTGT_MASK) >> TG3_OTP_AGCTGT_SHIFT);
911 phy |= MII_TG3_DSP_TAP1_AGCTGT_DFLT;
912 tg3_phydsp_write(tp, MII_TG3_DSP_TAP1, phy);
913
914 phy = ((otp & TG3_OTP_HPFFLTR_MASK) >> TG3_OTP_HPFFLTR_SHIFT) |
915 ((otp & TG3_OTP_HPFOVER_MASK) >> TG3_OTP_HPFOVER_SHIFT);
916 tg3_phydsp_write(tp, MII_TG3_DSP_AADJ1CH0, phy);
917
918 phy = ((otp & TG3_OTP_LPFDIS_MASK) >> TG3_OTP_LPFDIS_SHIFT);
919 phy |= MII_TG3_DSP_AADJ1CH3_ADCCKADJ;
920 tg3_phydsp_write(tp, MII_TG3_DSP_AADJ1CH3, phy);
921
922 phy = ((otp & TG3_OTP_VDAC_MASK) >> TG3_OTP_VDAC_SHIFT);
923 tg3_phydsp_write(tp, MII_TG3_DSP_EXP75, phy);
924
925 phy = ((otp & TG3_OTP_10BTAMP_MASK) >> TG3_OTP_10BTAMP_SHIFT);
926 tg3_phydsp_write(tp, MII_TG3_DSP_EXP96, phy);
927
928 phy = ((otp & TG3_OTP_ROFF_MASK) >> TG3_OTP_ROFF_SHIFT) |
929 ((otp & TG3_OTP_RCOFF_MASK) >> TG3_OTP_RCOFF_SHIFT);
930 tg3_phydsp_write(tp, MII_TG3_DSP_EXP97, phy);
931
932 /* Turn off SM_DSP clock. */
933 phy = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
934 MII_TG3_AUXCTL_ACTL_TX_6DB;
935 tg3_writephy(tp, MII_TG3_AUX_CTRL, phy);
936}
937
889static int tg3_wait_macro_done(struct tg3 *tp) 938static int tg3_wait_macro_done(struct tg3 *tp)
890{ 939{
891 int limit = 100; 940 int limit = 100;
@@ -1073,6 +1122,7 @@ static void tg3_link_report(struct tg3 *);
1073 */ 1122 */
1074static int tg3_phy_reset(struct tg3 *tp) 1123static int tg3_phy_reset(struct tg3 *tp)
1075{ 1124{
1125 u32 cpmuctrl;
1076 u32 phy_status; 1126 u32 phy_status;
1077 int err; 1127 int err;
1078 1128
@@ -1102,10 +1152,28 @@ static int tg3_phy_reset(struct tg3 *tp)
1102 goto out; 1152 goto out;
1103 } 1153 }
1104 1154
1155 cpmuctrl = 0;
1156 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
1157 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) {
1158 cpmuctrl = tr32(TG3_CPMU_CTRL);
1159 if (cpmuctrl & CPMU_CTRL_GPHY_10MB_RXONLY)
1160 tw32(TG3_CPMU_CTRL,
1161 cpmuctrl & ~CPMU_CTRL_GPHY_10MB_RXONLY);
1162 }
1163
1105 err = tg3_bmcr_reset(tp); 1164 err = tg3_bmcr_reset(tp);
1106 if (err) 1165 if (err)
1107 return err; 1166 return err;
1108 1167
1168 if (cpmuctrl & CPMU_CTRL_GPHY_10MB_RXONLY) {
1169 u32 phy;
1170
1171 phy = MII_TG3_DSP_EXP8_AEDW | MII_TG3_DSP_EXP8_REJ2MHz;
1172 tg3_phydsp_write(tp, MII_TG3_DSP_EXP8, phy);
1173
1174 tw32(TG3_CPMU_CTRL, cpmuctrl);
1175 }
1176
1109 if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { 1177 if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) {
1110 u32 val; 1178 u32 val;
1111 1179
@@ -1124,6 +1192,8 @@ static int tg3_phy_reset(struct tg3 *tp)
1124 MII_TG3_MISC_SHDW_APD_WKTM_84MS); 1192 MII_TG3_MISC_SHDW_APD_WKTM_84MS);
1125 } 1193 }
1126 1194
1195 tg3_phy_apply_otp(tp);
1196
1127out: 1197out:
1128 if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) { 1198 if (tp->tg3_flags2 & TG3_FLG2_PHY_ADC_BUG) {
1129 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00); 1199 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x0c00);
@@ -9464,7 +9534,8 @@ static int tg3_test_loopback(struct tg3 *tp)
9464 if (err) 9534 if (err)
9465 return TG3_LOOPBACK_FAILED; 9535 return TG3_LOOPBACK_FAILED;
9466 9536
9467 if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { 9537 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
9538 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
9468 int i; 9539 int i;
9469 u32 status; 9540 u32 status;
9470 9541
@@ -9481,17 +9552,23 @@ static int tg3_test_loopback(struct tg3 *tp)
9481 if (status != CPMU_MUTEX_GNT_DRIVER) 9552 if (status != CPMU_MUTEX_GNT_DRIVER)
9482 return TG3_LOOPBACK_FAILED; 9553 return TG3_LOOPBACK_FAILED;
9483 9554
9484 /* Turn off power management based on link speed. */ 9555 /* Turn off link-based power management. */
9485 cpmuctrl = tr32(TG3_CPMU_CTRL); 9556 cpmuctrl = tr32(TG3_CPMU_CTRL);
9486 tw32(TG3_CPMU_CTRL, 9557 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
9487 cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE | 9558 GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5761_AX)
9488 CPMU_CTRL_LINK_AWARE_MODE)); 9559 tw32(TG3_CPMU_CTRL,
9560 cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE |
9561 CPMU_CTRL_LINK_AWARE_MODE));
9562 else
9563 tw32(TG3_CPMU_CTRL,
9564 cpmuctrl & ~CPMU_CTRL_LINK_AWARE_MODE);
9489 } 9565 }
9490 9566
9491 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK)) 9567 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
9492 err |= TG3_MAC_LOOPBACK_FAILED; 9568 err |= TG3_MAC_LOOPBACK_FAILED;
9493 9569
9494 if (tp->tg3_flags3 & TG3_FLG3_5761_5784_AX_FIXES) { 9570 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
9571 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
9495 tw32(TG3_CPMU_CTRL, cpmuctrl); 9572 tw32(TG3_CPMU_CTRL, cpmuctrl);
9496 9573
9497 /* Release the mutex */ 9574 /* Release the mutex */
@@ -10724,9 +10801,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
10724 tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL) 10801 tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
10725 tp->led_ctrl = LED_CTRL_MODE_PHY_2; 10802 tp->led_ctrl = LED_CTRL_MODE_PHY_2;
10726 10803
10727 if (tp->pci_chip_rev_id == CHIPREV_ID_5784_A0 || 10804 if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5784_AX)
10728 tp->pci_chip_rev_id == CHIPREV_ID_5784_A1) 10805 tp->led_ctrl = LED_CTRL_MODE_PHY_1;
10729 tp->led_ctrl = LED_CTRL_MODE_MAC;
10730 10806
10731 if (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP) { 10807 if (nic_cfg & NIC_SRAM_DATA_CFG_EEPROM_WP) {
10732 tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT; 10808 tp->tg3_flags |= TG3_FLAG_EEPROM_WRITE_PROT;
@@ -10773,6 +10849,55 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
10773 } 10849 }
10774} 10850}
10775 10851
10852static int __devinit tg3_issue_otp_command(struct tg3 *tp, u32 cmd)
10853{
10854 int i;
10855 u32 val;
10856
10857 tw32(OTP_CTRL, cmd | OTP_CTRL_OTP_CMD_START);
10858 tw32(OTP_CTRL, cmd);
10859
10860 /* Wait for up to 1 ms for command to execute. */
10861 for (i = 0; i < 100; i++) {
10862 val = tr32(OTP_STATUS);
10863 if (val & OTP_STATUS_CMD_DONE)
10864 break;
10865 udelay(10);
10866 }
10867
10868 return (val & OTP_STATUS_CMD_DONE) ? 0 : -EBUSY;
10869}
10870
10871/* Read the gphy configuration from the OTP region of the chip. The gphy
10872 * configuration is a 32-bit value that straddles the alignment boundary.
10873 * We do two 32-bit reads and then shift and merge the results.
10874 */
10875static u32 __devinit tg3_read_otp_phycfg(struct tg3 *tp)
10876{
10877 u32 bhalf_otp, thalf_otp;
10878
10879 tw32(OTP_MODE, OTP_MODE_OTP_THRU_GRC);
10880
10881 if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_INIT))
10882 return 0;
10883
10884 tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC1);
10885
10886 if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ))
10887 return 0;
10888
10889 thalf_otp = tr32(OTP_READ_DATA);
10890
10891 tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC2);
10892
10893 if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ))
10894 return 0;
10895
10896 bhalf_otp = tr32(OTP_READ_DATA);
10897
10898 return ((thalf_otp & 0x0000ffff) << 16) | (bhalf_otp >> 16);
10899}
10900
10776static int __devinit tg3_phy_probe(struct tg3 *tp) 10901static int __devinit tg3_phy_probe(struct tg3 *tp)
10777{ 10902{
10778 u32 hw_phy_id_1, hw_phy_id_2; 10903 u32 hw_phy_id_1, hw_phy_id_2;
@@ -11586,6 +11711,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
11586 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG; 11711 tp->tg3_flags2 |= TG3_FLG2_PHY_BER_BUG;
11587 } 11712 }
11588 11713
11714 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 &&
11715 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5784_AX) {
11716 tp->phy_otp = tg3_read_otp_phycfg(tp);
11717 if (tp->phy_otp == 0)
11718 tp->phy_otp = TG3_OTP_DEFAULT;
11719 }
11720
11589 tp->coalesce_mode = 0; 11721 tp->coalesce_mode = 0;
11590 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX && 11722 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX &&
11591 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX) 11723 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX)
@@ -12446,7 +12578,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
12446 const struct pci_device_id *ent) 12578 const struct pci_device_id *ent)
12447{ 12579{
12448 static int tg3_version_printed = 0; 12580 static int tg3_version_printed = 0;
12449 unsigned long tg3reg_base, tg3reg_len; 12581 resource_size_t tg3reg_base;
12582 unsigned long tg3reg_len;
12450 struct net_device *dev; 12583 struct net_device *dev;
12451 struct tg3 *tp; 12584 struct tg3 *tp;
12452 int err, pm_cap; 12585 int err, pm_cap;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 3938eb35ce8c..c1075a73d66c 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -138,6 +138,8 @@
138#define CHIPREV_5704_BX 0x21 138#define CHIPREV_5704_BX 0x21
139#define CHIPREV_5750_AX 0x40 139#define CHIPREV_5750_AX 0x40
140#define CHIPREV_5750_BX 0x41 140#define CHIPREV_5750_BX 0x41
141#define CHIPREV_5784_AX 0x57840
142#define CHIPREV_5761_AX 0x57610
141#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) 143#define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff)
142#define METAL_REV_A0 0x00 144#define METAL_REV_A0 0x00
143#define METAL_REV_A1 0x01 145#define METAL_REV_A1 0x01
@@ -866,6 +868,7 @@
866#define CPMU_CTRL_LINK_IDLE_MODE 0x00000200 868#define CPMU_CTRL_LINK_IDLE_MODE 0x00000200
867#define CPMU_CTRL_LINK_AWARE_MODE 0x00000400 869#define CPMU_CTRL_LINK_AWARE_MODE 0x00000400
868#define CPMU_CTRL_LINK_SPEED_MODE 0x00004000 870#define CPMU_CTRL_LINK_SPEED_MODE 0x00004000
871#define CPMU_CTRL_GPHY_10MB_RXONLY 0x00010000
869#define TG3_CPMU_LSPD_10MB_CLK 0x00003604 872#define TG3_CPMU_LSPD_10MB_CLK 0x00003604
870#define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000 873#define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000
871#define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000 874#define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000
@@ -1559,7 +1562,24 @@
1559/* 0x702c unused */ 1562/* 0x702c unused */
1560 1563
1561#define NVRAM_ADDR_LOCKOUT 0x00007030 1564#define NVRAM_ADDR_LOCKOUT 0x00007030
1562/* 0x7034 --> 0x7c00 unused */ 1565/* 0x7034 --> 0x7500 unused */
1566
1567#define OTP_MODE 0x00007500
1568#define OTP_MODE_OTP_THRU_GRC 0x00000001
1569#define OTP_CTRL 0x00007504
1570#define OTP_CTRL_OTP_PROG_ENABLE 0x00200000
1571#define OTP_CTRL_OTP_CMD_READ 0x00000000
1572#define OTP_CTRL_OTP_CMD_INIT 0x00000008
1573#define OTP_CTRL_OTP_CMD_START 0x00000001
1574#define OTP_STATUS 0x00007508
1575#define OTP_STATUS_CMD_DONE 0x00000001
1576#define OTP_ADDRESS 0x0000750c
1577#define OTP_ADDRESS_MAGIC1 0x000000a0
1578#define OTP_ADDRESS_MAGIC2 0x00000080
1579/* 0x7510 unused */
1580
1581#define OTP_READ_DATA 0x00007514
1582/* 0x7518 --> 0x7c04 unused */
1563 1583
1564#define PCIE_TRANSACTION_CFG 0x00007c04 1584#define PCIE_TRANSACTION_CFG 0x00007c04
1565#define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000 1585#define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000
@@ -1568,6 +1588,28 @@
1568#define PCIE_PWR_MGMT_THRESH 0x00007d28 1588#define PCIE_PWR_MGMT_THRESH 0x00007d28
1569#define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00 1589#define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00
1570 1590
1591
1592/* OTP bit definitions */
1593#define TG3_OTP_AGCTGT_MASK 0x000000e0
1594#define TG3_OTP_AGCTGT_SHIFT 1
1595#define TG3_OTP_HPFFLTR_MASK 0x00000300
1596#define TG3_OTP_HPFFLTR_SHIFT 1
1597#define TG3_OTP_HPFOVER_MASK 0x00000400
1598#define TG3_OTP_HPFOVER_SHIFT 1
1599#define TG3_OTP_LPFDIS_MASK 0x00000800
1600#define TG3_OTP_LPFDIS_SHIFT 11
1601#define TG3_OTP_VDAC_MASK 0xff000000
1602#define TG3_OTP_VDAC_SHIFT 24
1603#define TG3_OTP_10BTAMP_MASK 0x0000f000
1604#define TG3_OTP_10BTAMP_SHIFT 8
1605#define TG3_OTP_ROFF_MASK 0x00e00000
1606#define TG3_OTP_ROFF_SHIFT 11
1607#define TG3_OTP_RCOFF_MASK 0x001c0000
1608#define TG3_OTP_RCOFF_SHIFT 16
1609
1610#define TG3_OTP_DEFAULT 0x286c1640
1611
1612
1571#define TG3_EEPROM_MAGIC 0x669955aa 1613#define TG3_EEPROM_MAGIC 0x669955aa
1572#define TG3_EEPROM_MAGIC_FW 0xa5000000 1614#define TG3_EEPROM_MAGIC_FW 0xa5000000
1573#define TG3_EEPROM_MAGIC_FW_MSK 0xff000000 1615#define TG3_EEPROM_MAGIC_FW_MSK 0xff000000
@@ -1705,15 +1747,31 @@
1705 1747
1706#define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */ 1748#define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */
1707 1749
1708#define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */
1709#define MII_TG3_EPHY_PTEST 0x17 /* 5906 PHY register */ 1750#define MII_TG3_EPHY_PTEST 0x17 /* 5906 PHY register */
1751#define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */
1752
1753#define MII_TG3_DSP_TAP1 0x0001
1754#define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007
1755#define MII_TG3_DSP_AADJ1CH0 0x001f
1756#define MII_TG3_DSP_AADJ1CH3 0x601f
1757#define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002
1758#define MII_TG3_DSP_EXP8 0x0708
1759#define MII_TG3_DSP_EXP8_REJ2MHz 0x0001
1760#define MII_TG3_DSP_EXP8_AEDW 0x0200
1761#define MII_TG3_DSP_EXP75 0x0f75
1762#define MII_TG3_DSP_EXP96 0x0f96
1763#define MII_TG3_DSP_EXP97 0x0f97
1710 1764
1711#define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ 1765#define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */
1712 1766
1713#define MII_TG3_AUXCTL_MISC_WREN 0x8000 1767#define MII_TG3_AUXCTL_MISC_WREN 0x8000
1714#define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 1768#define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200
1715#define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000 1769#define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000
1716#define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007 1770#define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007
1771
1772#define MII_TG3_AUXCTL_ACTL_SMDSP_ENA 0x0800
1773#define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400
1774#define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000
1717 1775
1718#define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ 1776#define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */
1719#define MII_TG3_AUX_STAT_LPASS 0x0004 1777#define MII_TG3_AUX_STAT_LPASS 0x0004
@@ -1743,6 +1801,20 @@
1743#define MII_TG3_INT_DUPLEXCHG 0x0008 1801#define MII_TG3_INT_DUPLEXCHG 0x0008
1744#define MII_TG3_INT_ANEG_PAGE_RX 0x0400 1802#define MII_TG3_INT_ANEG_PAGE_RX 0x0400
1745 1803
1804#define MII_TG3_MISC_SHDW 0x1c
1805#define MII_TG3_MISC_SHDW_WREN 0x8000
1806#define MII_TG3_MISC_SHDW_SCR5_SEL 0x1400
1807#define MII_TG3_MISC_SHDW_APD_SEL 0x2800
1808
1809#define MII_TG3_MISC_SHDW_SCR5_C125OE 0x0001
1810#define MII_TG3_MISC_SHDW_SCR5_DLLAPD 0x0002
1811#define MII_TG3_MISC_SHDW_SCR5_SDTL 0x0004
1812#define MII_TG3_MISC_SHDW_SCR5_DLPTLM 0x0008
1813#define MII_TG3_MISC_SHDW_SCR5_LPED 0x0010
1814
1815#define MII_TG3_MISC_SHDW_APD_WKTM_84MS 0x0001
1816#define MII_TG3_MISC_SHDW_APD_ENABLE 0x0020
1817
1746#define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */ 1818#define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */
1747#define MII_TG3_EPHY_SHADOW_EN 0x80 1819#define MII_TG3_EPHY_SHADOW_EN 0x80
1748 1820
@@ -2473,6 +2545,7 @@ struct tg3 {
2473#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */ 2545#define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */
2474 2546
2475 u32 led_ctrl; 2547 u32 led_ctrl;
2548 u32 phy_otp;
2476 u16 pci_cmd; 2549 u16 pci_cmd;
2477 2550
2478 char board_part_number[24]; 2551 char board_part_number[24];
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index 433c994ea9d8..0ab51a0f35fc 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -117,7 +117,7 @@
117 * Official releases will only have an a.b.c version number format. 117 * Official releases will only have an a.b.c version number format.
118 */ 118 */
119 119
120static char version[] __devinitdata = 120static char version[] =
121"Olympic.c v1.0.5 6/04/02 - Peter De Schrijver & Mike Phillips" ; 121"Olympic.c v1.0.5 6/04/02 - Peter De Schrijver & Mike Phillips" ;
122 122
123static char *open_maj_error[] = {"No error", "Lobe Media Test", "Physical Insertion", 123static char *open_maj_error[] = {"No error", "Lobe Media Test", "Physical Insertion",
@@ -290,7 +290,7 @@ op_disable_dev:
290 return i; 290 return i;
291} 291}
292 292
293static int __devinit olympic_init(struct net_device *dev) 293static int olympic_init(struct net_device *dev)
294{ 294{
295 struct olympic_private *olympic_priv; 295 struct olympic_private *olympic_priv;
296 u8 __iomem *olympic_mmio, *init_srb,*adapter_addr; 296 u8 __iomem *olympic_mmio, *init_srb,*adapter_addr;
@@ -434,7 +434,7 @@ static int __devinit olympic_init(struct net_device *dev)
434 434
435} 435}
436 436
437static int __devinit olympic_open(struct net_device *dev) 437static int olympic_open(struct net_device *dev)
438{ 438{
439 struct olympic_private *olympic_priv=netdev_priv(dev); 439 struct olympic_private *olympic_priv=netdev_priv(dev);
440 u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb; 440 u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb;
@@ -1438,13 +1438,18 @@ static void olympic_arb_cmd(struct net_device *dev)
1438 1438
1439 if (olympic_priv->olympic_network_monitor) { 1439 if (olympic_priv->olympic_network_monitor) {
1440 struct trh_hdr *mac_hdr; 1440 struct trh_hdr *mac_hdr;
1441 DECLARE_MAC_BUF(mac);
1442 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); 1441 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name);
1443 mac_hdr = tr_hdr(mac_frame); 1442 mac_hdr = tr_hdr(mac_frame);
1444 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %s\n", 1443 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: "
1445 dev->name, print_mac(mac, mac_hdr->daddr)); 1444 MAC_FMT " \n", dev->name,
1446 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %s\n", 1445 mac_hdr->daddr[0], mac_hdr->daddr[1],
1447 dev->name, print_mac(mac, mac_hdr->saddr)); 1446 mac_hdr->daddr[2], mac_hdr->daddr[3],
1447 mac_hdr->daddr[4], mac_hdr->daddr[5]);
1448 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: "
1449 MAC_FMT " \n", dev->name,
1450 mac_hdr->saddr[0], mac_hdr->saddr[1],
1451 mac_hdr->saddr[2], mac_hdr->saddr[3],
1452 mac_hdr->saddr[4], mac_hdr->saddr[5]);
1448 } 1453 }
1449 netif_rx(mac_frame); 1454 netif_rx(mac_frame);
1450 dev->last_rx = jiffies; 1455 dev->last_rx = jiffies;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7b816a032957..5b5d87585d91 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -67,9 +67,42 @@
67#include <asm/system.h> 67#include <asm/system.h>
68#include <asm/uaccess.h> 68#include <asm/uaccess.h>
69 69
70/* Uncomment to enable debugging */
71/* #define TUN_DEBUG 1 */
72
70#ifdef TUN_DEBUG 73#ifdef TUN_DEBUG
71static int debug; 74static int debug;
75
76#define DBG if(tun->debug)printk
77#define DBG1 if(debug==2)printk
78#else
79#define DBG( a... )
80#define DBG1( a... )
81#endif
82
83struct tun_struct {
84 struct list_head list;
85 unsigned long flags;
86 int attached;
87 uid_t owner;
88 gid_t group;
89
90 wait_queue_head_t read_wait;
91 struct sk_buff_head readq;
92
93 struct net_device *dev;
94
95 struct fasync_struct *fasync;
96
97 unsigned long if_flags;
98 u8 dev_addr[ETH_ALEN];
99 u32 chr_filter[2];
100 u32 net_filter[2];
101
102#ifdef TUN_DEBUG
103 int debug;
72#endif 104#endif
105};
73 106
74/* Network device part of the driver */ 107/* Network device part of the driver */
75 108
@@ -253,8 +286,11 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
253 return -EFAULT; 286 return -EFAULT;
254 } 287 }
255 288
256 if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) 289 if ((tun->flags & TUN_TYPE_MASK) == TUN_TAP_DEV) {
257 align = NET_IP_ALIGN; 290 align = NET_IP_ALIGN;
291 if (unlikely(len < ETH_HLEN))
292 return -EINVAL;
293 }
258 294
259 if (!(skb = alloc_skb(len + align, GFP_KERNEL))) { 295 if (!(skb = alloc_skb(len + align, GFP_KERNEL))) {
260 tun->dev->stats.rx_dropped++; 296 tun->dev->stats.rx_dropped++;
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 8cc316653a39..0ee4c168e4c0 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3833,6 +3833,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3833 struct device_node *phy; 3833 struct device_node *phy;
3834 int err, ucc_num, max_speed = 0; 3834 int err, ucc_num, max_speed = 0;
3835 const phandle *ph; 3835 const phandle *ph;
3836 const u32 *fixed_link;
3836 const unsigned int *prop; 3837 const unsigned int *prop;
3837 const char *sprop; 3838 const char *sprop;
3838 const void *mac_addr; 3839 const void *mac_addr;
@@ -3923,18 +3924,38 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3923 3924
3924 ug_info->uf_info.regs = res.start; 3925 ug_info->uf_info.regs = res.start;
3925 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0); 3926 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
3927 fixed_link = of_get_property(np, "fixed-link", NULL);
3928 if (fixed_link) {
3929 ug_info->mdio_bus = 0;
3930 ug_info->phy_address = fixed_link[0];
3931 phy = NULL;
3932 } else {
3933 ph = of_get_property(np, "phy-handle", NULL);
3934 phy = of_find_node_by_phandle(*ph);
3926 3935
3927 ph = of_get_property(np, "phy-handle", NULL); 3936 if (phy == NULL)
3928 phy = of_find_node_by_phandle(*ph); 3937 return -ENODEV;
3929 3938
3930 if (phy == NULL) 3939 /* set the PHY address */
3931 return -ENODEV; 3940 prop = of_get_property(phy, "reg", NULL);
3941 if (prop == NULL)
3942 return -1;
3943 ug_info->phy_address = *prop;
3944
3945 /* Set the bus id */
3946 mdio = of_get_parent(phy);
3947
3948 if (mdio == NULL)
3949 return -1;
3932 3950
3933 /* set the PHY address */ 3951 err = of_address_to_resource(mdio, 0, &res);
3934 prop = of_get_property(phy, "reg", NULL); 3952 of_node_put(mdio);
3935 if (prop == NULL) 3953
3936 return -1; 3954 if (err)
3937 ug_info->phy_address = *prop; 3955 return -1;
3956
3957 ug_info->mdio_bus = res.start;
3958 }
3938 3959
3939 /* get the phy interface type, or default to MII */ 3960 /* get the phy interface type, or default to MII */
3940 prop = of_get_property(np, "phy-connection-type", NULL); 3961 prop = of_get_property(np, "phy-connection-type", NULL);
@@ -3979,20 +4000,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
3979 ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4; 4000 ug_info->numThreadsRx = UCC_GETH_NUM_OF_THREADS_4;
3980 } 4001 }
3981 4002
3982 /* Set the bus id */
3983 mdio = of_get_parent(phy);
3984
3985 if (mdio == NULL)
3986 return -1;
3987
3988 err = of_address_to_resource(mdio, 0, &res);
3989 of_node_put(mdio);
3990
3991 if (err)
3992 return -1;
3993
3994 ug_info->mdio_bus = res.start;
3995
3996 if (netif_msg_probe(&debug)) 4003 if (netif_msg_probe(&debug))
3997 printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x (irq = %d) \n", 4004 printk(KERN_INFO "ucc_geth: UCC%1d at 0x%8x (irq = %d) \n",
3998 ug_info->uf_info.ucc_num + 1, ug_info->uf_info.regs, 4005 ug_info->uf_info.ucc_num + 1, ug_info->uf_info.regs,
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index b58472cf76f8..555b70c8b863 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -234,11 +234,12 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
234 struct scatterlist sg[1+MAX_SKB_FRAGS]; 234 struct scatterlist sg[1+MAX_SKB_FRAGS];
235 struct virtio_net_hdr *hdr; 235 struct virtio_net_hdr *hdr;
236 const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; 236 const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
237 DECLARE_MAC_BUF(mac);
238 237
239 sg_init_table(sg, 1+MAX_SKB_FRAGS); 238 sg_init_table(sg, 1+MAX_SKB_FRAGS);
240 239
241 pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest)); 240 pr_debug("%s: xmit %p " MAC_FMT "\n", dev->name, skb,
241 dest[0], dest[1], dest[2],
242 dest[3], dest[4], dest[5]);
242 243
243 /* Encode metadata header at front. */ 244 /* Encode metadata header at front. */
244 hdr = skb_vnet_hdr(skb); 245 hdr = skb_vnet_hdr(skb);
@@ -284,7 +285,6 @@ again:
284 /* Activate callback for using skbs: if this returns false it 285 /* Activate callback for using skbs: if this returns false it
285 * means some were used in the meantime. */ 286 * means some were used in the meantime. */
286 if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) { 287 if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
287 printk("Unlikely: restart svq race\n");
288 vi->svq->vq_ops->disable_cb(vi->svq); 288 vi->svq->vq_ops->disable_cb(vi->svq);
289 netif_start_queue(dev); 289 netif_start_queue(dev);
290 goto again; 290 goto again;
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index a3df09ee729f..8005dd16fb4e 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -150,9 +150,13 @@ config HDLC_FR
150 150
151config HDLC_PPP 151config HDLC_PPP
152 tristate "Synchronous Point-to-Point Protocol (PPP) support" 152 tristate "Synchronous Point-to-Point Protocol (PPP) support"
153 depends on HDLC 153 depends on HDLC && BROKEN
154 help 154 help
155 Generic HDLC driver supporting PPP over WAN connections. 155 Generic HDLC driver supporting PPP over WAN connections.
156 This module is currently broken and will cause a kernel panic
157 when a device configured in PPP mode is activated.
158
159 It will be replaced by new PPP implementation in Linux 2.6.26.
156 160
157 If unsure, say N. 161 If unsure, say N.
158 162
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index 49978bdb4324..4fd73809602e 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -635,7 +635,6 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
635{ 635{
636 struct ieee80211_hdr_4addr *hdr; 636 struct ieee80211_hdr_4addr *hdr;
637 int res, hdrlen; 637 int res, hdrlen;
638 DECLARE_MAC_BUF(mac);
639 638
640 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 639 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
641 return 0; 640 return 0;
@@ -647,8 +646,10 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
647 strcmp(crypt->ops->name, "TKIP") == 0) { 646 strcmp(crypt->ops->name, "TKIP") == 0) {
648 if (net_ratelimit()) { 647 if (net_ratelimit()) {
649 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 648 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
650 "received packet from %s\n", 649 "received packet from " MAC_FMT "\n",
651 local->dev->name, print_mac(mac, hdr->addr2)); 650 local->dev->name,
651 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
652 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
652 } 653 }
653 return -1; 654 return -1;
654 } 655 }
@@ -657,9 +658,12 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
657 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 658 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
658 atomic_dec(&crypt->refcnt); 659 atomic_dec(&crypt->refcnt);
659 if (res < 0) { 660 if (res < 0) {
660 printk(KERN_DEBUG "%s: decryption failed (SA=%s" 661 printk(KERN_DEBUG "%s: decryption failed (SA=" MAC_FMT
661 ") res=%d\n", 662 ") res=%d\n",
662 local->dev->name, print_mac(mac, hdr->addr2), res); 663 local->dev->name,
664 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
665 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
666 res);
663 local->comm_tallies.rx_discards_wep_undecryptable++; 667 local->comm_tallies.rx_discards_wep_undecryptable++;
664 return -1; 668 return -1;
665 } 669 }
@@ -721,7 +725,6 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
721 struct ieee80211_crypt_data *crypt = NULL; 725 struct ieee80211_crypt_data *crypt = NULL;
722 void *sta = NULL; 726 void *sta = NULL;
723 int keyidx = 0; 727 int keyidx = 0;
724 DECLARE_MAC_BUF(mac);
725 728
726 iface = netdev_priv(dev); 729 iface = netdev_priv(dev);
727 local = iface->local; 730 local = iface->local;
@@ -798,8 +801,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
798 * frames silently instead of filling system log with 801 * frames silently instead of filling system log with
799 * these reports. */ 802 * these reports. */
800 printk(KERN_DEBUG "%s: WEP decryption failed (not set)" 803 printk(KERN_DEBUG "%s: WEP decryption failed (not set)"
801 " (SA=%s)\n", 804 " (SA=" MAC_FMT ")\n",
802 local->dev->name, print_mac(mac, hdr->addr2)); 805 local->dev->name,
806 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
807 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
803#endif 808#endif
804 local->comm_tallies.rx_discards_wep_undecryptable++; 809 local->comm_tallies.rx_discards_wep_undecryptable++;
805 goto rx_dropped; 810 goto rx_dropped;
@@ -813,8 +818,9 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
813 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) 818 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0)
814 { 819 {
815 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 820 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
816 "from %s\n", dev->name, 821 "from " MAC_FMT "\n", dev->name,
817 print_mac(mac, hdr->addr2)); 822 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
823 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
818 /* TODO: could inform hostapd about this so that it 824 /* TODO: could inform hostapd about this so that it
819 * could send auth failure report */ 825 * could send auth failure report */
820 goto rx_dropped; 826 goto rx_dropped;
@@ -982,8 +988,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
982 "unencrypted EAPOL frame\n", local->dev->name); 988 "unencrypted EAPOL frame\n", local->dev->name);
983 } else { 989 } else {
984 printk(KERN_DEBUG "%s: encryption configured, but RX " 990 printk(KERN_DEBUG "%s: encryption configured, but RX "
985 "frame not encrypted (SA=%s)\n", 991 "frame not encrypted (SA=" MAC_FMT ")\n",
986 local->dev->name, print_mac(mac, hdr->addr2)); 992 local->dev->name,
993 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
994 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
987 goto rx_dropped; 995 goto rx_dropped;
988 } 996 }
989 } 997 }
@@ -992,9 +1000,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
992 !hostap_is_eapol_frame(local, skb)) { 1000 !hostap_is_eapol_frame(local, skb)) {
993 if (net_ratelimit()) { 1001 if (net_ratelimit()) {
994 printk(KERN_DEBUG "%s: dropped unencrypted RX data " 1002 printk(KERN_DEBUG "%s: dropped unencrypted RX data "
995 "frame from %s" 1003 "frame from " MAC_FMT " (drop_unencrypted=1)\n",
996 " (drop_unencrypted=1)\n", 1004 dev->name,
997 dev->name, print_mac(mac, hdr->addr2)); 1005 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1006 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
998 } 1007 }
999 goto rx_dropped; 1008 goto rx_dropped;
1000 } 1009 }
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index e7afc3ec3e6d..921c984416f8 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -314,7 +314,6 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
314 struct ieee80211_hdr_4addr *hdr; 314 struct ieee80211_hdr_4addr *hdr;
315 u16 fc; 315 u16 fc;
316 int prefix_len, postfix_len, hdr_len, res; 316 int prefix_len, postfix_len, hdr_len, res;
317 DECLARE_MAC_BUF(mac);
318 317
319 iface = netdev_priv(skb->dev); 318 iface = netdev_priv(skb->dev);
320 local = iface->local; 319 local = iface->local;
@@ -329,8 +328,10 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
329 hdr = (struct ieee80211_hdr_4addr *) skb->data; 328 hdr = (struct ieee80211_hdr_4addr *) skb->data;
330 if (net_ratelimit()) { 329 if (net_ratelimit()) {
331 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 330 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
332 "TX packet to %s\n", 331 "TX packet to " MAC_FMT "\n",
333 local->dev->name, print_mac(mac, hdr->addr1)); 332 local->dev->name,
333 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
334 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
334 } 335 }
335 kfree_skb(skb); 336 kfree_skb(skb);
336 return NULL; 337 return NULL;
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index ad040a3bb8a7..0acd9589c48c 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -632,7 +632,6 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
632 __le16 *pos; 632 __le16 *pos;
633 struct sta_info *sta = NULL; 633 struct sta_info *sta = NULL;
634 char *txt = NULL; 634 char *txt = NULL;
635 DECLARE_MAC_BUF(mac);
636 635
637 if (ap->local->hostapd) { 636 if (ap->local->hostapd) {
638 dev_kfree_skb(skb); 637 dev_kfree_skb(skb);
@@ -684,10 +683,12 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
684 if (sta) 683 if (sta)
685 atomic_dec(&sta->users); 684 atomic_dec(&sta->users);
686 if (txt) { 685 if (txt) {
687 PDEBUG(DEBUG_AP, "%s: %s auth_cb - alg=%d " 686 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth_cb - alg=%d "
688 "trans#=%d status=%d - %s\n", 687 "trans#=%d status=%d - %s\n",
689 dev->name, print_mac(mac, hdr->addr1), auth_alg, 688 dev->name,
690 auth_transaction, status, txt); 689 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
690 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
691 auth_alg, auth_transaction, status, txt);
691 } 692 }
692 dev_kfree_skb(skb); 693 dev_kfree_skb(skb);
693} 694}
@@ -703,7 +704,6 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
703 __le16 *pos; 704 __le16 *pos;
704 struct sta_info *sta = NULL; 705 struct sta_info *sta = NULL;
705 char *txt = NULL; 706 char *txt = NULL;
706 DECLARE_MAC_BUF(mac);
707 707
708 if (ap->local->hostapd) { 708 if (ap->local->hostapd) {
709 dev_kfree_skb(skb); 709 dev_kfree_skb(skb);
@@ -754,8 +754,11 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
754 if (sta) 754 if (sta)
755 atomic_dec(&sta->users); 755 atomic_dec(&sta->users);
756 if (txt) { 756 if (txt) {
757 PDEBUG(DEBUG_AP, "%s: %s assoc_cb - %s\n", 757 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " assoc_cb - %s\n",
758 dev->name, print_mac(mac, hdr->addr1), txt); 758 dev->name,
759 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
760 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
761 txt);
759 } 762 }
760 dev_kfree_skb(skb); 763 dev_kfree_skb(skb);
761} 764}
@@ -767,7 +770,6 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
767 struct ap_data *ap = data; 770 struct ap_data *ap = data;
768 struct ieee80211_hdr_4addr *hdr; 771 struct ieee80211_hdr_4addr *hdr;
769 struct sta_info *sta; 772 struct sta_info *sta;
770 DECLARE_MAC_BUF(mac);
771 773
772 if (skb->len < 24) 774 if (skb->len < 24)
773 goto fail; 775 goto fail;
@@ -779,9 +781,11 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
779 sta->flags &= ~WLAN_STA_PENDING_POLL; 781 sta->flags &= ~WLAN_STA_PENDING_POLL;
780 spin_unlock(&ap->sta_table_lock); 782 spin_unlock(&ap->sta_table_lock);
781 } else { 783 } else {
782 PDEBUG(DEBUG_AP, "%s: STA %s" 784 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT
783 " did not ACK activity poll frame\n", 785 " did not ACK activity poll frame\n",
784 ap->local->dev->name, print_mac(mac, hdr->addr1)); 786 ap->local->dev->name,
787 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
788 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
785 } 789 }
786 790
787 fail: 791 fail:
@@ -1306,7 +1310,6 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1306 struct sta_info *sta = NULL; 1310 struct sta_info *sta = NULL;
1307 struct ieee80211_crypt_data *crypt; 1311 struct ieee80211_crypt_data *crypt;
1308 char *txt = ""; 1312 char *txt = "";
1309 DECLARE_MAC_BUF(mac);
1310 1313
1311 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1314 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1312 1315
@@ -1315,8 +1318,9 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1315 1318
1316 if (len < 6) { 1319 if (len < 6) {
1317 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload " 1320 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload "
1318 "(len=%d) from %s\n", dev->name, len, 1321 "(len=%d) from " MAC_FMT "\n", dev->name, len,
1319 print_mac(mac, hdr->addr2)); 1322 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1323 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
1320 return; 1324 return;
1321 } 1325 }
1322 1326
@@ -1381,8 +1385,10 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1381 if (time_after(jiffies, sta->u.ap.last_beacon + 1385 if (time_after(jiffies, sta->u.ap.last_beacon +
1382 (10 * sta->listen_interval * HZ) / 1024)) { 1386 (10 * sta->listen_interval * HZ) / 1024)) {
1383 PDEBUG(DEBUG_AP, "%s: no beacons received for a while," 1387 PDEBUG(DEBUG_AP, "%s: no beacons received for a while,"
1384 " assuming AP %s is now STA\n", 1388 " assuming AP " MAC_FMT " is now STA\n",
1385 dev->name, print_mac(mac, sta->addr)); 1389 dev->name,
1390 sta->addr[0], sta->addr[1], sta->addr[2],
1391 sta->addr[3], sta->addr[4], sta->addr[5]);
1386 sta->ap = 0; 1392 sta->ap = 0;
1387 sta->flags = 0; 1393 sta->flags = 0;
1388 sta->u.sta.challenge = NULL; 1394 sta->u.sta.challenge = NULL;
@@ -1497,10 +1503,13 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1497 } 1503 }
1498 1504
1499 if (resp) { 1505 if (resp) {
1500 PDEBUG(DEBUG_AP, "%s: %s auth (alg=%d " 1506 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth (alg=%d "
1501 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n", 1507 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n",
1502 dev->name, print_mac(mac, hdr->addr2), auth_alg, 1508 dev->name,
1503 auth_transaction, status_code, len, fc, resp, txt); 1509 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1510 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1511 auth_alg, auth_transaction, status_code, len,
1512 fc, resp, txt);
1504 } 1513 }
1505} 1514}
1506 1515
@@ -1519,14 +1528,15 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1519 int send_deauth = 0; 1528 int send_deauth = 0;
1520 char *txt = ""; 1529 char *txt = "";
1521 u8 prev_ap[ETH_ALEN]; 1530 u8 prev_ap[ETH_ALEN];
1522 DECLARE_MAC_BUF(mac);
1523 1531
1524 left = len = skb->len - IEEE80211_MGMT_HDR_LEN; 1532 left = len = skb->len - IEEE80211_MGMT_HDR_LEN;
1525 1533
1526 if (len < (reassoc ? 10 : 4)) { 1534 if (len < (reassoc ? 10 : 4)) {
1527 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload " 1535 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload "
1528 "(len=%d, reassoc=%d) from %s\n", 1536 "(len=%d, reassoc=%d) from " MAC_FMT "\n",
1529 dev->name, len, reassoc, print_mac(mac, hdr->addr2)); 1537 dev->name, len, reassoc,
1538 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1539 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
1530 return; 1540 return;
1531 } 1541 }
1532 1542
@@ -1603,9 +1613,12 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1603 } 1613 }
1604 1614
1605 if (left > 0) { 1615 if (left > 0) {
1606 PDEBUG(DEBUG_AP, "%s: assoc from %s" 1616 PDEBUG(DEBUG_AP, "%s: assoc from " MAC_FMT
1607 " with extra data (%d bytes) [", 1617 " with extra data (%d bytes) [",
1608 dev->name, print_mac(mac, hdr->addr2), left); 1618 dev->name,
1619 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1620 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1621 left);
1609 while (left > 0) { 1622 while (left > 0) {
1610 PDEBUG2(DEBUG_AP, "<%02x>", *u); 1623 PDEBUG2(DEBUG_AP, "<%02x>", *u);
1611 u++; left--; 1624 u++; left--;
@@ -1704,10 +1717,15 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1704 } 1717 }
1705 1718
1706#if 0 1719#if 0
1707 PDEBUG(DEBUG_AP, "%s: %s %sassoc (len=%d " 1720 PDEBUG(DEBUG_AP, "%s: " MAC_FMT" %sassoc (len=%d "
1708 "prev_ap=%s) => %d(%d) (%s)\n", 1721 "prev_ap=" MAC_FMT") => %d(%d) (%s)\n",
1709 dev->name, print_mac(mac, hdr->addr2), reassoc ? "re" : "", len, 1722 dev->name,
1710 print_mac(mac, prev_ap), resp, send_deauth, txt); 1723 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1724 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1725 reassoc ? "re" : "", len,
1726 prev_ap[0], prev_ap[1], prev_ap[2],
1727 prev_ap[3], prev_ap[4], prev_ap[5],
1728 resp, send_deauth, txt);
1711#endif 1729#endif
1712} 1730}
1713 1731
@@ -1735,9 +1753,11 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1735 pos = (__le16 *) body; 1753 pos = (__le16 *) body;
1736 reason_code = le16_to_cpu(*pos); 1754 reason_code = le16_to_cpu(*pos);
1737 1755
1738 PDEBUG(DEBUG_AP, "%s: deauthentication: %s len=%d, " 1756 PDEBUG(DEBUG_AP, "%s: deauthentication: " MAC_FMT " len=%d, "
1739 "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, 1757 "reason_code=%d\n", dev->name,
1740 reason_code); 1758 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1759 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1760 len, reason_code);
1741 1761
1742 spin_lock_bh(&local->ap->sta_table_lock); 1762 spin_lock_bh(&local->ap->sta_table_lock);
1743 sta = ap_get_sta(local->ap, hdr->addr2); 1763 sta = ap_get_sta(local->ap, hdr->addr2);
@@ -1748,9 +1768,11 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1748 } 1768 }
1749 spin_unlock_bh(&local->ap->sta_table_lock); 1769 spin_unlock_bh(&local->ap->sta_table_lock);
1750 if (sta == NULL) { 1770 if (sta == NULL) {
1751 printk("%s: deauthentication from %s, " 1771 printk("%s: deauthentication from " MAC_FMT ", "
1752 "reason_code=%d, but STA not authenticated\n", dev->name, 1772 "reason_code=%d, but STA not authenticated\n", dev->name,
1753 print_mac(mac, hdr->addr2), reason_code); 1773 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1774 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1775 reason_code);
1754 } 1776 }
1755} 1777}
1756 1778
@@ -1766,7 +1788,6 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1766 u16 reason_code; 1788 u16 reason_code;
1767 __le16 *pos; 1789 __le16 *pos;
1768 struct sta_info *sta = NULL; 1790 struct sta_info *sta = NULL;
1769 DECLARE_MAC_BUF(mac);
1770 1791
1771 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1792 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1772 1793
@@ -1778,9 +1799,11 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1778 pos = (__le16 *) body; 1799 pos = (__le16 *) body;
1779 reason_code = le16_to_cpu(*pos); 1800 reason_code = le16_to_cpu(*pos);
1780 1801
1781 PDEBUG(DEBUG_AP, "%s: disassociation: %s len=%d, " 1802 PDEBUG(DEBUG_AP, "%s: disassociation: " MAC_FMT " len=%d, "
1782 "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, 1803 "reason_code=%d\n", dev->name,
1783 reason_code); 1804 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1805 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1806 len, reason_code);
1784 1807
1785 spin_lock_bh(&local->ap->sta_table_lock); 1808 spin_lock_bh(&local->ap->sta_table_lock);
1786 sta = ap_get_sta(local->ap, hdr->addr2); 1809 sta = ap_get_sta(local->ap, hdr->addr2);
@@ -1791,9 +1814,12 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1791 } 1814 }
1792 spin_unlock_bh(&local->ap->sta_table_lock); 1815 spin_unlock_bh(&local->ap->sta_table_lock);
1793 if (sta == NULL) { 1816 if (sta == NULL) {
1794 printk("%s: disassociation from %s, " 1817 printk("%s: disassociation from " MAC_FMT ", "
1795 "reason_code=%d, but STA not authenticated\n", 1818 "reason_code=%d, but STA not authenticated\n",
1796 dev->name, print_mac(mac, hdr->addr2), reason_code); 1819 dev->name,
1820 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1821 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1822 reason_code);
1797 } 1823 }
1798} 1824}
1799 1825
@@ -1882,16 +1908,20 @@ static void handle_pspoll(local_info_t *local,
1882 struct sta_info *sta; 1908 struct sta_info *sta;
1883 u16 aid; 1909 u16 aid;
1884 struct sk_buff *skb; 1910 struct sk_buff *skb;
1885 DECLARE_MAC_BUF(mac);
1886 1911
1887 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=%s" 1912 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=" MAC_FMT
1888 ", TA=%s PWRMGT=%d\n", 1913 ", TA=" MAC_FMT " PWRMGT=%d\n",
1889 print_mac(mac, hdr->addr1), print_mac(mac, hdr->addr2), 1914 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
1915 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
1916 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1917 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1890 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM)); 1918 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM));
1891 1919
1892 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 1920 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
1893 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=%s" 1921 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=" MAC_FMT
1894 " not own MAC\n", print_mac(mac, hdr->addr1)); 1922 " not own MAC\n",
1923 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
1924 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
1895 return; 1925 return;
1896 } 1926 }
1897 1927
@@ -1969,7 +1999,6 @@ static void handle_wds_oper_queue(struct work_struct *work)
1969 wds_oper_queue); 1999 wds_oper_queue);
1970 local_info_t *local = ap->local; 2000 local_info_t *local = ap->local;
1971 struct wds_oper_data *entry, *prev; 2001 struct wds_oper_data *entry, *prev;
1972 DECLARE_MAC_BUF(mac);
1973 2002
1974 spin_lock_bh(&local->lock); 2003 spin_lock_bh(&local->lock);
1975 entry = local->ap->wds_oper_entries; 2004 entry = local->ap->wds_oper_entries;
@@ -1978,10 +2007,11 @@ static void handle_wds_oper_queue(struct work_struct *work)
1978 2007
1979 while (entry) { 2008 while (entry) {
1980 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection " 2009 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection "
1981 "to AP %s\n", 2010 "to AP " MAC_FMT "\n",
1982 local->dev->name, 2011 local->dev->name,
1983 entry->type == WDS_ADD ? "adding" : "removing", 2012 entry->type == WDS_ADD ? "adding" : "removing",
1984 print_mac(mac, entry->addr)); 2013 entry->addr[0], entry->addr[1], entry->addr[2],
2014 entry->addr[3], entry->addr[4], entry->addr[5]);
1985 if (entry->type == WDS_ADD) 2015 if (entry->type == WDS_ADD)
1986 prism2_wds_add(local, entry->addr, 0); 2016 prism2_wds_add(local, entry->addr, 0);
1987 else if (entry->type == WDS_DEL) 2017 else if (entry->type == WDS_DEL)
@@ -2158,7 +2188,6 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2158#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 2188#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
2159 u16 fc, type, stype; 2189 u16 fc, type, stype;
2160 struct ieee80211_hdr_4addr *hdr; 2190 struct ieee80211_hdr_4addr *hdr;
2161 DECLARE_MAC_BUF(mac);
2162 2191
2163 /* FIX: should give skb->len to handler functions and check that the 2192 /* FIX: should give skb->len to handler functions and check that the
2164 * buffer is long enough */ 2193 * buffer is long enough */
@@ -2187,8 +2216,9 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2187 2216
2188 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2217 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
2189 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=" 2218 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)="
2190 "%s not own MAC\n", 2219 MAC_FMT " not own MAC\n",
2191 print_mac(mac, hdr->addr1)); 2220 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2221 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2192 goto done; 2222 goto done;
2193 } 2223 }
2194 2224
@@ -2224,14 +2254,18 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2224 } 2254 }
2225 2255
2226 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2256 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
2227 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=%s" 2257 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=" MAC_FMT
2228 " not own MAC\n", print_mac(mac, hdr->addr1)); 2258 " not own MAC\n",
2259 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2260 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2229 goto done; 2261 goto done;
2230 } 2262 }
2231 2263
2232 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) { 2264 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) {
2233 PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=%s" 2265 PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=" MAC_FMT
2234 " not own MAC\n", print_mac(mac, hdr->addr3)); 2266 " not own MAC\n",
2267 hdr->addr3[0], hdr->addr3[1], hdr->addr3[2],
2268 hdr->addr3[3], hdr->addr3[4], hdr->addr3[5]);
2235 goto done; 2269 goto done;
2236 } 2270 }
2237 2271
@@ -2312,7 +2346,6 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2312 struct sk_buff *skb; 2346 struct sk_buff *skb;
2313 struct ieee80211_hdr_4addr *hdr; 2347 struct ieee80211_hdr_4addr *hdr;
2314 struct hostap_80211_rx_status rx_stats; 2348 struct hostap_80211_rx_status rx_stats;
2315 DECLARE_MAC_BUF(mac);
2316 2349
2317 if (skb_queue_empty(&sta->tx_buf)) 2350 if (skb_queue_empty(&sta->tx_buf))
2318 return; 2351 return;
@@ -2334,7 +2367,9 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2334 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); 2367 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14));
2335 2368
2336 PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA " 2369 PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA "
2337 "%s\n", local->dev->name, print_mac(mac, sta->addr)); 2370 MAC_FMT "\n", local->dev->name,
2371 sta->addr[0], sta->addr[1], sta->addr[2],
2372 sta->addr[3], sta->addr[4], sta->addr[5]);
2338 2373
2339 skb->dev = local->dev; 2374 skb->dev = local->dev;
2340 2375
@@ -2661,7 +2696,6 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
2661 int ret = sta->tx_rate; 2696 int ret = sta->tx_rate;
2662 struct hostap_interface *iface; 2697 struct hostap_interface *iface;
2663 local_info_t *local; 2698 local_info_t *local;
2664 DECLARE_MAC_BUF(mac);
2665 2699
2666 iface = netdev_priv(dev); 2700 iface = netdev_priv(dev);
2667 local = iface->local; 2701 local = iface->local;
@@ -2689,9 +2723,12 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
2689 case 3: sta->tx_rate = 110; break; 2723 case 3: sta->tx_rate = 110; break;
2690 default: sta->tx_rate = 0; break; 2724 default: sta->tx_rate = 0; break;
2691 } 2725 }
2692 PDEBUG(DEBUG_AP, "%s: STA %s" 2726 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT
2693 " TX rate raised to %d\n", 2727 " TX rate raised to %d\n",
2694 dev->name, print_mac(mac, sta->addr), sta->tx_rate); 2728 dev->name,
2729 sta->addr[0], sta->addr[1], sta->addr[2],
2730 sta->addr[3], sta->addr[4], sta->addr[5],
2731 sta->tx_rate);
2695 } 2732 }
2696 sta->tx_since_last_failure = 0; 2733 sta->tx_since_last_failure = 0;
2697 } 2734 }
@@ -2709,7 +2746,6 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2709 int set_tim, ret; 2746 int set_tim, ret;
2710 struct ieee80211_hdr_4addr *hdr; 2747 struct ieee80211_hdr_4addr *hdr;
2711 struct hostap_skb_tx_data *meta; 2748 struct hostap_skb_tx_data *meta;
2712 DECLARE_MAC_BUF(mac);
2713 2749
2714 meta = (struct hostap_skb_tx_data *) skb->cb; 2750 meta = (struct hostap_skb_tx_data *) skb->cb;
2715 ret = AP_TX_CONTINUE; 2751 ret = AP_TX_CONTINUE;
@@ -2745,8 +2781,9 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2745 * print out any errors here. */ 2781 * print out any errors here. */
2746 if (net_ratelimit()) { 2782 if (net_ratelimit()) {
2747 printk(KERN_DEBUG "AP: drop packet to non-associated " 2783 printk(KERN_DEBUG "AP: drop packet to non-associated "
2748 "STA %s\n", 2784 "STA " MAC_FMT "\n",
2749 print_mac(mac, hdr->addr1)); 2785 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2786 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2750 } 2787 }
2751#endif 2788#endif
2752 local->ap->tx_drop_nonassoc++; 2789 local->ap->tx_drop_nonassoc++;
@@ -2784,9 +2821,11 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2784 } 2821 }
2785 2822
2786 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { 2823 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) {
2787 PDEBUG(DEBUG_PS, "%s: No more space in STA (%s" 2824 PDEBUG(DEBUG_PS, "%s: No more space in STA (" MAC_FMT
2788 ")'s PS mode buffer\n", 2825 ")'s PS mode buffer\n",
2789 local->dev->name, print_mac(mac, sta->addr)); 2826 local->dev->name,
2827 sta->addr[0], sta->addr[1], sta->addr[2],
2828 sta->addr[3], sta->addr[4], sta->addr[5]);
2790 /* Make sure that TIM is set for the station (it might not be 2829 /* Make sure that TIM is set for the station (it might not be
2791 * after AP wlan hw reset). */ 2830 * after AP wlan hw reset). */
2792 /* FIX: should fix hw reset to restore bits based on STA 2831 /* FIX: should fix hw reset to restore bits based on STA
@@ -2850,7 +2889,6 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2850 struct sta_info *sta; 2889 struct sta_info *sta;
2851 struct ieee80211_hdr_4addr *hdr; 2890 struct ieee80211_hdr_4addr *hdr;
2852 struct hostap_skb_tx_data *meta; 2891 struct hostap_skb_tx_data *meta;
2853 DECLARE_MAC_BUF(mac);
2854 2892
2855 hdr = (struct ieee80211_hdr_4addr *) skb->data; 2893 hdr = (struct ieee80211_hdr_4addr *) skb->data;
2856 meta = (struct hostap_skb_tx_data *) skb->cb; 2894 meta = (struct hostap_skb_tx_data *) skb->cb;
@@ -2859,9 +2897,12 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2859 sta = ap_get_sta(local->ap, hdr->addr1); 2897 sta = ap_get_sta(local->ap, hdr->addr1);
2860 if (!sta) { 2898 if (!sta) {
2861 spin_unlock(&local->ap->sta_table_lock); 2899 spin_unlock(&local->ap->sta_table_lock);
2862 PDEBUG(DEBUG_AP, "%s: Could not find STA %s" 2900 PDEBUG(DEBUG_AP, "%s: Could not find STA " MAC_FMT
2863 " for this TX error (@%lu)\n", 2901 " for this TX error (@%lu)\n",
2864 local->dev->name, print_mac(mac, hdr->addr1), jiffies); 2902 local->dev->name,
2903 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2904 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
2905 jiffies);
2865 return; 2906 return;
2866 } 2907 }
2867 2908
@@ -2888,9 +2929,11 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2888 case 3: sta->tx_rate = 110; break; 2929 case 3: sta->tx_rate = 110; break;
2889 default: sta->tx_rate = 0; break; 2930 default: sta->tx_rate = 0; break;
2890 } 2931 }
2891 PDEBUG(DEBUG_AP, "%s: STA %s" 2932 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT
2892 " TX rate lowered to %d\n", 2933 " TX rate lowered to %d\n",
2893 local->dev->name, print_mac(mac, sta->addr), 2934 local->dev->name,
2935 sta->addr[0], sta->addr[1], sta->addr[2],
2936 sta->addr[3], sta->addr[4], sta->addr[5],
2894 sta->tx_rate); 2937 sta->tx_rate);
2895 } 2938 }
2896 sta->tx_consecutive_exc = 0; 2939 sta->tx_consecutive_exc = 0;
@@ -2956,7 +2999,6 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
2956 struct sta_info *sta; 2999 struct sta_info *sta;
2957 u16 fc, type, stype; 3000 u16 fc, type, stype;
2958 struct ieee80211_hdr_4addr *hdr; 3001 struct ieee80211_hdr_4addr *hdr;
2959 DECLARE_MAC_BUF(mac);
2960 3002
2961 if (local->ap == NULL) 3003 if (local->ap == NULL)
2962 return AP_RX_CONTINUE; 3004 return AP_RX_CONTINUE;
@@ -2988,9 +3030,12 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
2988 } else { 3030 } else {
2989 printk(KERN_DEBUG "%s: dropped received packet" 3031 printk(KERN_DEBUG "%s: dropped received packet"
2990 " from non-associated STA " 3032 " from non-associated STA "
2991 "%s" 3033 MAC_FMT
2992 " (type=0x%02x, subtype=0x%02x)\n", 3034 " (type=0x%02x, subtype=0x%02x)\n",
2993 dev->name, print_mac(mac, hdr->addr2), 3035 dev->name,
3036 hdr->addr2[0], hdr->addr2[1],
3037 hdr->addr2[2], hdr->addr2[3],
3038 hdr->addr2[4], hdr->addr2[5],
2994 type >> 2, stype >> 4); 3039 type >> 2, stype >> 4);
2995 hostap_rx(dev, skb, rx_stats); 3040 hostap_rx(dev, skb, rx_stats);
2996#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3041#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
@@ -3025,8 +3070,11 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3025 * being associated. */ 3070 * being associated. */
3026 printk(KERN_DEBUG "%s: rejected received nullfunc " 3071 printk(KERN_DEBUG "%s: rejected received nullfunc "
3027 "frame without ToDS from not associated STA " 3072 "frame without ToDS from not associated STA "
3028 "%s\n", 3073 MAC_FMT "\n",
3029 dev->name, print_mac(mac, hdr->addr2)); 3074 dev->name,
3075 hdr->addr2[0], hdr->addr2[1],
3076 hdr->addr2[2], hdr->addr2[3],
3077 hdr->addr2[4], hdr->addr2[5]);
3030 hostap_rx(dev, skb, rx_stats); 3078 hostap_rx(dev, skb, rx_stats);
3031#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3079#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
3032 } 3080 }
@@ -3043,9 +3091,12 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3043 * If BSSID is own, report the dropping of this frame. */ 3091 * If BSSID is own, report the dropping of this frame. */
3044 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { 3092 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) {
3045 printk(KERN_DEBUG "%s: dropped received packet from " 3093 printk(KERN_DEBUG "%s: dropped received packet from "
3046 "%s with no ToDS flag " 3094 MAC_FMT " with no ToDS flag "
3047 "(type=0x%02x, subtype=0x%02x)\n", dev->name, 3095 "(type=0x%02x, subtype=0x%02x)\n", dev->name,
3048 print_mac(mac, hdr->addr2), type >> 2, stype >> 4); 3096 hdr->addr2[0], hdr->addr2[1],
3097 hdr->addr2[2], hdr->addr2[3],
3098 hdr->addr2[4], hdr->addr2[5],
3099 type >> 2, stype >> 4);
3049 hostap_dump_rx_80211(dev->name, skb, rx_stats); 3100 hostap_dump_rx_80211(dev->name, skb, rx_stats);
3050 } 3101 }
3051 ret = AP_RX_DROP; 3102 ret = AP_RX_DROP;
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index a56d9fc6354f..98d6ff69d375 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -10192,7 +10192,6 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10192 u8 id, hdr_len, unicast; 10192 u8 id, hdr_len, unicast;
10193 u16 remaining_bytes; 10193 u16 remaining_bytes;
10194 int fc; 10194 int fc;
10195 DECLARE_MAC_BUF(mac);
10196 10195
10197 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 10196 hdr_len = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
10198 switch (priv->ieee->iw_mode) { 10197 switch (priv->ieee->iw_mode) {
@@ -10203,8 +10202,10 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10203 id = ipw_add_station(priv, hdr->addr1); 10202 id = ipw_add_station(priv, hdr->addr1);
10204 if (id == IPW_INVALID_STATION) { 10203 if (id == IPW_INVALID_STATION) {
10205 IPW_WARNING("Attempt to send data to " 10204 IPW_WARNING("Attempt to send data to "
10206 "invalid cell: %s\n", 10205 "invalid cell: " MAC_FMT "\n",
10207 print_mac(mac, hdr->addr1)); 10206 hdr->addr1[0], hdr->addr1[1],
10207 hdr->addr1[2], hdr->addr1[3],
10208 hdr->addr1[4], hdr->addr1[5]);
10208 goto drop; 10209 goto drop;
10209 } 10210 }
10210 } 10211 }
@@ -11576,6 +11577,7 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
11576 priv->prom_priv->priv = priv; 11577 priv->prom_priv->priv = priv;
11577 11578
11578 strcpy(priv->prom_net_dev->name, "rtap%d"); 11579 strcpy(priv->prom_net_dev->name, "rtap%d");
11580 memcpy(priv->prom_net_dev->dev_addr, priv->mac_addr, ETH_ALEN);
11579 11581
11580 priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; 11582 priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP;
11581 priv->prom_net_dev->open = ipw_prom_open; 11583 priv->prom_net_dev->open = ipw_prom_open;
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig
index b79a35a40ab6..b54ff712e703 100644
--- a/drivers/net/wireless/iwlwifi/Kconfig
+++ b/drivers/net/wireless/iwlwifi/Kconfig
@@ -35,7 +35,6 @@ config IWL4965_HT
35 bool "Enable 802.11n HT features in iwl4965 driver" 35 bool "Enable 802.11n HT features in iwl4965 driver"
36 depends on EXPERIMENTAL 36 depends on EXPERIMENTAL
37 depends on IWL4965 && IWL4965_QOS 37 depends on IWL4965 && IWL4965_QOS
38 depends on n
39 ---help--- 38 ---help---
40 This option enables IEEE 802.11n High Throughput features 39 This option enables IEEE 802.11n High Throughput features
41 for the iwl4965 driver. 40 for the iwl4965 driver.
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 87e145ffe8f1..6a24ed6067e0 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -541,7 +541,7 @@ void lbs_association_worker(struct work_struct *work)
541 } 541 }
542 542
543 if (find_any_ssid) { 543 if (find_any_ssid) {
544 u8 new_mode; 544 u8 new_mode = assoc_req->mode;
545 545
546 ret = lbs_find_best_network_ssid(priv, assoc_req->ssid, 546 ret = lbs_find_best_network_ssid(priv, assoc_req->ssid,
547 &assoc_req->ssid_len, assoc_req->mode, &new_mode); 547 &assoc_req->ssid_len, assoc_req->mode, &new_mode);
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 93ea212fedd5..ad2e7d53b3da 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2399,10 +2399,8 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2399 * beacon frame. 2399 * beacon frame.
2400 */ 2400 */
2401 if (skb_headroom(skb) < TXD_DESC_SIZE) { 2401 if (skb_headroom(skb) < TXD_DESC_SIZE) {
2402 if (pskb_expand_head(skb, TXD_DESC_SIZE, 0, GFP_ATOMIC)) { 2402 if (pskb_expand_head(skb, TXD_DESC_SIZE, 0, GFP_ATOMIC))
2403 dev_kfree_skb(skb);
2404 return -ENOMEM; 2403 return -ENOMEM;
2405 }
2406 } 2404 }
2407 2405
2408 /* 2406 /*
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index d76d37bcb9cc..a85808938205 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -1568,9 +1568,8 @@ static void __devinit detect_and_report_it87(void)
1568 outb(r | 8, 0x2F); 1568 outb(r | 8, 0x2F);
1569 outb(0x02, 0x2E); /* Lock */ 1569 outb(0x02, 0x2E); /* Lock */
1570 outb(0x02, 0x2F); 1570 outb(0x02, 0x2F);
1571
1572 release_region(0x2e, 1);
1573 } 1571 }
1572 release_region(0x2e, 1);
1574} 1573}
1575#endif /* CONFIG_PARPORT_PC_SUPERIO */ 1574#endif /* CONFIG_PARPORT_PC_SUPERIO */
1576 1575
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 9e7de63b26ef..02a4c8cf2b2d 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -252,6 +252,7 @@ config RTC_DRV_TWL92330
252 252
253config RTC_DRV_S35390A 253config RTC_DRV_S35390A
254 tristate "Seiko Instruments S-35390A" 254 tristate "Seiko Instruments S-35390A"
255 select BITREVERSE
255 help 256 help
256 If you say yes here you will get support for the Seiko 257 If you say yes here you will get support for the Seiko
257 Instruments S-35390A. 258 Instruments S-35390A.
diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c
index d3b9b14267ab..42244f14b41c 100644
--- a/drivers/rtc/rtc-at32ap700x.c
+++ b/drivers/rtc/rtc-at32ap700x.c
@@ -290,7 +290,7 @@ static int __exit at32_rtc_remove(struct platform_device *pdev)
290 return 0; 290 return 0;
291} 291}
292 292
293MODULE_ALIAS("at32ap700x_rtc"); 293MODULE_ALIAS("platform:at32ap700x_rtc");
294 294
295static struct platform_driver at32_rtc_driver = { 295static struct platform_driver at32_rtc_driver = {
296 .remove = __exit_p(at32_rtc_remove), 296 .remove = __exit_p(at32_rtc_remove),
diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
index 33795e5a5595..52abffc86bcd 100644
--- a/drivers/rtc/rtc-at91rm9200.c
+++ b/drivers/rtc/rtc-at91rm9200.c
@@ -407,3 +407,4 @@ module_exit(at91_rtc_exit);
407MODULE_AUTHOR("Rick Bronson"); 407MODULE_AUTHOR("Rick Bronson");
408MODULE_DESCRIPTION("RTC driver for Atmel AT91RM9200"); 408MODULE_DESCRIPTION("RTC driver for Atmel AT91RM9200");
409MODULE_LICENSE("GPL"); 409MODULE_LICENSE("GPL");
410MODULE_ALIAS("platform:at91_rtc");
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index d90ba860d216..4f28045d9ef2 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -470,3 +470,4 @@ module_exit(bfin_rtc_exit);
470MODULE_DESCRIPTION("Blackfin On-Chip Real Time Clock Driver"); 470MODULE_DESCRIPTION("Blackfin On-Chip Real Time Clock Driver");
471MODULE_AUTHOR("Mike Frysinger <vapier@gentoo.org>"); 471MODULE_AUTHOR("Mike Frysinger <vapier@gentoo.org>");
472MODULE_LICENSE("GPL"); 472MODULE_LICENSE("GPL");
473MODULE_ALIAS("platform:rtc-bfin");
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index f3ee2ad566b4..b48517021ee6 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -943,6 +943,9 @@ static void cmos_platform_shutdown(struct platform_device *pdev)
943 cmos_do_shutdown(); 943 cmos_do_shutdown();
944} 944}
945 945
946/* work with hotplug and coldplug */
947MODULE_ALIAS("platform:rtc_cmos");
948
946static struct platform_driver cmos_platform_driver = { 949static struct platform_driver cmos_platform_driver = {
947 .remove = __exit_p(cmos_platform_remove), 950 .remove = __exit_p(cmos_platform_remove),
948 .shutdown = cmos_platform_shutdown, 951 .shutdown = cmos_platform_shutdown,
diff --git a/drivers/rtc/rtc-ds1216.c b/drivers/rtc/rtc-ds1216.c
index 83efb88f8f23..0b17770b032b 100644
--- a/drivers/rtc/rtc-ds1216.c
+++ b/drivers/rtc/rtc-ds1216.c
@@ -221,6 +221,7 @@ MODULE_AUTHOR("Thomas Bogendoerfer <tsbogend@alpha.franken.de>");
221MODULE_DESCRIPTION("DS1216 RTC driver"); 221MODULE_DESCRIPTION("DS1216 RTC driver");
222MODULE_LICENSE("GPL"); 222MODULE_LICENSE("GPL");
223MODULE_VERSION(DRV_VERSION); 223MODULE_VERSION(DRV_VERSION);
224MODULE_ALIAS("platform:rtc-ds1216");
224 225
225module_init(ds1216_rtc_init); 226module_init(ds1216_rtc_init);
226module_exit(ds1216_rtc_exit); 227module_exit(ds1216_rtc_exit);
diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c
index d74b8086fa31..d08912f18ddd 100644
--- a/drivers/rtc/rtc-ds1511.c
+++ b/drivers/rtc/rtc-ds1511.c
@@ -626,6 +626,9 @@ ds1511_rtc_remove(struct platform_device *pdev)
626 return 0; 626 return 0;
627} 627}
628 628
629/* work with hotplug and coldplug */
630MODULE_ALIAS("platform:ds1511");
631
629static struct platform_driver ds1511_rtc_driver = { 632static struct platform_driver ds1511_rtc_driver = {
630 .probe = ds1511_rtc_probe, 633 .probe = ds1511_rtc_probe,
631 .remove = __devexit_p(ds1511_rtc_remove), 634 .remove = __devexit_p(ds1511_rtc_remove),
diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c
index d9e848dcd450..a19f11415540 100644
--- a/drivers/rtc/rtc-ds1553.c
+++ b/drivers/rtc/rtc-ds1553.c
@@ -391,6 +391,9 @@ static int __devexit ds1553_rtc_remove(struct platform_device *pdev)
391 return 0; 391 return 0;
392} 392}
393 393
394/* work with hotplug and coldplug */
395MODULE_ALIAS("platform:rtc-ds1553");
396
394static struct platform_driver ds1553_rtc_driver = { 397static struct platform_driver ds1553_rtc_driver = {
395 .probe = ds1553_rtc_probe, 398 .probe = ds1553_rtc_probe,
396 .remove = __devexit_p(ds1553_rtc_remove), 399 .remove = __devexit_p(ds1553_rtc_remove),
diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c
index 2e73f0b183b2..24d35ede2dbf 100644
--- a/drivers/rtc/rtc-ds1742.c
+++ b/drivers/rtc/rtc-ds1742.c
@@ -276,3 +276,4 @@ MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
276MODULE_DESCRIPTION("Dallas DS1742 RTC driver"); 276MODULE_DESCRIPTION("Dallas DS1742 RTC driver");
277MODULE_LICENSE("GPL"); 277MODULE_LICENSE("GPL");
278MODULE_VERSION(DRV_VERSION); 278MODULE_VERSION(DRV_VERSION);
279MODULE_ALIAS("platform:rtc-ds1742");
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index ef4f147f3c0c..1e99325270df 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -132,6 +132,9 @@ static int __devexit ep93xx_rtc_remove(struct platform_device *dev)
132 return 0; 132 return 0;
133} 133}
134 134
135/* work with hotplug and coldplug */
136MODULE_ALIAS("platform:ep93xx-rtc");
137
135static struct platform_driver ep93xx_rtc_platform_driver = { 138static struct platform_driver ep93xx_rtc_platform_driver = {
136 .driver = { 139 .driver = {
137 .name = "ep93xx-rtc", 140 .name = "ep93xx-rtc",
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index cd0bbc0e8038..013e6c103b9c 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -465,6 +465,9 @@ static int __devexit m48t59_rtc_remove(struct platform_device *pdev)
465 return 0; 465 return 0;
466} 466}
467 467
468/* work with hotplug and coldplug */
469MODULE_ALIAS("platform:rtc-m48t59");
470
468static struct platform_driver m48t59_rtc_driver = { 471static struct platform_driver m48t59_rtc_driver = {
469 .driver = { 472 .driver = {
470 .name = "rtc-m48t59", 473 .name = "rtc-m48t59",
diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c
index 8ff4a1221f59..3f7f99a5d96a 100644
--- a/drivers/rtc/rtc-m48t86.c
+++ b/drivers/rtc/rtc-m48t86.c
@@ -199,6 +199,7 @@ MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
199MODULE_DESCRIPTION("M48T86 RTC driver"); 199MODULE_DESCRIPTION("M48T86 RTC driver");
200MODULE_LICENSE("GPL"); 200MODULE_LICENSE("GPL");
201MODULE_VERSION(DRV_VERSION); 201MODULE_VERSION(DRV_VERSION);
202MODULE_ALIAS("platform:rtc-m48t86");
202 203
203module_init(m48t86_rtc_init); 204module_init(m48t86_rtc_init);
204module_exit(m48t86_rtc_exit); 205module_exit(m48t86_rtc_exit);
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index a2f84f169588..58f81c774943 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -497,7 +497,7 @@ static void omap_rtc_shutdown(struct platform_device *pdev)
497 rtc_write(0, OMAP_RTC_INTERRUPTS_REG); 497 rtc_write(0, OMAP_RTC_INTERRUPTS_REG);
498} 498}
499 499
500MODULE_ALIAS("omap_rtc"); 500MODULE_ALIAS("platform:omap_rtc");
501static struct platform_driver omap_rtc_driver = { 501static struct platform_driver omap_rtc_driver = {
502 .probe = omap_rtc_probe, 502 .probe = omap_rtc_probe,
503 .remove = __devexit_p(omap_rtc_remove), 503 .remove = __devexit_p(omap_rtc_remove),
diff --git a/drivers/rtc/rtc-rs5c313.c b/drivers/rtc/rtc-rs5c313.c
index 66eb133bf5fd..664e89a817ed 100644
--- a/drivers/rtc/rtc-rs5c313.c
+++ b/drivers/rtc/rtc-rs5c313.c
@@ -421,3 +421,4 @@ MODULE_VERSION(DRV_VERSION);
421MODULE_AUTHOR("kogiidena , Nobuhiro Iwamatsu <iwamatsu@nigauri.org>"); 421MODULE_AUTHOR("kogiidena , Nobuhiro Iwamatsu <iwamatsu@nigauri.org>");
422MODULE_DESCRIPTION("Ricoh RS5C313 RTC device driver"); 422MODULE_DESCRIPTION("Ricoh RS5C313 RTC device driver");
423MODULE_LICENSE("GPL"); 423MODULE_LICENSE("GPL");
424MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 86766f1f2496..9f4d5129a496 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -592,3 +592,4 @@ module_exit(s3c_rtc_exit);
592MODULE_DESCRIPTION("Samsung S3C RTC Driver"); 592MODULE_DESCRIPTION("Samsung S3C RTC Driver");
593MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 593MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
594MODULE_LICENSE("GPL"); 594MODULE_LICENSE("GPL");
595MODULE_ALIAS("platform:s3c2410-rtc");
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c
index ee253cc45de1..82f62d25f921 100644
--- a/drivers/rtc/rtc-sa1100.c
+++ b/drivers/rtc/rtc-sa1100.c
@@ -399,3 +399,4 @@ module_exit(sa1100_rtc_exit);
399MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>"); 399MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
400MODULE_DESCRIPTION("SA11x0/PXA2xx Realtime Clock Driver (RTC)"); 400MODULE_DESCRIPTION("SA11x0/PXA2xx Realtime Clock Driver (RTC)");
401MODULE_LICENSE("GPL"); 401MODULE_LICENSE("GPL");
402MODULE_ALIAS("platform:sa1100-rtc");
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index c1d6a1880ccf..9e9caa5d7f5f 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -664,3 +664,4 @@ MODULE_DESCRIPTION("SuperH on-chip RTC driver");
664MODULE_VERSION(DRV_VERSION); 664MODULE_VERSION(DRV_VERSION);
665MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, Jamie Lenehan <lenehan@twibble.org>"); 665MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, Jamie Lenehan <lenehan@twibble.org>");
666MODULE_LICENSE("GPL"); 666MODULE_LICENSE("GPL");
667MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c
index a265da7c6ff8..31d3c8c28588 100644
--- a/drivers/rtc/rtc-stk17ta8.c
+++ b/drivers/rtc/rtc-stk17ta8.c
@@ -394,6 +394,9 @@ static int __devexit stk17ta8_rtc_remove(struct platform_device *pdev)
394 return 0; 394 return 0;
395} 395}
396 396
397/* work with hotplug and coldplug */
398MODULE_ALIAS("platform:stk17ta8");
399
397static struct platform_driver stk17ta8_rtc_driver = { 400static struct platform_driver stk17ta8_rtc_driver = {
398 .probe = stk17ta8_rtc_probe, 401 .probe = stk17ta8_rtc_probe,
399 .remove = __devexit_p(stk17ta8_rtc_remove), 402 .remove = __devexit_p(stk17ta8_rtc_remove),
diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index a6b572978dc0..24203a06051a 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -264,3 +264,4 @@ module_exit(v3020_exit);
264MODULE_DESCRIPTION("V3020 RTC"); 264MODULE_DESCRIPTION("V3020 RTC");
265MODULE_AUTHOR("Raphael Assenat"); 265MODULE_AUTHOR("Raphael Assenat");
266MODULE_LICENSE("GPL"); 266MODULE_LICENSE("GPL");
267MODULE_ALIAS("platform:v3020");
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index ce2f78de7a80..be9c70d0b193 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -422,6 +422,9 @@ static int __devexit rtc_remove(struct platform_device *pdev)
422 return 0; 422 return 0;
423} 423}
424 424
425/* work with hotplug and coldplug */
426MODULE_ALIAS("platform:RTC");
427
425static struct platform_driver rtc_platform_driver = { 428static struct platform_driver rtc_platform_driver = {
426 .probe = rtc_probe, 429 .probe = rtc_probe,
427 .remove = __devexit_p(rtc_remove), 430 .remove = __devexit_p(rtc_remove),
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index e5c6f6af8765..c78b836f59dd 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -181,6 +181,18 @@ struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, gfp_t gfp_mask)
181 cmd = kmem_cache_alloc(shost->cmd_pool->cmd_slab, 181 cmd = kmem_cache_alloc(shost->cmd_pool->cmd_slab,
182 gfp_mask | shost->cmd_pool->gfp_mask); 182 gfp_mask | shost->cmd_pool->gfp_mask);
183 183
184 if (likely(cmd)) {
185 buf = kmem_cache_alloc(shost->cmd_pool->sense_slab,
186 gfp_mask | shost->cmd_pool->gfp_mask);
187 if (likely(buf)) {
188 memset(cmd, 0, sizeof(*cmd));
189 cmd->sense_buffer = buf;
190 } else {
191 kmem_cache_free(shost->cmd_pool->cmd_slab, cmd);
192 cmd = NULL;
193 }
194 }
195
184 if (unlikely(!cmd)) { 196 if (unlikely(!cmd)) {
185 unsigned long flags; 197 unsigned long flags;
186 198
@@ -197,16 +209,6 @@ struct scsi_cmnd *__scsi_get_command(struct Scsi_Host *shost, gfp_t gfp_mask)
197 memset(cmd, 0, sizeof(*cmd)); 209 memset(cmd, 0, sizeof(*cmd));
198 cmd->sense_buffer = buf; 210 cmd->sense_buffer = buf;
199 } 211 }
200 } else {
201 buf = kmem_cache_alloc(shost->cmd_pool->sense_slab,
202 gfp_mask | shost->cmd_pool->gfp_mask);
203 if (likely(buf)) {
204 memset(cmd, 0, sizeof(*cmd));
205 cmd->sense_buffer = buf;
206 } else {
207 kmem_cache_free(shost->cmd_pool->cmd_slab, cmd);
208 cmd = NULL;
209 }
210 } 212 }
211 213
212 return cmd; 214 return cmd;
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 85687aaf9cab..1749a27be066 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -863,3 +863,4 @@ module_exit(atmel_spi_exit);
863MODULE_DESCRIPTION("Atmel AT32/AT91 SPI Controller driver"); 863MODULE_DESCRIPTION("Atmel AT32/AT91 SPI Controller driver");
864MODULE_AUTHOR("Haavard Skinnemoen <hskinnemoen@atmel.com>"); 864MODULE_AUTHOR("Haavard Skinnemoen <hskinnemoen@atmel.com>");
865MODULE_LICENSE("GPL"); 865MODULE_LICENSE("GPL");
866MODULE_ALIAS("platform:atmel_spi");
diff --git a/drivers/spi/au1550_spi.c b/drivers/spi/au1550_spi.c
index 41a3d00c4515..072c4a595334 100644
--- a/drivers/spi/au1550_spi.c
+++ b/drivers/spi/au1550_spi.c
@@ -958,6 +958,9 @@ static int __exit au1550_spi_remove(struct platform_device *pdev)
958 return 0; 958 return 0;
959} 959}
960 960
961/* work with hotplug and coldplug */
962MODULE_ALIAS("platform:au1550-spi");
963
961static struct platform_driver au1550_spi_drv = { 964static struct platform_driver au1550_spi_drv = {
962 .remove = __exit_p(au1550_spi_remove), 965 .remove = __exit_p(au1550_spi_remove),
963 .driver = { 966 .driver = {
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index a86315a0c5b8..90729469d481 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -500,6 +500,9 @@ static int __exit mpc52xx_psc_spi_remove(struct platform_device *dev)
500 return mpc52xx_psc_spi_do_remove(&dev->dev); 500 return mpc52xx_psc_spi_do_remove(&dev->dev);
501} 501}
502 502
503/* work with hotplug and coldplug */
504MODULE_ALIAS("platform:mpc52xx-psc-spi");
505
503static struct platform_driver mpc52xx_psc_spi_platform_driver = { 506static struct platform_driver mpc52xx_psc_spi_platform_driver = {
504 .remove = __exit_p(mpc52xx_psc_spi_remove), 507 .remove = __exit_p(mpc52xx_psc_spi_remove),
505 .driver = { 508 .driver = {
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index a6ba11afb03f..b1cc148036c1 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -1084,6 +1084,9 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev)
1084 return 0; 1084 return 0;
1085} 1085}
1086 1086
1087/* work with hotplug and coldplug */
1088MODULE_ALIAS("platform:omap2_mcspi");
1089
1087static struct platform_driver omap2_mcspi_driver = { 1090static struct platform_driver omap2_mcspi_driver = {
1088 .driver = { 1091 .driver = {
1089 .name = "omap2_mcspi", 1092 .name = "omap2_mcspi",
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c
index 8245b5153f30..5f00bd6500ef 100644
--- a/drivers/spi/omap_uwire.c
+++ b/drivers/spi/omap_uwire.c
@@ -537,10 +537,12 @@ static int __exit uwire_remove(struct platform_device *pdev)
537 return status; 537 return status;
538} 538}
539 539
540/* work with hotplug and coldplug */
541MODULE_ALIAS("platform:omap_uwire");
542
540static struct platform_driver uwire_driver = { 543static struct platform_driver uwire_driver = {
541 .driver = { 544 .driver = {
542 .name = "omap_uwire", 545 .name = "omap_uwire",
543 .bus = &platform_bus_type,
544 .owner = THIS_MODULE, 546 .owner = THIS_MODULE,
545 }, 547 },
546 .remove = __exit_p(uwire_remove), 548 .remove = __exit_p(uwire_remove),
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index 59deed79e0ab..147e26a78d64 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -44,6 +44,7 @@
44MODULE_AUTHOR("Stephen Street"); 44MODULE_AUTHOR("Stephen Street");
45MODULE_DESCRIPTION("PXA2xx SSP SPI Controller"); 45MODULE_DESCRIPTION("PXA2xx SSP SPI Controller");
46MODULE_LICENSE("GPL"); 46MODULE_LICENSE("GPL");
47MODULE_ALIAS("platform:pxa2xx-spi");
47 48
48#define MAX_BUSES 3 49#define MAX_BUSES 3
49 50
@@ -1581,7 +1582,6 @@ static int pxa2xx_spi_resume(struct platform_device *pdev)
1581static struct platform_driver driver = { 1582static struct platform_driver driver = {
1582 .driver = { 1583 .driver = {
1583 .name = "pxa2xx-spi", 1584 .name = "pxa2xx-spi",
1584 .bus = &platform_bus_type,
1585 .owner = THIS_MODULE, 1585 .owner = THIS_MODULE,
1586 }, 1586 },
1587 .remove = pxa2xx_spi_remove, 1587 .remove = pxa2xx_spi_remove,
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index d853fceb6bf0..a9ac1fdb3094 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -713,8 +713,8 @@ static void pump_transfers(unsigned long data)
713 } else { 713 } else {
714 drv_data->len = transfer->len; 714 drv_data->len = transfer->len;
715 } 715 }
716 dev_dbg(&drv_data->pdev->dev, "transfer: ", 716 dev_dbg(&drv_data->pdev->dev,
717 "drv_data->write is %p, chip->write is %p, null_wr is %p\n", 717 "transfer: drv_data->write is %p, chip->write is %p, null_wr is %p\n",
718 drv_data->write, chip->write, null_writer); 718 drv_data->write, chip->write, null_writer);
719 719
720 /* speed and width has been set on per message */ 720 /* speed and width has been set on per message */
@@ -1294,6 +1294,12 @@ static int __init bfin5xx_spi_probe(struct platform_device *pdev)
1294 goto out_error_queue_alloc; 1294 goto out_error_queue_alloc;
1295 } 1295 }
1296 1296
1297 status = peripheral_request_list(drv_data->pin_req, DRV_NAME);
1298 if (status != 0) {
1299 dev_err(&pdev->dev, ": Requesting Peripherals failed\n");
1300 goto out_error_queue_alloc;
1301 }
1302
1297 /* Register with the SPI framework */ 1303 /* Register with the SPI framework */
1298 platform_set_drvdata(pdev, drv_data); 1304 platform_set_drvdata(pdev, drv_data);
1299 status = spi_register_master(master); 1305 status = spi_register_master(master);
@@ -1302,12 +1308,6 @@ static int __init bfin5xx_spi_probe(struct platform_device *pdev)
1302 goto out_error_queue_alloc; 1308 goto out_error_queue_alloc;
1303 } 1309 }
1304 1310
1305 status = peripheral_request_list(drv_data->pin_req, DRV_NAME);
1306 if (status != 0) {
1307 dev_err(&pdev->dev, ": Requesting Peripherals failed\n");
1308 goto out_error;
1309 }
1310
1311 dev_info(dev, "%s, Version %s, regs_base@%p, dma channel@%d\n", 1311 dev_info(dev, "%s, Version %s, regs_base@%p, dma channel@%d\n",
1312 DRV_DESC, DRV_VERSION, drv_data->regs_base, 1312 DRV_DESC, DRV_VERSION, drv_data->regs_base,
1313 drv_data->dma_channel); 1313 drv_data->dma_channel);
@@ -1319,7 +1319,6 @@ out_error_no_dma_ch:
1319 iounmap((void *) drv_data->regs_base); 1319 iounmap((void *) drv_data->regs_base);
1320out_error_ioremap: 1320out_error_ioremap:
1321out_error_get_res: 1321out_error_get_res:
1322out_error:
1323 spi_master_put(master); 1322 spi_master_put(master);
1324 1323
1325 return status; 1324 return status;
@@ -1397,7 +1396,7 @@ static int bfin5xx_spi_resume(struct platform_device *pdev)
1397#define bfin5xx_spi_resume NULL 1396#define bfin5xx_spi_resume NULL
1398#endif /* CONFIG_PM */ 1397#endif /* CONFIG_PM */
1399 1398
1400MODULE_ALIAS("bfin-spi-master"); /* for platform bus hotplug */ 1399MODULE_ALIAS("platform:bfin-spi");
1401static struct platform_driver bfin5xx_spi_driver = { 1400static struct platform_driver bfin5xx_spi_driver = {
1402 .driver = { 1401 .driver = {
1403 .name = DRV_NAME, 1402 .name = DRV_NAME,
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 1b0647124933..d4ba640366b6 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -1722,10 +1722,12 @@ static int spi_imx_resume(struct platform_device *pdev)
1722#define spi_imx_resume NULL 1722#define spi_imx_resume NULL
1723#endif /* CONFIG_PM */ 1723#endif /* CONFIG_PM */
1724 1724
1725/* work with hotplug and coldplug */
1726MODULE_ALIAS("platform:spi_imx");
1727
1725static struct platform_driver driver = { 1728static struct platform_driver driver = {
1726 .driver = { 1729 .driver = {
1727 .name = "spi_imx", 1730 .name = "spi_imx",
1728 .bus = &platform_bus_type,
1729 .owner = THIS_MODULE, 1731 .owner = THIS_MODULE,
1730 }, 1732 },
1731 .remove = __exit_p(spi_imx_remove), 1733 .remove = __exit_p(spi_imx_remove),
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 04f7cd9fc261..be15a6213205 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -523,11 +523,12 @@ static int __exit mpc83xx_spi_remove(struct platform_device *dev)
523 return 0; 523 return 0;
524} 524}
525 525
526MODULE_ALIAS("mpc83xx_spi"); /* for platform bus hotplug */ 526MODULE_ALIAS("platform:mpc83xx_spi");
527static struct platform_driver mpc83xx_spi_driver = { 527static struct platform_driver mpc83xx_spi_driver = {
528 .remove = __exit_p(mpc83xx_spi_remove), 528 .remove = __exit_p(mpc83xx_spi_remove),
529 .driver = { 529 .driver = {
530 .name = "mpc83xx_spi", 530 .name = "mpc83xx_spi",
531 .owner = THIS_MODULE,
531 }, 532 },
532}; 533};
533 534
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index 6e834b8b9d27..e75103aac790 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -415,7 +415,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev)
415#define s3c24xx_spi_resume NULL 415#define s3c24xx_spi_resume NULL
416#endif 416#endif
417 417
418MODULE_ALIAS("s3c2410_spi"); /* for platform bus hotplug */ 418MODULE_ALIAS("platform:s3c2410-spi");
419static struct platform_driver s3c24xx_spidrv = { 419static struct platform_driver s3c24xx_spidrv = {
420 .remove = __exit_p(s3c24xx_spi_remove), 420 .remove = __exit_p(s3c24xx_spi_remove),
421 .suspend = s3c24xx_spi_suspend, 421 .suspend = s3c24xx_spi_suspend,
diff --git a/drivers/spi/spi_s3c24xx_gpio.c b/drivers/spi/spi_s3c24xx_gpio.c
index 82ae7d7eca38..e33f6145c560 100644
--- a/drivers/spi/spi_s3c24xx_gpio.c
+++ b/drivers/spi/spi_s3c24xx_gpio.c
@@ -168,6 +168,8 @@ static int s3c2410_spigpio_remove(struct platform_device *dev)
168#define s3c2410_spigpio_suspend NULL 168#define s3c2410_spigpio_suspend NULL
169#define s3c2410_spigpio_resume NULL 169#define s3c2410_spigpio_resume NULL
170 170
171/* work with hotplug and coldplug */
172MODULE_ALIAS("platform:spi_s3c24xx_gpio");
171 173
172static struct platform_driver s3c2410_spigpio_drv = { 174static struct platform_driver s3c2410_spigpio_drv = {
173 .probe = s3c2410_spigpio_probe, 175 .probe = s3c2410_spigpio_probe,
diff --git a/drivers/spi/spi_sh_sci.c b/drivers/spi/spi_sh_sci.c
index 3dbe71b16d60..7d36720eb982 100644
--- a/drivers/spi/spi_sh_sci.c
+++ b/drivers/spi/spi_sh_sci.c
@@ -203,3 +203,4 @@ module_exit(sh_sci_spi_exit);
203MODULE_DESCRIPTION("SH SCI SPI Driver"); 203MODULE_DESCRIPTION("SH SCI SPI Driver");
204MODULE_AUTHOR("Magnus Damm <damm@opensource.se>"); 204MODULE_AUTHOR("Magnus Damm <damm@opensource.se>");
205MODULE_LICENSE("GPL"); 205MODULE_LICENSE("GPL");
206MODULE_ALIAS("platform:spi_sh_sci");
diff --git a/drivers/spi/spi_txx9.c b/drivers/spi/spi_txx9.c
index 363ac8e68821..2296f37ea3c6 100644
--- a/drivers/spi/spi_txx9.c
+++ b/drivers/spi/spi_txx9.c
@@ -450,6 +450,9 @@ static int __exit txx9spi_remove(struct platform_device *dev)
450 return 0; 450 return 0;
451} 451}
452 452
453/* work with hotplug and coldplug */
454MODULE_ALIAS("platform:spi_txx9");
455
453static struct platform_driver txx9spi_driver = { 456static struct platform_driver txx9spi_driver = {
454 .remove = __exit_p(txx9spi_remove), 457 .remove = __exit_p(txx9spi_remove),
455 .driver = { 458 .driver = {
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 5d04f520c123..cf6aef34fe25 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -408,6 +408,9 @@ static int __devexit xilinx_spi_remove(struct platform_device *dev)
408 return 0; 408 return 0;
409} 409}
410 410
411/* work with hotplug and coldplug */
412MODULE_ALIAS("platform:" XILINX_SPI_NAME);
413
411static struct platform_driver xilinx_spi_driver = { 414static struct platform_driver xilinx_spi_driver = {
412 .probe = xilinx_spi_probe, 415 .probe = xilinx_spi_probe,
413 .remove = __devexit_p(xilinx_spi_remove), 416 .remove = __devexit_p(xilinx_spi_remove),
diff --git a/drivers/ssb/driver_mipscore.c b/drivers/ssb/driver_mipscore.c
index 3d3dd32bf3ab..a9e7eb45b2e7 100644
--- a/drivers/ssb/driver_mipscore.c
+++ b/drivers/ssb/driver_mipscore.c
@@ -109,12 +109,13 @@ static void set_irq(struct ssb_device *dev, unsigned int irq)
109 clear_irq(bus, oldirq); 109 clear_irq(bus, oldirq);
110 110
111 /* assign the new one */ 111 /* assign the new one */
112 if (irq == 0) 112 if (irq == 0) {
113 ssb_write32(mdev, SSB_INTVEC, ((1 << irqflag) & ssb_read32(mdev, SSB_INTVEC))); 113 ssb_write32(mdev, SSB_INTVEC, ((1 << irqflag) | ssb_read32(mdev, SSB_INTVEC)));
114 114 } else {
115 irqflag <<= ipsflag_irq_shift[irq]; 115 irqflag <<= ipsflag_irq_shift[irq];
116 irqflag |= (ssb_read32(mdev, SSB_IPSFLAG) & ~ipsflag_irq_mask[irq]); 116 irqflag |= (ssb_read32(mdev, SSB_IPSFLAG) & ~ipsflag_irq_mask[irq]);
117 ssb_write32(mdev, SSB_IPSFLAG, irqflag); 117 ssb_write32(mdev, SSB_IPSFLAG, irqflag);
118 }
118} 119}
119 120
120static void ssb_mips_serial_init(struct ssb_mipscore *mcore) 121static void ssb_mips_serial_init(struct ssb_mipscore *mcore)
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index 74b9a8aea52b..5d777f211699 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -551,7 +551,7 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
551 } else { 551 } else {
552 tmp = ssb_read32(dev, SSB_TPSFLAG); 552 tmp = ssb_read32(dev, SSB_TPSFLAG);
553 tmp &= SSB_TPSFLAG_BPFLAG; 553 tmp &= SSB_TPSFLAG_BPFLAG;
554 intvec |= tmp; 554 intvec |= (1 << tmp);
555 } 555 }
556 ssb_write32(pdev, SSB_INTVEC, intvec); 556 ssb_write32(pdev, SSB_INTVEC, intvec);
557 } 557 }
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index bedb2b4ee9d2..72017bf2e577 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -1044,6 +1044,12 @@ int ssb_bus_may_powerdown(struct ssb_bus *bus)
1044 goto out; 1044 goto out;
1045 1045
1046 cc = &bus->chipco; 1046 cc = &bus->chipco;
1047
1048 if (!cc->dev)
1049 goto out;
1050 if (cc->dev->id.revision < 5)
1051 goto out;
1052
1047 ssb_chipco_set_clockmode(cc, SSB_CLKMODE_SLOW); 1053 ssb_chipco_set_clockmode(cc, SSB_CLKMODE_SLOW);
1048 err = ssb_pci_xtal(bus, SSB_GPIO_XTAL | SSB_GPIO_PLL, 0); 1054 err = ssb_pci_xtal(bus, SSB_GPIO_XTAL | SSB_GPIO_PLL, 0);
1049 if (err) 1055 if (err)
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index a83e8b798ec9..fd15ced899d8 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1884,3 +1884,4 @@ module_exit(udc_exit_module);
1884MODULE_DESCRIPTION("AT91 udc driver"); 1884MODULE_DESCRIPTION("AT91 udc driver");
1885MODULE_AUTHOR("Thomas Rathbone, David Brownell"); 1885MODULE_AUTHOR("Thomas Rathbone, David Brownell");
1886MODULE_LICENSE("GPL"); 1886MODULE_LICENSE("GPL");
1887MODULE_ALIAS("platform:at91_udc");
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index af8b2a3a2d4a..b0db4c31d018 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -2054,6 +2054,7 @@ static struct platform_driver udc_driver = {
2054 .remove = __exit_p(usba_udc_remove), 2054 .remove = __exit_p(usba_udc_remove),
2055 .driver = { 2055 .driver = {
2056 .name = "atmel_usba_udc", 2056 .name = "atmel_usba_udc",
2057 .owner = THIS_MODULE,
2057 }, 2058 },
2058}; 2059};
2059 2060
@@ -2072,3 +2073,4 @@ module_exit(udc_exit);
2072MODULE_DESCRIPTION("Atmel USBA UDC driver"); 2073MODULE_DESCRIPTION("Atmel USBA UDC driver");
2073MODULE_AUTHOR("Haavard Skinnemoen <hskinnemoen@atmel.com>"); 2074MODULE_AUTHOR("Haavard Skinnemoen <hskinnemoen@atmel.com>");
2074MODULE_LICENSE("GPL"); 2075MODULE_LICENSE("GPL");
2076MODULE_ALIAS("platform:atmel_usba_udc");
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c
index 63e8fa3a69e1..254012ad2b91 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -2475,3 +2475,4 @@ module_exit(udc_exit);
2475MODULE_DESCRIPTION(DRIVER_DESC); 2475MODULE_DESCRIPTION(DRIVER_DESC);
2476MODULE_AUTHOR(DRIVER_AUTHOR); 2476MODULE_AUTHOR(DRIVER_AUTHOR);
2477MODULE_LICENSE("GPL"); 2477MODULE_LICENSE("GPL");
2478MODULE_ALIAS("platform:fsl-usb2-udc");
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index 37243ef7104e..078f72467671 100644
--- a/drivers/usb/gadget/lh7a40x_udc.c
+++ b/drivers/usb/gadget/lh7a40x_udc.c
@@ -2146,3 +2146,4 @@ module_exit(udc_exit);
2146MODULE_DESCRIPTION(DRIVER_DESC); 2146MODULE_DESCRIPTION(DRIVER_DESC);
2147MODULE_AUTHOR("Mikko Lahteenmaki, Bo Henriksen"); 2147MODULE_AUTHOR("Mikko Lahteenmaki, Bo Henriksen");
2148MODULE_LICENSE("GPL"); 2148MODULE_LICENSE("GPL");
2149MODULE_ALIAS("platform:lh7a40x_udc");
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 835948f0715a..ee6b35fa870f 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -35,6 +35,7 @@
35MODULE_DESCRIPTION("M66592 USB gadget driver"); 35MODULE_DESCRIPTION("M66592 USB gadget driver");
36MODULE_LICENSE("GPL"); 36MODULE_LICENSE("GPL");
37MODULE_AUTHOR("Yoshihiro Shimoda"); 37MODULE_AUTHOR("Yoshihiro Shimoda");
38MODULE_ALIAS("platform:m66592_udc");
38 39
39#define DRIVER_VERSION "18 Oct 2007" 40#define DRIVER_VERSION "18 Oct 2007"
40 41
@@ -1671,6 +1672,7 @@ static struct platform_driver m66592_driver = {
1671 .remove = __exit_p(m66592_remove), 1672 .remove = __exit_p(m66592_remove),
1672 .driver = { 1673 .driver = {
1673 .name = (char *) udc_name, 1674 .name = (char *) udc_name,
1675 .owner = THIS_MODULE,
1674 }, 1676 },
1675}; 1677};
1676 1678
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index e6d68bda428a..ee1e9a314cd1 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -3109,4 +3109,4 @@ module_exit(udc_exit);
3109 3109
3110MODULE_DESCRIPTION(DRIVER_DESC); 3110MODULE_DESCRIPTION(DRIVER_DESC);
3111MODULE_LICENSE("GPL"); 3111MODULE_LICENSE("GPL");
3112 3112MODULE_ALIAS("platform:omap_udc");
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 096c41cc40d1..c00cd8b9d3d1 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -2380,4 +2380,4 @@ module_exit(udc_exit);
2380MODULE_DESCRIPTION(DRIVER_DESC); 2380MODULE_DESCRIPTION(DRIVER_DESC);
2381MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell"); 2381MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell");
2382MODULE_LICENSE("GPL"); 2382MODULE_LICENSE("GPL");
2383 2383MODULE_ALIAS("platform:pxa2xx-udc");
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index aadc4204d6f9..6b1ef488043b 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -2047,3 +2047,5 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
2047MODULE_DESCRIPTION(DRIVER_DESC); 2047MODULE_DESCRIPTION(DRIVER_DESC);
2048MODULE_VERSION(DRIVER_VERSION); 2048MODULE_VERSION(DRIVER_VERSION);
2049MODULE_LICENSE("GPL"); 2049MODULE_LICENSE("GPL");
2050MODULE_ALIAS("platform:s3c2410-usbgadget");
2051MODULE_ALIAS("platform:s3c2440-usbgadget");
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index d7071c855758..203a3359a648 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1684,14 +1684,18 @@ static int isp116x_resume(struct platform_device *dev)
1684 1684
1685#endif 1685#endif
1686 1686
1687/* work with hotplug and coldplug */
1688MODULE_ALIAS("platform:isp116x-hcd");
1689
1687static struct platform_driver isp116x_driver = { 1690static struct platform_driver isp116x_driver = {
1688 .probe = isp116x_probe, 1691 .probe = isp116x_probe,
1689 .remove = isp116x_remove, 1692 .remove = isp116x_remove,
1690 .suspend = isp116x_suspend, 1693 .suspend = isp116x_suspend,
1691 .resume = isp116x_resume, 1694 .resume = isp116x_resume,
1692 .driver = { 1695 .driver = {
1693 .name = (char *)hcd_name, 1696 .name = (char *)hcd_name,
1694 }, 1697 .owner = THIS_MODULE,
1698 },
1695}; 1699};
1696 1700
1697/*-----------------------------------------------------------------*/ 1701/*-----------------------------------------------------------------*/
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index 126fcbdd6408..d72dc07dda01 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -355,7 +355,7 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
355#define ohci_hcd_at91_drv_resume NULL 355#define ohci_hcd_at91_drv_resume NULL
356#endif 356#endif
357 357
358MODULE_ALIAS("at91_ohci"); 358MODULE_ALIAS("platform:at91_ohci");
359 359
360static struct platform_driver ohci_hcd_at91_driver = { 360static struct platform_driver ohci_hcd_at91_driver = {
361 .probe = ohci_hcd_at91_drv_probe, 361 .probe = ohci_hcd_at91_drv_probe,
@@ -368,4 +368,3 @@ static struct platform_driver ohci_hcd_at91_driver = {
368 .owner = THIS_MODULE, 368 .owner = THIS_MODULE,
369 }, 369 },
370}; 370};
371
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c
index 663a0600b6e7..f90fe0c7373f 100644
--- a/drivers/usb/host/ohci-au1xxx.c
+++ b/drivers/usb/host/ohci-au1xxx.c
@@ -345,3 +345,4 @@ static struct platform_driver ohci_hcd_au1xxx_driver = {
345 }, 345 },
346}; 346};
347 347
348MODULE_ALIAS("platform:au1xxx-ohci");
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index a68ce9d3c525..156e93a9d0df 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -211,6 +211,8 @@ static struct platform_driver ohci_hcd_ep93xx_driver = {
211#endif 211#endif
212 .driver = { 212 .driver = {
213 .name = "ep93xx-ohci", 213 .name = "ep93xx-ohci",
214 .owner = THIS_MODULE,
214 }, 215 },
215}; 216};
216 217
218MODULE_ALIAS("platform:ep93xx-ohci");
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c
index 4a043abd85ea..13c12ed22252 100644
--- a/drivers/usb/host/ohci-lh7a404.c
+++ b/drivers/usb/host/ohci-lh7a404.c
@@ -251,3 +251,4 @@ static struct platform_driver ohci_hcd_lh7a404_driver = {
251 }, 251 },
252}; 252};
253 253
254MODULE_ALIAS("platform:lh7a404-ohci");
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 74e1f4be10bb..7bfca1ed1b58 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -544,3 +544,4 @@ static struct platform_driver ohci_hcd_omap_driver = {
544 }, 544 },
545}; 545};
546 546
547MODULE_ALIAS("platform:ohci");
diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c
index 6c52c66b659f..28b458f20cc3 100644
--- a/drivers/usb/host/ohci-pnx4008.c
+++ b/drivers/usb/host/ohci-pnx4008.c
@@ -456,9 +456,13 @@ static int usb_hcd_pnx4008_remove(struct platform_device *pdev)
456 return 0; 456 return 0;
457} 457}
458 458
459/* work with hotplug and coldplug */
460MODULE_ALIAS("platform:usb-ohci");
461
459static struct platform_driver usb_hcd_pnx4008_driver = { 462static struct platform_driver usb_hcd_pnx4008_driver = {
460 .driver = { 463 .driver = {
461 .name = "usb-ohci", 464 .name = "usb-ohci",
465 .owner = THIS_MODULE,
462 }, 466 },
463 .probe = usb_hcd_pnx4008_probe, 467 .probe = usb_hcd_pnx4008_probe,
464 .remove = usb_hcd_pnx4008_remove, 468 .remove = usb_hcd_pnx4008_remove,
diff --git a/drivers/usb/host/ohci-pnx8550.c b/drivers/usb/host/ohci-pnx8550.c
index 85fdfd2a7ad0..605d59cba28e 100644
--- a/drivers/usb/host/ohci-pnx8550.c
+++ b/drivers/usb/host/ohci-pnx8550.c
@@ -230,11 +230,12 @@ static int ohci_hcd_pnx8550_drv_remove(struct platform_device *pdev)
230 return 0; 230 return 0;
231} 231}
232 232
233MODULE_ALIAS("pnx8550-ohci"); 233MODULE_ALIAS("platform:pnx8550-ohci");
234 234
235static struct platform_driver ohci_hcd_pnx8550_driver = { 235static struct platform_driver ohci_hcd_pnx8550_driver = {
236 .driver = { 236 .driver = {
237 .name = "pnx8550-ohci", 237 .name = "pnx8550-ohci",
238 .owner = THIS_MODULE,
238 }, 239 },
239 .probe = ohci_hcd_pnx8550_drv_probe, 240 .probe = ohci_hcd_pnx8550_drv_probe,
240 .remove = ohci_hcd_pnx8550_drv_remove, 241 .remove = ohci_hcd_pnx8550_drv_remove,
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c
index f95be1896b0d..523c30125577 100644
--- a/drivers/usb/host/ohci-ppc-soc.c
+++ b/drivers/usb/host/ohci-ppc-soc.c
@@ -213,3 +213,4 @@ static struct platform_driver ohci_hcd_ppc_soc_driver = {
213 }, 213 },
214}; 214};
215 215
216MODULE_ALIAS("platform:ppc-soc-ohci");
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index ff9a79843471..8ad9b3b604b5 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -364,6 +364,8 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
364} 364}
365#endif 365#endif
366 366
367/* work with hotplug and coldplug */
368MODULE_ALIAS("platform:pxa27x-ohci");
367 369
368static struct platform_driver ohci_hcd_pxa27x_driver = { 370static struct platform_driver ohci_hcd_pxa27x_driver = {
369 .probe = ohci_hcd_pxa27x_drv_probe, 371 .probe = ohci_hcd_pxa27x_drv_probe,
@@ -375,6 +377,7 @@ static struct platform_driver ohci_hcd_pxa27x_driver = {
375#endif 377#endif
376 .driver = { 378 .driver = {
377 .name = "pxa27x-ohci", 379 .name = "pxa27x-ohci",
380 .owner = THIS_MODULE,
378 }, 381 },
379}; 382};
380 383
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index 44b79e8a6e25..ead4772f0f27 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -501,3 +501,4 @@ static struct platform_driver ohci_hcd_s3c2410_driver = {
501 }, 501 },
502}; 502};
503 503
504MODULE_ALIAS("platform:s3c2410-ohci");
diff --git a/drivers/usb/host/ohci-sh.c b/drivers/usb/host/ohci-sh.c
index 5309ac039e15..e7ee607278fe 100644
--- a/drivers/usb/host/ohci-sh.c
+++ b/drivers/usb/host/ohci-sh.c
@@ -141,3 +141,4 @@ static struct platform_driver ohci_hcd_sh_driver = {
141 }, 141 },
142}; 142};
143 143
144MODULE_ALIAS("platform:sh_ohci");
diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
index a97070142869..4ea92762fb28 100644
--- a/drivers/usb/host/ohci-sm501.c
+++ b/drivers/usb/host/ohci-sm501.c
@@ -262,3 +262,4 @@ static struct platform_driver ohci_hcd_sm501_driver = {
262 .name = "sm501-usb", 262 .name = "sm501-usb",
263 }, 263 },
264}; 264};
265MODULE_ALIAS("platform:sm501-usb");
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index 0ce2fc5e396b..9f80e5285575 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -44,6 +44,7 @@
44MODULE_DESCRIPTION("R8A66597 USB Host Controller Driver"); 44MODULE_DESCRIPTION("R8A66597 USB Host Controller Driver");
45MODULE_LICENSE("GPL"); 45MODULE_LICENSE("GPL");
46MODULE_AUTHOR("Yoshihiro Shimoda"); 46MODULE_AUTHOR("Yoshihiro Shimoda");
47MODULE_ALIAS("platform:r8a66597_hcd");
47 48
48#define DRIVER_VERSION "29 May 2007" 49#define DRIVER_VERSION "29 May 2007"
49 50
@@ -2219,6 +2220,7 @@ static struct platform_driver r8a66597_driver = {
2219 .resume = r8a66597_resume, 2220 .resume = r8a66597_resume,
2220 .driver = { 2221 .driver = {
2221 .name = (char *) hcd_name, 2222 .name = (char *) hcd_name,
2223 .owner = THIS_MODULE,
2222 }, 2224 },
2223}; 2225};
2224 2226
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 59be276ccd9d..629bca0ebe8f 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -58,6 +58,7 @@
58 58
59MODULE_DESCRIPTION("SL811HS USB Host Controller Driver"); 59MODULE_DESCRIPTION("SL811HS USB Host Controller Driver");
60MODULE_LICENSE("GPL"); 60MODULE_LICENSE("GPL");
61MODULE_ALIAS("platform:sl811-hcd");
61 62
62#define DRIVER_VERSION "19 May 2005" 63#define DRIVER_VERSION "19 May 2005"
63 64
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 3033d6945202..8e117a795e93 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -3316,3 +3316,4 @@ static void __exit u132_hcd_exit(void)
3316 3316
3317module_exit(u132_hcd_exit); 3317module_exit(u132_hcd_exit);
3318MODULE_LICENSE("GPL"); 3318MODULE_LICENSE("GPL");
3319MODULE_ALIAS("platform:u132_hcd");
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index aa714028641e..c2fa5c630813 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -214,10 +214,7 @@ static void vring_disable_cb(struct virtqueue *_vq)
214{ 214{
215 struct vring_virtqueue *vq = to_vvq(_vq); 215 struct vring_virtqueue *vq = to_vvq(_vq);
216 216
217 START_USE(vq);
218 BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT);
219 vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; 217 vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
220 END_USE(vq);
221} 218}
222 219
223static bool vring_enable_cb(struct virtqueue *_vq) 220static bool vring_enable_cb(struct virtqueue *_vq)
diff --git a/drivers/watchdog/at32ap700x_wdt.c b/drivers/watchdog/at32ap700x_wdt.c
index fb5ed6478f78..ae0fca5e8749 100644
--- a/drivers/watchdog/at32ap700x_wdt.c
+++ b/drivers/watchdog/at32ap700x_wdt.c
@@ -418,6 +418,9 @@ static int at32_wdt_resume(struct platform_device *pdev)
418#define at32_wdt_resume NULL 418#define at32_wdt_resume NULL
419#endif 419#endif
420 420
421/* work with hotplug and coldplug */
422MODULE_ALIAS("platform:at32_wdt");
423
421static struct platform_driver at32_wdt_driver = { 424static struct platform_driver at32_wdt_driver = {
422 .remove = __exit_p(at32_wdt_remove), 425 .remove = __exit_p(at32_wdt_remove),
423 .suspend = at32_wdt_suspend, 426 .suspend = at32_wdt_suspend,
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c
index a684b1e87372..9ff9a9565320 100644
--- a/drivers/watchdog/at91rm9200_wdt.c
+++ b/drivers/watchdog/at91rm9200_wdt.c
@@ -286,3 +286,4 @@ MODULE_AUTHOR("Andrew Victor");
286MODULE_DESCRIPTION("Watchdog driver for Atmel AT91RM9200"); 286MODULE_DESCRIPTION("Watchdog driver for Atmel AT91RM9200");
287MODULE_LICENSE("GPL"); 287MODULE_LICENSE("GPL");
288MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 288MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
289MODULE_ALIAS("platform:at91_wdt");
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c
index a61cbd48dc07..1782c79eff06 100644
--- a/drivers/watchdog/davinci_wdt.c
+++ b/drivers/watchdog/davinci_wdt.c
@@ -248,6 +248,7 @@ static int davinci_wdt_remove(struct platform_device *pdev)
248static struct platform_driver platform_wdt_driver = { 248static struct platform_driver platform_wdt_driver = {
249 .driver = { 249 .driver = {
250 .name = "watchdog", 250 .name = "watchdog",
251 .owner = THIS_MODULE,
251 }, 252 },
252 .probe = davinci_wdt_probe, 253 .probe = davinci_wdt_probe,
253 .remove = davinci_wdt_remove, 254 .remove = davinci_wdt_remove,
@@ -277,3 +278,4 @@ MODULE_PARM_DESC(heartbeat,
277 278
278MODULE_LICENSE("GPL"); 279MODULE_LICENSE("GPL");
279MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 280MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
281MODULE_ALIAS("platform:watchdog");
diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c
index ca90c5192596..445b7e812112 100644
--- a/drivers/watchdog/it8712f_wdt.c
+++ b/drivers/watchdog/it8712f_wdt.c
@@ -200,6 +200,8 @@ it8712f_wdt_disable(void)
200 200
201 superio_outb(0, WDT_CONFIG); 201 superio_outb(0, WDT_CONFIG);
202 superio_outb(0, WDT_CONTROL); 202 superio_outb(0, WDT_CONTROL);
203 if (revision >= 0x08)
204 superio_outb(0, WDT_TIMEOUT + 1);
203 superio_outb(0, WDT_TIMEOUT); 205 superio_outb(0, WDT_TIMEOUT);
204 206
205 superio_exit(); 207 superio_exit();
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c
index e3a29c302309..df5a6b811ccd 100644
--- a/drivers/watchdog/ks8695_wdt.c
+++ b/drivers/watchdog/ks8695_wdt.c
@@ -306,3 +306,4 @@ MODULE_AUTHOR("Andrew Victor");
306MODULE_DESCRIPTION("Watchdog driver for KS8695"); 306MODULE_DESCRIPTION("Watchdog driver for KS8695");
307MODULE_LICENSE("GPL"); 307MODULE_LICENSE("GPL");
308MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 308MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
309MODULE_ALIAS("platform:ks8695_wdt");
diff --git a/drivers/watchdog/mpc83xx_wdt.c b/drivers/watchdog/mpc83xx_wdt.c
index 6369f569517f..b16c5cd972eb 100644
--- a/drivers/watchdog/mpc83xx_wdt.c
+++ b/drivers/watchdog/mpc83xx_wdt.c
@@ -206,6 +206,7 @@ static struct platform_driver mpc83xx_wdt_driver = {
206 .remove = __devexit_p(mpc83xx_wdt_remove), 206 .remove = __devexit_p(mpc83xx_wdt_remove),
207 .driver = { 207 .driver = {
208 .name = "mpc83xx_wdt", 208 .name = "mpc83xx_wdt",
209 .owner = THIS_MODULE,
209 }, 210 },
210}; 211};
211 212
@@ -226,3 +227,4 @@ MODULE_AUTHOR("Dave Updegraff, Kumar Gala");
226MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx uProcessor"); 227MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx uProcessor");
227MODULE_LICENSE("GPL"); 228MODULE_LICENSE("GPL");
228MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 229MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
230MODULE_ALIAS("platform:mpc83xx_wdt");
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c
index 0d2b27735419..009573b81496 100644
--- a/drivers/watchdog/mpcore_wdt.c
+++ b/drivers/watchdog/mpcore_wdt.c
@@ -392,6 +392,9 @@ static int __devexit mpcore_wdt_remove(struct platform_device *dev)
392 return 0; 392 return 0;
393} 393}
394 394
395/* work with hotplug and coldplug */
396MODULE_ALIAS("platform:mpcore_wdt");
397
395static struct platform_driver mpcore_wdt_driver = { 398static struct platform_driver mpcore_wdt_driver = {
396 .probe = mpcore_wdt_probe, 399 .probe = mpcore_wdt_probe,
397 .remove = __devexit_p(mpcore_wdt_remove), 400 .remove = __devexit_p(mpcore_wdt_remove),
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c
index 10b89f2703bd..a8e67383784e 100644
--- a/drivers/watchdog/mtx-1_wdt.c
+++ b/drivers/watchdog/mtx-1_wdt.c
@@ -243,6 +243,7 @@ static struct platform_driver mtx1_wdt = {
243 .probe = mtx1_wdt_probe, 243 .probe = mtx1_wdt_probe,
244 .remove = mtx1_wdt_remove, 244 .remove = mtx1_wdt_remove,
245 .driver.name = "mtx1-wdt", 245 .driver.name = "mtx1-wdt",
246 .driver.owner = THIS_MODULE,
246}; 247};
247 248
248static int __init mtx1_wdt_init(void) 249static int __init mtx1_wdt_init(void)
@@ -262,3 +263,4 @@ MODULE_AUTHOR("Michael Stickel, Florian Fainelli");
262MODULE_DESCRIPTION("Driver for the MTX-1 watchdog"); 263MODULE_DESCRIPTION("Driver for the MTX-1 watchdog");
263MODULE_LICENSE("GPL"); 264MODULE_LICENSE("GPL");
264MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 265MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
266MODULE_ALIAS("platform:mtx1-wdt");
diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c
index 0365c317f7e1..b59ca3273967 100644
--- a/drivers/watchdog/mv64x60_wdt.c
+++ b/drivers/watchdog/mv64x60_wdt.c
@@ -324,3 +324,4 @@ MODULE_AUTHOR("James Chapman <jchapman@katalix.com>");
324MODULE_DESCRIPTION("MV64x60 watchdog driver"); 324MODULE_DESCRIPTION("MV64x60 watchdog driver");
325MODULE_LICENSE("GPL"); 325MODULE_LICENSE("GPL");
326MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 326MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
327MODULE_ALIAS("platform:" MV64x60_WDT_NAME);
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 635ca454f56b..74bc39aa1ce8 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -387,3 +387,4 @@ module_exit(omap_wdt_exit);
387MODULE_AUTHOR("George G. Davis"); 387MODULE_AUTHOR("George G. Davis");
388MODULE_LICENSE("GPL"); 388MODULE_LICENSE("GPL");
389MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 389MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
390MODULE_ALIAS("platform:omap_wdt");
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index b04aa096a10a..6b8483d3c783 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -321,6 +321,7 @@ static int pnx4008_wdt_remove(struct platform_device *pdev)
321static struct platform_driver platform_wdt_driver = { 321static struct platform_driver platform_wdt_driver = {
322 .driver = { 322 .driver = {
323 .name = "watchdog", 323 .name = "watchdog",
324 .owner = THIS_MODULE,
324 }, 325 },
325 .probe = pnx4008_wdt_probe, 326 .probe = pnx4008_wdt_probe,
326 .remove = pnx4008_wdt_remove, 327 .remove = pnx4008_wdt_remove,
@@ -354,3 +355,4 @@ MODULE_PARM_DESC(nowayout,
354 355
355MODULE_LICENSE("GPL"); 356MODULE_LICENSE("GPL");
356MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 357MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
358MODULE_ALIAS("platform:watchdog");
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 7645e8812156..98532c0e0689 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -561,3 +561,4 @@ MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>, "
561MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver"); 561MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver");
562MODULE_LICENSE("GPL"); 562MODULE_LICENSE("GPL");
563MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 563MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
564MODULE_ALIAS("platform:s3c2410-wdt");
diff --git a/drivers/watchdog/txx9wdt.c b/drivers/watchdog/txx9wdt.c
index 328b3c7211ef..57cefef27ce3 100644
--- a/drivers/watchdog/txx9wdt.c
+++ b/drivers/watchdog/txx9wdt.c
@@ -274,3 +274,4 @@ module_exit(watchdog_exit);
274MODULE_DESCRIPTION("TXx9 Watchdog Driver"); 274MODULE_DESCRIPTION("TXx9 Watchdog Driver");
275MODULE_LICENSE("GPL"); 275MODULE_LICENSE("GPL");
276MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 276MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
277MODULE_ALIAS("platform:txx9wdt");
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index ea94dbabf9a9..d85dc6d41c2a 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -381,11 +381,15 @@ EXPORT_SYMBOL_GPL(gnttab_cancel_free_callback);
381static int grow_gnttab_list(unsigned int more_frames) 381static int grow_gnttab_list(unsigned int more_frames)
382{ 382{
383 unsigned int new_nr_grant_frames, extra_entries, i; 383 unsigned int new_nr_grant_frames, extra_entries, i;
384 unsigned int nr_glist_frames, new_nr_glist_frames;
384 385
385 new_nr_grant_frames = nr_grant_frames + more_frames; 386 new_nr_grant_frames = nr_grant_frames + more_frames;
386 extra_entries = more_frames * GREFS_PER_GRANT_FRAME; 387 extra_entries = more_frames * GREFS_PER_GRANT_FRAME;
387 388
388 for (i = nr_grant_frames; i < new_nr_grant_frames; i++) { 389 nr_glist_frames = (nr_grant_frames * GREFS_PER_GRANT_FRAME + RPP - 1) / RPP;
390 new_nr_glist_frames =
391 (new_nr_grant_frames * GREFS_PER_GRANT_FRAME + RPP - 1) / RPP;
392 for (i = nr_glist_frames; i < new_nr_glist_frames; i++) {
389 gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_ATOMIC); 393 gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_ATOMIC);
390 if (!gnttab_list[i]) 394 if (!gnttab_list[i])
391 goto grow_nomem; 395 goto grow_nomem;
@@ -407,7 +411,7 @@ static int grow_gnttab_list(unsigned int more_frames)
407 return 0; 411 return 0;
408 412
409grow_nomem: 413grow_nomem:
410 for ( ; i >= nr_grant_frames; i--) 414 for ( ; i >= nr_glist_frames; i--)
411 free_page((unsigned long) gnttab_list[i]); 415 free_page((unsigned long) gnttab_list[i]);
412 return -ENOMEM; 416 return -ENOMEM;
413} 417}
@@ -530,7 +534,7 @@ static int gnttab_expand(unsigned int req_entries)
530static int __devinit gnttab_init(void) 534static int __devinit gnttab_init(void)
531{ 535{
532 int i; 536 int i;
533 unsigned int max_nr_glist_frames; 537 unsigned int max_nr_glist_frames, nr_glist_frames;
534 unsigned int nr_init_grefs; 538 unsigned int nr_init_grefs;
535 539
536 if (!is_running_on_xen()) 540 if (!is_running_on_xen())
@@ -543,15 +547,15 @@ static int __devinit gnttab_init(void)
543 * grant reference free list on the current hypervisor. 547 * grant reference free list on the current hypervisor.
544 */ 548 */
545 max_nr_glist_frames = (boot_max_nr_grant_frames * 549 max_nr_glist_frames = (boot_max_nr_grant_frames *
546 GREFS_PER_GRANT_FRAME / 550 GREFS_PER_GRANT_FRAME / RPP);
547 (PAGE_SIZE / sizeof(grant_ref_t)));
548 551
549 gnttab_list = kmalloc(max_nr_glist_frames * sizeof(grant_ref_t *), 552 gnttab_list = kmalloc(max_nr_glist_frames * sizeof(grant_ref_t *),
550 GFP_KERNEL); 553 GFP_KERNEL);
551 if (gnttab_list == NULL) 554 if (gnttab_list == NULL)
552 return -ENOMEM; 555 return -ENOMEM;
553 556
554 for (i = 0; i < nr_grant_frames; i++) { 557 nr_glist_frames = (nr_grant_frames * GREFS_PER_GRANT_FRAME + RPP - 1) / RPP;
558 for (i = 0; i < nr_glist_frames; i++) {
555 gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_KERNEL); 559 gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_KERNEL);
556 if (gnttab_list[i] == NULL) 560 if (gnttab_list[i] == NULL)
557 goto ini_nomem; 561 goto ini_nomem;