diff options
Diffstat (limited to 'drivers')
46 files changed, 386 insertions, 294 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index d3f0a62efcc1..ee68ac54c0d4 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -138,7 +138,7 @@ static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = { | |||
138 | { | 138 | { |
139 | set_no_mwait, "Extensa 5220", { | 139 | set_no_mwait, "Extensa 5220", { |
140 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), | 140 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), |
141 | DMI_MATCH(DMI_SYS_VENDOR, "ACER"), | 141 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
142 | DMI_MATCH(DMI_PRODUCT_VERSION, "0100"), | 142 | DMI_MATCH(DMI_PRODUCT_VERSION, "0100"), |
143 | DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL}, | 143 | DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL}, |
144 | {}, | 144 | {}, |
diff --git a/drivers/char/random.c b/drivers/char/random.c index 1838aa3d24fe..7ce1ac4baa6d 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -407,7 +407,7 @@ struct entropy_store { | |||
407 | /* read-write data: */ | 407 | /* read-write data: */ |
408 | spinlock_t lock; | 408 | spinlock_t lock; |
409 | unsigned add_ptr; | 409 | unsigned add_ptr; |
410 | int entropy_count; | 410 | int entropy_count; /* Must at no time exceed ->POOLBITS! */ |
411 | int input_rotate; | 411 | int input_rotate; |
412 | }; | 412 | }; |
413 | 413 | ||
@@ -520,6 +520,7 @@ static void mix_pool_bytes(struct entropy_store *r, const void *in, int bytes) | |||
520 | static void credit_entropy_bits(struct entropy_store *r, int nbits) | 520 | static void credit_entropy_bits(struct entropy_store *r, int nbits) |
521 | { | 521 | { |
522 | unsigned long flags; | 522 | unsigned long flags; |
523 | int entropy_count; | ||
523 | 524 | ||
524 | if (!nbits) | 525 | if (!nbits) |
525 | return; | 526 | return; |
@@ -527,20 +528,20 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits) | |||
527 | spin_lock_irqsave(&r->lock, flags); | 528 | spin_lock_irqsave(&r->lock, flags); |
528 | 529 | ||
529 | DEBUG_ENT("added %d entropy credits to %s\n", nbits, r->name); | 530 | DEBUG_ENT("added %d entropy credits to %s\n", nbits, r->name); |
530 | r->entropy_count += nbits; | 531 | entropy_count = r->entropy_count; |
531 | if (r->entropy_count < 0) { | 532 | entropy_count += nbits; |
533 | if (entropy_count < 0) { | ||
532 | DEBUG_ENT("negative entropy/overflow\n"); | 534 | DEBUG_ENT("negative entropy/overflow\n"); |
533 | r->entropy_count = 0; | 535 | entropy_count = 0; |
534 | } else if (r->entropy_count > r->poolinfo->POOLBITS) | 536 | } else if (entropy_count > r->poolinfo->POOLBITS) |
535 | r->entropy_count = r->poolinfo->POOLBITS; | 537 | entropy_count = r->poolinfo->POOLBITS; |
538 | r->entropy_count = entropy_count; | ||
536 | 539 | ||
537 | /* should we wake readers? */ | 540 | /* should we wake readers? */ |
538 | if (r == &input_pool && | 541 | if (r == &input_pool && entropy_count >= random_read_wakeup_thresh) { |
539 | r->entropy_count >= random_read_wakeup_thresh) { | ||
540 | wake_up_interruptible(&random_read_wait); | 542 | wake_up_interruptible(&random_read_wait); |
541 | kill_fasync(&fasync, SIGIO, POLL_IN); | 543 | kill_fasync(&fasync, SIGIO, POLL_IN); |
542 | } | 544 | } |
543 | |||
544 | spin_unlock_irqrestore(&r->lock, flags); | 545 | spin_unlock_irqrestore(&r->lock, flags); |
545 | } | 546 | } |
546 | 547 | ||
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 8024e3bfd877..b91ef63126ed 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c | |||
@@ -669,8 +669,7 @@ static int __init ibft_register_kobjects(struct ibft_table_header *header, | |||
669 | 669 | ||
670 | control = (void *)header + sizeof(*header); | 670 | control = (void *)header + sizeof(*header); |
671 | end = (void *)control + control->hdr.length; | 671 | end = (void *)control + control->hdr.length; |
672 | eot_offset = (void *)header + header->length - | 672 | eot_offset = (void *)header + header->length - (void *)control; |
673 | (void *)control - sizeof(*header); | ||
674 | rc = ibft_verify_hdr("control", (struct ibft_hdr *)control, id_control, | 673 | rc = ibft_verify_hdr("control", (struct ibft_hdr *)control, id_control, |
675 | sizeof(*control)); | 674 | sizeof(*control)); |
676 | 675 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index 3331f88dcfb6..248ab4a7d39f 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu/drm/radeon/radeon_cp.c | |||
@@ -223,7 +223,7 @@ static int radeon_do_wait_for_fifo(drm_radeon_private_t * dev_priv, int entries) | |||
223 | return 0; | 223 | return 0; |
224 | DRM_UDELAY(1); | 224 | DRM_UDELAY(1); |
225 | } | 225 | } |
226 | DRM_INFO("wait for fifo failed status : 0x%08X 0x%08X\n", | 226 | DRM_DEBUG("wait for fifo failed status : 0x%08X 0x%08X\n", |
227 | RADEON_READ(RADEON_RBBM_STATUS), | 227 | RADEON_READ(RADEON_RBBM_STATUS), |
228 | RADEON_READ(R300_VAP_CNTL_STATUS)); | 228 | RADEON_READ(R300_VAP_CNTL_STATUS)); |
229 | 229 | ||
@@ -252,7 +252,7 @@ static int radeon_do_wait_for_idle(drm_radeon_private_t * dev_priv) | |||
252 | } | 252 | } |
253 | DRM_UDELAY(1); | 253 | DRM_UDELAY(1); |
254 | } | 254 | } |
255 | DRM_INFO("wait idle failed status : 0x%08X 0x%08X\n", | 255 | DRM_DEBUG("wait idle failed status : 0x%08X 0x%08X\n", |
256 | RADEON_READ(RADEON_RBBM_STATUS), | 256 | RADEON_READ(RADEON_RBBM_STATUS), |
257 | RADEON_READ(R300_VAP_CNTL_STATUS)); | 257 | RADEON_READ(R300_VAP_CNTL_STATUS)); |
258 | 258 | ||
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index a34758d29516..fc735ab08ff4 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -242,7 +242,7 @@ config BLK_DEV_IDEFLOPPY | |||
242 | module will be called ide-floppy. | 242 | module will be called ide-floppy. |
243 | 243 | ||
244 | config BLK_DEV_IDESCSI | 244 | config BLK_DEV_IDESCSI |
245 | tristate "SCSI emulation support" | 245 | tristate "SCSI emulation support (DEPRECATED)" |
246 | depends on SCSI | 246 | depends on SCSI |
247 | select IDE_ATAPI | 247 | select IDE_ATAPI |
248 | ---help--- | 248 | ---help--- |
@@ -255,20 +255,6 @@ config BLK_DEV_IDESCSI | |||
255 | and will allow you to use a SCSI device driver instead of a native | 255 | and will allow you to use a SCSI device driver instead of a native |
256 | ATAPI driver. | 256 | ATAPI driver. |
257 | 257 | ||
258 | This is useful if you have an ATAPI device for which no native | ||
259 | driver has been written (for example, an ATAPI PD-CD drive); | ||
260 | you can then use this emulation together with an appropriate SCSI | ||
261 | device driver. In order to do this, say Y here and to "SCSI support" | ||
262 | and "SCSI generic support", below. You must then provide the kernel | ||
263 | command line "hdx=ide-scsi" (try "man bootparam" or see the | ||
264 | documentation of your boot loader (lilo or loadlin) about how to | ||
265 | pass options to the kernel at boot time) for devices if you want the | ||
266 | native EIDE sub-drivers to skip over the native support, so that | ||
267 | this SCSI emulation can be used instead. | ||
268 | |||
269 | Note that this option does NOT allow you to attach SCSI devices to a | ||
270 | box that doesn't have a SCSI host adapter installed. | ||
271 | |||
272 | If both this SCSI emulation and native ATAPI support are compiled | 258 | If both this SCSI emulation and native ATAPI support are compiled |
273 | into the kernel, the native support will be used. | 259 | into the kernel, the native support will be used. |
274 | 260 | ||
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c index f788fa5a977b..4fd91dcf1dc2 100644 --- a/drivers/ide/arm/palm_bk3710.c +++ b/drivers/ide/arm/palm_bk3710.c | |||
@@ -343,11 +343,10 @@ static struct ide_port_info __devinitdata palm_bk3710_port_info = { | |||
343 | .mwdma_mask = ATA_MWDMA2, | 343 | .mwdma_mask = ATA_MWDMA2, |
344 | }; | 344 | }; |
345 | 345 | ||
346 | static int __devinit palm_bk3710_probe(struct platform_device *pdev) | 346 | static int __init palm_bk3710_probe(struct platform_device *pdev) |
347 | { | 347 | { |
348 | struct clk *clk; | 348 | struct clk *clk; |
349 | struct resource *mem, *irq; | 349 | struct resource *mem, *irq; |
350 | struct ide_host *host; | ||
351 | unsigned long base, rate; | 350 | unsigned long base, rate; |
352 | int i, rc; | 351 | int i, rc; |
353 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | 352 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; |
@@ -390,6 +389,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) | |||
390 | hw.io_ports_array[i] = base + IDE_PALM_ATA_PRI_REG_OFFSET + i; | 389 | hw.io_ports_array[i] = base + IDE_PALM_ATA_PRI_REG_OFFSET + i; |
391 | hw.io_ports.ctl_addr = base + IDE_PALM_ATA_PRI_CTL_OFFSET; | 390 | hw.io_ports.ctl_addr = base + IDE_PALM_ATA_PRI_CTL_OFFSET; |
392 | hw.irq = irq->start; | 391 | hw.irq = irq->start; |
392 | hw.dev = &pdev->dev; | ||
393 | hw.chipset = ide_palm3710; | 393 | hw.chipset = ide_palm3710; |
394 | 394 | ||
395 | palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 : | 395 | palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 : |
@@ -413,13 +413,11 @@ static struct platform_driver platform_bk_driver = { | |||
413 | .name = "palm_bk3710", | 413 | .name = "palm_bk3710", |
414 | .owner = THIS_MODULE, | 414 | .owner = THIS_MODULE, |
415 | }, | 415 | }, |
416 | .probe = palm_bk3710_probe, | ||
417 | .remove = NULL, | ||
418 | }; | 416 | }; |
419 | 417 | ||
420 | static int __init palm_bk3710_init(void) | 418 | static int __init palm_bk3710_init(void) |
421 | { | 419 | { |
422 | return platform_driver_register(&platform_bk_driver); | 420 | return platform_driver_probe(&platform_bk_driver, palm_bk3710_probe); |
423 | } | 421 | } |
424 | 422 | ||
425 | module_init(palm_bk3710_init); | 423 | module_init(palm_bk3710_init); |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 49a8c589e346..f1489999cf91 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -1933,6 +1933,7 @@ static void ide_cd_remove(ide_drive_t *drive) | |||
1933 | 1933 | ||
1934 | ide_proc_unregister_driver(drive, info->driver); | 1934 | ide_proc_unregister_driver(drive, info->driver); |
1935 | 1935 | ||
1936 | blk_unregister_filter(info->disk); | ||
1936 | del_gendisk(info->disk); | 1937 | del_gendisk(info->disk); |
1937 | 1938 | ||
1938 | ide_cd_put(info); | 1939 | ide_cd_put(info); |
@@ -2158,6 +2159,7 @@ static int ide_cd_probe(ide_drive_t *drive) | |||
2158 | g->fops = &idecd_ops; | 2159 | g->fops = &idecd_ops; |
2159 | g->flags |= GENHD_FL_REMOVABLE; | 2160 | g->flags |= GENHD_FL_REMOVABLE; |
2160 | add_disk(g); | 2161 | add_disk(g); |
2162 | blk_register_filter(g); | ||
2161 | return 0; | 2163 | return 0; |
2162 | 2164 | ||
2163 | out_free_cd: | 2165 | out_free_cd: |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 68b9cf0138b0..07ef88bd109b 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -445,20 +445,6 @@ static void idedisk_check_hpa(ide_drive_t *drive) | |||
445 | } | 445 | } |
446 | } | 446 | } |
447 | 447 | ||
448 | /* | ||
449 | * Compute drive->capacity, the full capacity of the drive | ||
450 | * Called with drive->id != NULL. | ||
451 | * | ||
452 | * To compute capacity, this uses either of | ||
453 | * | ||
454 | * 1. CHS value set by user (whatever user sets will be trusted) | ||
455 | * 2. LBA value from target drive (require new ATA feature) | ||
456 | * 3. LBA value from system BIOS (new one is OK, old one may break) | ||
457 | * 4. CHS value from system BIOS (traditional style) | ||
458 | * | ||
459 | * in above order (i.e., if value of higher priority is available, | ||
460 | * reset will be ignored). | ||
461 | */ | ||
462 | static void init_idedisk_capacity(ide_drive_t *drive) | 448 | static void init_idedisk_capacity(ide_drive_t *drive) |
463 | { | 449 | { |
464 | struct hd_driveid *id = drive->id; | 450 | struct hd_driveid *id = drive->id; |
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 7e65bad522cb..ac89a5deaca2 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -238,15 +238,47 @@ static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long inde | |||
238 | 238 | ||
239 | } | 239 | } |
240 | 240 | ||
241 | static mdk_rdev_t *next_active_rdev(mdk_rdev_t *rdev, mddev_t *mddev) | ||
242 | { | ||
243 | /* Iterate the disks of an mddev, using rcu to protect access to the | ||
244 | * linked list, and raising the refcount of devices we return to ensure | ||
245 | * they don't disappear while in use. | ||
246 | * As devices are only added or removed when raid_disk is < 0 and | ||
247 | * nr_pending is 0 and In_sync is clear, the entries we return will | ||
248 | * still be in the same position on the list when we re-enter | ||
249 | * list_for_each_continue_rcu. | ||
250 | */ | ||
251 | struct list_head *pos; | ||
252 | rcu_read_lock(); | ||
253 | if (rdev == NULL) | ||
254 | /* start at the beginning */ | ||
255 | pos = &mddev->disks; | ||
256 | else { | ||
257 | /* release the previous rdev and start from there. */ | ||
258 | rdev_dec_pending(rdev, mddev); | ||
259 | pos = &rdev->same_set; | ||
260 | } | ||
261 | list_for_each_continue_rcu(pos, &mddev->disks) { | ||
262 | rdev = list_entry(pos, mdk_rdev_t, same_set); | ||
263 | if (rdev->raid_disk >= 0 && | ||
264 | test_bit(In_sync, &rdev->flags) && | ||
265 | !test_bit(Faulty, &rdev->flags)) { | ||
266 | /* this is a usable devices */ | ||
267 | atomic_inc(&rdev->nr_pending); | ||
268 | rcu_read_unlock(); | ||
269 | return rdev; | ||
270 | } | ||
271 | } | ||
272 | rcu_read_unlock(); | ||
273 | return NULL; | ||
274 | } | ||
275 | |||
241 | static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) | 276 | static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) |
242 | { | 277 | { |
243 | mdk_rdev_t *rdev; | 278 | mdk_rdev_t *rdev = NULL; |
244 | mddev_t *mddev = bitmap->mddev; | 279 | mddev_t *mddev = bitmap->mddev; |
245 | 280 | ||
246 | rcu_read_lock(); | 281 | while ((rdev = next_active_rdev(rdev, mddev)) != NULL) { |
247 | rdev_for_each_rcu(rdev, mddev) | ||
248 | if (test_bit(In_sync, &rdev->flags) | ||
249 | && !test_bit(Faulty, &rdev->flags)) { | ||
250 | int size = PAGE_SIZE; | 282 | int size = PAGE_SIZE; |
251 | if (page->index == bitmap->file_pages-1) | 283 | if (page->index == bitmap->file_pages-1) |
252 | size = roundup(bitmap->last_page_size, | 284 | size = roundup(bitmap->last_page_size, |
@@ -281,8 +313,7 @@ static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) | |||
281 | + page->index * (PAGE_SIZE/512), | 313 | + page->index * (PAGE_SIZE/512), |
282 | size, | 314 | size, |
283 | page); | 315 | page); |
284 | } | 316 | } |
285 | rcu_read_unlock(); | ||
286 | 317 | ||
287 | if (wait) | 318 | if (wait) |
288 | md_super_wait(mddev); | 319 | md_super_wait(mddev); |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 8cfadc5bd2ba..4790c83d78d0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -3841,8 +3841,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
3841 | 3841 | ||
3842 | del_timer_sync(&mddev->safemode_timer); | 3842 | del_timer_sync(&mddev->safemode_timer); |
3843 | 3843 | ||
3844 | invalidate_partition(disk, 0); | ||
3845 | |||
3846 | switch(mode) { | 3844 | switch(mode) { |
3847 | case 1: /* readonly */ | 3845 | case 1: /* readonly */ |
3848 | err = -ENXIO; | 3846 | err = -ENXIO; |
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c index c6c77a505ec1..d8b0d326e452 100644 --- a/drivers/misc/acer-wmi.c +++ b/drivers/misc/acer-wmi.c | |||
@@ -1189,7 +1189,7 @@ static int create_debugfs(void) | |||
1189 | return 0; | 1189 | return 0; |
1190 | 1190 | ||
1191 | error_debugfs: | 1191 | error_debugfs: |
1192 | remove_debugfs(); | 1192 | remove_debugfs(); |
1193 | return -ENOMEM; | 1193 | return -ENOMEM; |
1194 | } | 1194 | } |
1195 | 1195 | ||
@@ -1272,6 +1272,7 @@ error_platform_register: | |||
1272 | static void __exit acer_wmi_exit(void) | 1272 | static void __exit acer_wmi_exit(void) |
1273 | { | 1273 | { |
1274 | remove_sysfs(acer_platform_device); | 1274 | remove_sysfs(acer_platform_device); |
1275 | remove_debugfs(); | ||
1275 | platform_device_del(acer_platform_device); | 1276 | platform_device_del(acer_platform_device); |
1276 | platform_driver_unregister(&acer_platform_driver); | 1277 | platform_driver_unregister(&acer_platform_driver); |
1277 | 1278 | ||
diff --git a/drivers/misc/hp-wmi.c b/drivers/misc/hp-wmi.c index 1dbcbcb323a2..6d407c2a4f91 100644 --- a/drivers/misc/hp-wmi.c +++ b/drivers/misc/hp-wmi.c | |||
@@ -49,6 +49,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); | |||
49 | #define HPWMI_ALS_QUERY 0x3 | 49 | #define HPWMI_ALS_QUERY 0x3 |
50 | #define HPWMI_DOCK_QUERY 0x4 | 50 | #define HPWMI_DOCK_QUERY 0x4 |
51 | #define HPWMI_WIRELESS_QUERY 0x5 | 51 | #define HPWMI_WIRELESS_QUERY 0x5 |
52 | #define HPWMI_HOTKEY_QUERY 0xc | ||
52 | 53 | ||
53 | static int __init hp_wmi_bios_setup(struct platform_device *device); | 54 | static int __init hp_wmi_bios_setup(struct platform_device *device); |
54 | static int __exit hp_wmi_bios_remove(struct platform_device *device); | 55 | static int __exit hp_wmi_bios_remove(struct platform_device *device); |
@@ -69,7 +70,7 @@ struct bios_return { | |||
69 | 70 | ||
70 | struct key_entry { | 71 | struct key_entry { |
71 | char type; /* See KE_* below */ | 72 | char type; /* See KE_* below */ |
72 | u8 code; | 73 | u16 code; |
73 | u16 keycode; | 74 | u16 keycode; |
74 | }; | 75 | }; |
75 | 76 | ||
@@ -79,7 +80,9 @@ static struct key_entry hp_wmi_keymap[] = { | |||
79 | {KE_SW, 0x01, SW_DOCK}, | 80 | {KE_SW, 0x01, SW_DOCK}, |
80 | {KE_KEY, 0x02, KEY_BRIGHTNESSUP}, | 81 | {KE_KEY, 0x02, KEY_BRIGHTNESSUP}, |
81 | {KE_KEY, 0x03, KEY_BRIGHTNESSDOWN}, | 82 | {KE_KEY, 0x03, KEY_BRIGHTNESSDOWN}, |
82 | {KE_KEY, 0x04, KEY_HELP}, | 83 | {KE_KEY, 0x20e6, KEY_PROG1}, |
84 | {KE_KEY, 0x2142, KEY_MEDIA}, | ||
85 | {KE_KEY, 0x231b, KEY_HELP}, | ||
83 | {KE_END, 0} | 86 | {KE_END, 0} |
84 | }; | 87 | }; |
85 | 88 | ||
@@ -177,9 +180,9 @@ static int hp_wmi_wifi_state(void) | |||
177 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); | 180 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); |
178 | 181 | ||
179 | if (wireless & 0x100) | 182 | if (wireless & 0x100) |
180 | return 1; | 183 | return RFKILL_STATE_UNBLOCKED; |
181 | else | 184 | else |
182 | return 0; | 185 | return RFKILL_STATE_SOFT_BLOCKED; |
183 | } | 186 | } |
184 | 187 | ||
185 | static int hp_wmi_bluetooth_state(void) | 188 | static int hp_wmi_bluetooth_state(void) |
@@ -187,9 +190,9 @@ static int hp_wmi_bluetooth_state(void) | |||
187 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); | 190 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); |
188 | 191 | ||
189 | if (wireless & 0x10000) | 192 | if (wireless & 0x10000) |
190 | return 1; | 193 | return RFKILL_STATE_UNBLOCKED; |
191 | else | 194 | else |
192 | return 0; | 195 | return RFKILL_STATE_SOFT_BLOCKED; |
193 | } | 196 | } |
194 | 197 | ||
195 | static int hp_wmi_wwan_state(void) | 198 | static int hp_wmi_wwan_state(void) |
@@ -197,9 +200,9 @@ static int hp_wmi_wwan_state(void) | |||
197 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); | 200 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); |
198 | 201 | ||
199 | if (wireless & 0x1000000) | 202 | if (wireless & 0x1000000) |
200 | return 1; | 203 | return RFKILL_STATE_UNBLOCKED; |
201 | else | 204 | else |
202 | return 0; | 205 | return RFKILL_STATE_SOFT_BLOCKED; |
203 | } | 206 | } |
204 | 207 | ||
205 | static ssize_t show_display(struct device *dev, struct device_attribute *attr, | 208 | static ssize_t show_display(struct device *dev, struct device_attribute *attr, |
@@ -318,6 +321,9 @@ void hp_wmi_notify(u32 value, void *context) | |||
318 | 321 | ||
319 | if (obj && obj->type == ACPI_TYPE_BUFFER && obj->buffer.length == 8) { | 322 | if (obj && obj->type == ACPI_TYPE_BUFFER && obj->buffer.length == 8) { |
320 | int eventcode = *((u8 *) obj->buffer.pointer); | 323 | int eventcode = *((u8 *) obj->buffer.pointer); |
324 | if (eventcode == 0x4) | ||
325 | eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0, | ||
326 | 0); | ||
321 | key = hp_wmi_get_entry_by_scancode(eventcode); | 327 | key = hp_wmi_get_entry_by_scancode(eventcode); |
322 | if (key) { | 328 | if (key) { |
323 | switch (key->type) { | 329 | switch (key->type) { |
@@ -338,12 +344,14 @@ void hp_wmi_notify(u32 value, void *context) | |||
338 | } | 344 | } |
339 | } else if (eventcode == 0x5) { | 345 | } else if (eventcode == 0x5) { |
340 | if (wifi_rfkill) | 346 | if (wifi_rfkill) |
341 | wifi_rfkill->state = hp_wmi_wifi_state(); | 347 | rfkill_force_state(wifi_rfkill, |
348 | hp_wmi_wifi_state()); | ||
342 | if (bluetooth_rfkill) | 349 | if (bluetooth_rfkill) |
343 | bluetooth_rfkill->state = | 350 | rfkill_force_state(bluetooth_rfkill, |
344 | hp_wmi_bluetooth_state(); | 351 | hp_wmi_bluetooth_state()); |
345 | if (wwan_rfkill) | 352 | if (wwan_rfkill) |
346 | wwan_rfkill->state = hp_wmi_wwan_state(); | 353 | rfkill_force_state(wwan_rfkill, |
354 | hp_wmi_wwan_state()); | ||
347 | } else | 355 | } else |
348 | printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n", | 356 | printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n", |
349 | eventcode); | 357 | eventcode); |
@@ -398,6 +406,7 @@ static void cleanup_sysfs(struct platform_device *device) | |||
398 | static int __init hp_wmi_bios_setup(struct platform_device *device) | 406 | static int __init hp_wmi_bios_setup(struct platform_device *device) |
399 | { | 407 | { |
400 | int err; | 408 | int err; |
409 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); | ||
401 | 410 | ||
402 | err = device_create_file(&device->dev, &dev_attr_display); | 411 | err = device_create_file(&device->dev, &dev_attr_display); |
403 | if (err) | 412 | if (err) |
@@ -412,28 +421,33 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) | |||
412 | if (err) | 421 | if (err) |
413 | goto add_sysfs_error; | 422 | goto add_sysfs_error; |
414 | 423 | ||
415 | wifi_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WLAN); | 424 | if (wireless & 0x1) { |
416 | wifi_rfkill->name = "hp-wifi"; | 425 | wifi_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WLAN); |
417 | wifi_rfkill->state = hp_wmi_wifi_state(); | 426 | wifi_rfkill->name = "hp-wifi"; |
418 | wifi_rfkill->toggle_radio = hp_wmi_wifi_set; | 427 | wifi_rfkill->state = hp_wmi_wifi_state(); |
419 | wifi_rfkill->user_claim_unsupported = 1; | 428 | wifi_rfkill->toggle_radio = hp_wmi_wifi_set; |
420 | 429 | wifi_rfkill->user_claim_unsupported = 1; | |
421 | bluetooth_rfkill = rfkill_allocate(&device->dev, | 430 | rfkill_register(wifi_rfkill); |
422 | RFKILL_TYPE_BLUETOOTH); | 431 | } |
423 | bluetooth_rfkill->name = "hp-bluetooth"; | 432 | |
424 | bluetooth_rfkill->state = hp_wmi_bluetooth_state(); | 433 | if (wireless & 0x2) { |
425 | bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set; | 434 | bluetooth_rfkill = rfkill_allocate(&device->dev, |
426 | bluetooth_rfkill->user_claim_unsupported = 1; | 435 | RFKILL_TYPE_BLUETOOTH); |
427 | 436 | bluetooth_rfkill->name = "hp-bluetooth"; | |
428 | wwan_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WIMAX); | 437 | bluetooth_rfkill->state = hp_wmi_bluetooth_state(); |
429 | wwan_rfkill->name = "hp-wwan"; | 438 | bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set; |
430 | wwan_rfkill->state = hp_wmi_wwan_state(); | 439 | bluetooth_rfkill->user_claim_unsupported = 1; |
431 | wwan_rfkill->toggle_radio = hp_wmi_wwan_set; | 440 | rfkill_register(bluetooth_rfkill); |
432 | wwan_rfkill->user_claim_unsupported = 1; | 441 | } |
433 | 442 | ||
434 | rfkill_register(wifi_rfkill); | 443 | if (wireless & 0x4) { |
435 | rfkill_register(bluetooth_rfkill); | 444 | wwan_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WWAN); |
436 | rfkill_register(wwan_rfkill); | 445 | wwan_rfkill->name = "hp-wwan"; |
446 | wwan_rfkill->state = hp_wmi_wwan_state(); | ||
447 | wwan_rfkill->toggle_radio = hp_wmi_wwan_set; | ||
448 | wwan_rfkill->user_claim_unsupported = 1; | ||
449 | rfkill_register(wwan_rfkill); | ||
450 | } | ||
437 | 451 | ||
438 | return 0; | 452 | return 0; |
439 | add_sysfs_error: | 453 | add_sysfs_error: |
@@ -445,9 +459,12 @@ static int __exit hp_wmi_bios_remove(struct platform_device *device) | |||
445 | { | 459 | { |
446 | cleanup_sysfs(device); | 460 | cleanup_sysfs(device); |
447 | 461 | ||
448 | rfkill_unregister(wifi_rfkill); | 462 | if (wifi_rfkill) |
449 | rfkill_unregister(bluetooth_rfkill); | 463 | rfkill_unregister(wifi_rfkill); |
450 | rfkill_unregister(wwan_rfkill); | 464 | if (bluetooth_rfkill) |
465 | rfkill_unregister(bluetooth_rfkill); | ||
466 | if (wwan_rfkill) | ||
467 | rfkill_unregister(wwan_rfkill); | ||
451 | 468 | ||
452 | return 0; | 469 | return 0; |
453 | } | 470 | } |
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c index 6915f40ac8ab..1f8b5b36222c 100644 --- a/drivers/mmc/host/at91_mci.c +++ b/drivers/mmc/host/at91_mci.c | |||
@@ -621,12 +621,21 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command | |||
621 | if (cpu_is_at91sam9260 () || cpu_is_at91sam9263()) | 621 | if (cpu_is_at91sam9260 () || cpu_is_at91sam9263()) |
622 | if (host->total_length < 12) | 622 | if (host->total_length < 12) |
623 | host->total_length = 12; | 623 | host->total_length = 12; |
624 | host->buffer = dma_alloc_coherent(NULL, | 624 | |
625 | host->total_length, | 625 | host->buffer = kmalloc(host->total_length, GFP_KERNEL); |
626 | &host->physical_address, GFP_KERNEL); | 626 | if (!host->buffer) { |
627 | pr_debug("Can't alloc tx buffer\n"); | ||
628 | cmd->error = -ENOMEM; | ||
629 | mmc_request_done(host->mmc, host->request); | ||
630 | return; | ||
631 | } | ||
627 | 632 | ||
628 | at91_mci_sg_to_dma(host, data); | 633 | at91_mci_sg_to_dma(host, data); |
629 | 634 | ||
635 | host->physical_address = dma_map_single(NULL, | ||
636 | host->buffer, host->total_length, | ||
637 | DMA_TO_DEVICE); | ||
638 | |||
630 | pr_debug("Transmitting %d bytes\n", host->total_length); | 639 | pr_debug("Transmitting %d bytes\n", host->total_length); |
631 | 640 | ||
632 | at91_mci_write(host, ATMEL_PDC_TPR, host->physical_address); | 641 | at91_mci_write(host, ATMEL_PDC_TPR, host->physical_address); |
@@ -694,7 +703,10 @@ static void at91_mci_completed_command(struct at91mci_host *host, unsigned int s | |||
694 | cmd->resp[3] = at91_mci_read(host, AT91_MCI_RSPR(3)); | 703 | cmd->resp[3] = at91_mci_read(host, AT91_MCI_RSPR(3)); |
695 | 704 | ||
696 | if (host->buffer) { | 705 | if (host->buffer) { |
697 | dma_free_coherent(NULL, host->total_length, host->buffer, host->physical_address); | 706 | dma_unmap_single(NULL, |
707 | host->physical_address, host->total_length, | ||
708 | DMA_TO_DEVICE); | ||
709 | kfree(host->buffer); | ||
698 | host->buffer = NULL; | 710 | host->buffer = NULL; |
699 | } | 711 | } |
700 | 712 | ||
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index d2f331876e4c..e00d424e6575 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -410,16 +410,20 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
410 | 410 | ||
411 | case MEMGETREGIONINFO: | 411 | case MEMGETREGIONINFO: |
412 | { | 412 | { |
413 | struct region_info_user ur; | 413 | uint32_t ur_idx; |
414 | struct mtd_erase_region_info *kr; | ||
415 | struct region_info_user *ur = (struct region_info_user *) argp; | ||
414 | 416 | ||
415 | if (copy_from_user(&ur, argp, sizeof(struct region_info_user))) | 417 | if (get_user(ur_idx, &(ur->regionindex))) |
416 | return -EFAULT; | 418 | return -EFAULT; |
417 | 419 | ||
418 | if (ur.regionindex >= mtd->numeraseregions) | 420 | kr = &(mtd->eraseregions[ur_idx]); |
419 | return -EINVAL; | 421 | |
420 | if (copy_to_user(argp, &(mtd->eraseregions[ur.regionindex]), | 422 | if (put_user(kr->offset, &(ur->offset)) |
421 | sizeof(struct mtd_erase_region_info))) | 423 | || put_user(kr->erasesize, &(ur->erasesize)) |
424 | || put_user(kr->numblocks, &(ur->numblocks))) | ||
422 | return -EFAULT; | 425 | return -EFAULT; |
426 | |||
423 | break; | 427 | break; |
424 | } | 428 | } |
425 | 429 | ||
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index a14dba1afcc5..fd705d1295a7 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -151,6 +151,8 @@ struct sw_rx_page { | |||
151 | #define PAGES_PER_SGE_SHIFT 0 | 151 | #define PAGES_PER_SGE_SHIFT 0 |
152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) | 152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) |
153 | 153 | ||
154 | #define BCM_RX_ETH_PAYLOAD_ALIGN 64 | ||
155 | |||
154 | /* SGE ring related macros */ | 156 | /* SGE ring related macros */ |
155 | #define NUM_RX_SGE_PAGES 2 | 157 | #define NUM_RX_SGE_PAGES 2 |
156 | #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) | 158 | #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) |
@@ -750,8 +752,7 @@ struct bnx2x { | |||
750 | 752 | ||
751 | u32 rx_csum; | 753 | u32 rx_csum; |
752 | u32 rx_offset; | 754 | u32 rx_offset; |
753 | u32 rx_buf_use_size; /* useable size */ | 755 | u32 rx_buf_size; |
754 | u32 rx_buf_size; /* with alignment */ | ||
755 | #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ | 756 | #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ |
756 | #define ETH_MIN_PACKET_SIZE 60 | 757 | #define ETH_MIN_PACKET_SIZE 60 |
757 | #define ETH_MAX_PACKET_SIZE 1500 | 758 | #define ETH_MAX_PACKET_SIZE 1500 |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 82deea0a63f5..a8eb3c4a47c8 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -59,8 +59,8 @@ | |||
59 | #include "bnx2x.h" | 59 | #include "bnx2x.h" |
60 | #include "bnx2x_init.h" | 60 | #include "bnx2x_init.h" |
61 | 61 | ||
62 | #define DRV_MODULE_VERSION "1.45.20" | 62 | #define DRV_MODULE_VERSION "1.45.21" |
63 | #define DRV_MODULE_RELDATE "2008/08/25" | 63 | #define DRV_MODULE_RELDATE "2008/09/03" |
64 | #define BNX2X_BC_VER 0x040200 | 64 | #define BNX2X_BC_VER 0x040200 |
65 | 65 | ||
66 | /* Time in jiffies before concluding the transmitter is hung */ | 66 | /* Time in jiffies before concluding the transmitter is hung */ |
@@ -1027,7 +1027,7 @@ static inline int bnx2x_alloc_rx_skb(struct bnx2x *bp, | |||
1027 | if (unlikely(skb == NULL)) | 1027 | if (unlikely(skb == NULL)) |
1028 | return -ENOMEM; | 1028 | return -ENOMEM; |
1029 | 1029 | ||
1030 | mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_use_size, | 1030 | mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_size, |
1031 | PCI_DMA_FROMDEVICE); | 1031 | PCI_DMA_FROMDEVICE); |
1032 | if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { | 1032 | if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { |
1033 | dev_kfree_skb(skb); | 1033 | dev_kfree_skb(skb); |
@@ -1169,7 +1169,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue, | |||
1169 | /* move empty skb from pool to prod and map it */ | 1169 | /* move empty skb from pool to prod and map it */ |
1170 | prod_rx_buf->skb = fp->tpa_pool[queue].skb; | 1170 | prod_rx_buf->skb = fp->tpa_pool[queue].skb; |
1171 | mapping = pci_map_single(bp->pdev, fp->tpa_pool[queue].skb->data, | 1171 | mapping = pci_map_single(bp->pdev, fp->tpa_pool[queue].skb->data, |
1172 | bp->rx_buf_use_size, PCI_DMA_FROMDEVICE); | 1172 | bp->rx_buf_size, PCI_DMA_FROMDEVICE); |
1173 | pci_unmap_addr_set(prod_rx_buf, mapping, mapping); | 1173 | pci_unmap_addr_set(prod_rx_buf, mapping, mapping); |
1174 | 1174 | ||
1175 | /* move partial skb from cons to pool (don't unmap yet) */ | 1175 | /* move partial skb from cons to pool (don't unmap yet) */ |
@@ -1276,7 +1276,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1276 | pool entry status to BNX2X_TPA_STOP even if new skb allocation | 1276 | pool entry status to BNX2X_TPA_STOP even if new skb allocation |
1277 | fails. */ | 1277 | fails. */ |
1278 | pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), | 1278 | pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), |
1279 | bp->rx_buf_use_size, PCI_DMA_FROMDEVICE); | 1279 | bp->rx_buf_size, PCI_DMA_FROMDEVICE); |
1280 | 1280 | ||
1281 | if (likely(new_skb)) { | 1281 | if (likely(new_skb)) { |
1282 | /* fix ip xsum and give it to the stack */ | 1282 | /* fix ip xsum and give it to the stack */ |
@@ -1520,7 +1520,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) | |||
1520 | } else if (bnx2x_alloc_rx_skb(bp, fp, bd_prod) == 0) { | 1520 | } else if (bnx2x_alloc_rx_skb(bp, fp, bd_prod) == 0) { |
1521 | pci_unmap_single(bp->pdev, | 1521 | pci_unmap_single(bp->pdev, |
1522 | pci_unmap_addr(rx_buf, mapping), | 1522 | pci_unmap_addr(rx_buf, mapping), |
1523 | bp->rx_buf_use_size, | 1523 | bp->rx_buf_size, |
1524 | PCI_DMA_FROMDEVICE); | 1524 | PCI_DMA_FROMDEVICE); |
1525 | skb_reserve(skb, pad); | 1525 | skb_reserve(skb, pad); |
1526 | skb_put(skb, len); | 1526 | skb_put(skb, len); |
@@ -4229,7 +4229,7 @@ static inline void bnx2x_free_tpa_pool(struct bnx2x *bp, | |||
4229 | if (fp->tpa_state[i] == BNX2X_TPA_START) | 4229 | if (fp->tpa_state[i] == BNX2X_TPA_START) |
4230 | pci_unmap_single(bp->pdev, | 4230 | pci_unmap_single(bp->pdev, |
4231 | pci_unmap_addr(rx_buf, mapping), | 4231 | pci_unmap_addr(rx_buf, mapping), |
4232 | bp->rx_buf_use_size, | 4232 | bp->rx_buf_size, |
4233 | PCI_DMA_FROMDEVICE); | 4233 | PCI_DMA_FROMDEVICE); |
4234 | 4234 | ||
4235 | dev_kfree_skb(skb); | 4235 | dev_kfree_skb(skb); |
@@ -4245,15 +4245,14 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp) | |||
4245 | u16 ring_prod, cqe_ring_prod; | 4245 | u16 ring_prod, cqe_ring_prod; |
4246 | int i, j; | 4246 | int i, j; |
4247 | 4247 | ||
4248 | bp->rx_buf_use_size = bp->dev->mtu; | 4248 | bp->rx_buf_size = bp->dev->mtu; |
4249 | bp->rx_buf_use_size += bp->rx_offset + ETH_OVREHEAD; | 4249 | bp->rx_buf_size += bp->rx_offset + ETH_OVREHEAD + |
4250 | bp->rx_buf_size = bp->rx_buf_use_size + 64; | 4250 | BCM_RX_ETH_PAYLOAD_ALIGN; |
4251 | 4251 | ||
4252 | if (bp->flags & TPA_ENABLE_FLAG) { | 4252 | if (bp->flags & TPA_ENABLE_FLAG) { |
4253 | DP(NETIF_MSG_IFUP, | 4253 | DP(NETIF_MSG_IFUP, |
4254 | "rx_buf_use_size %d rx_buf_size %d effective_mtu %d\n", | 4254 | "rx_buf_size %d effective_mtu %d\n", |
4255 | bp->rx_buf_use_size, bp->rx_buf_size, | 4255 | bp->rx_buf_size, bp->dev->mtu + ETH_OVREHEAD); |
4256 | bp->dev->mtu + ETH_OVREHEAD); | ||
4257 | 4256 | ||
4258 | for_each_queue(bp, j) { | 4257 | for_each_queue(bp, j) { |
4259 | struct bnx2x_fastpath *fp = &bp->fp[j]; | 4258 | struct bnx2x_fastpath *fp = &bp->fp[j]; |
@@ -4462,9 +4461,10 @@ static void bnx2x_init_context(struct bnx2x *bp) | |||
4462 | context->ustorm_st_context.common.status_block_id = sb_id; | 4461 | context->ustorm_st_context.common.status_block_id = sb_id; |
4463 | context->ustorm_st_context.common.flags = | 4462 | context->ustorm_st_context.common.flags = |
4464 | USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT; | 4463 | USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT; |
4465 | context->ustorm_st_context.common.mc_alignment_size = 64; | 4464 | context->ustorm_st_context.common.mc_alignment_size = |
4465 | BCM_RX_ETH_PAYLOAD_ALIGN; | ||
4466 | context->ustorm_st_context.common.bd_buff_size = | 4466 | context->ustorm_st_context.common.bd_buff_size = |
4467 | bp->rx_buf_use_size; | 4467 | bp->rx_buf_size; |
4468 | context->ustorm_st_context.common.bd_page_base_hi = | 4468 | context->ustorm_st_context.common.bd_page_base_hi = |
4469 | U64_HI(fp->rx_desc_mapping); | 4469 | U64_HI(fp->rx_desc_mapping); |
4470 | context->ustorm_st_context.common.bd_page_base_lo = | 4470 | context->ustorm_st_context.common.bd_page_base_lo = |
@@ -4717,7 +4717,7 @@ static void bnx2x_init_internal_func(struct bnx2x *bp) | |||
4717 | } | 4717 | } |
4718 | 4718 | ||
4719 | /* Init CQ ring mapping and aggregation size */ | 4719 | /* Init CQ ring mapping and aggregation size */ |
4720 | max_agg_size = min((u32)(bp->rx_buf_use_size + | 4720 | max_agg_size = min((u32)(bp->rx_buf_size + |
4721 | 8*BCM_PAGE_SIZE*PAGES_PER_SGE), | 4721 | 8*BCM_PAGE_SIZE*PAGES_PER_SGE), |
4722 | (u32)0xffff); | 4722 | (u32)0xffff); |
4723 | for_each_queue(bp, i) { | 4723 | for_each_queue(bp, i) { |
@@ -5940,7 +5940,7 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp) | |||
5940 | 5940 | ||
5941 | pci_unmap_single(bp->pdev, | 5941 | pci_unmap_single(bp->pdev, |
5942 | pci_unmap_addr(rx_buf, mapping), | 5942 | pci_unmap_addr(rx_buf, mapping), |
5943 | bp->rx_buf_use_size, | 5943 | bp->rx_buf_size, |
5944 | PCI_DMA_FROMDEVICE); | 5944 | PCI_DMA_FROMDEVICE); |
5945 | 5945 | ||
5946 | rx_buf->skb = NULL; | 5946 | rx_buf->skb = NULL; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 53f41b649f03..a417be7f8be5 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2304,6 +2304,12 @@ static int __devinit ixgbe_set_interrupt_capability(struct ixgbe_adapter | |||
2304 | int vector, v_budget; | 2304 | int vector, v_budget; |
2305 | 2305 | ||
2306 | /* | 2306 | /* |
2307 | * Set the default interrupt throttle rate. | ||
2308 | */ | ||
2309 | adapter->rx_eitr = (1000000 / IXGBE_DEFAULT_ITR_RX_USECS); | ||
2310 | adapter->tx_eitr = (1000000 / IXGBE_DEFAULT_ITR_TX_USECS); | ||
2311 | |||
2312 | /* | ||
2307 | * It's easy to be greedy for MSI-X vectors, but it really | 2313 | * It's easy to be greedy for MSI-X vectors, but it really |
2308 | * doesn't do us much good if we have a lot more vectors | 2314 | * doesn't do us much good if we have a lot more vectors |
2309 | * than CPU's. So let's be conservative and only ask for | 2315 | * than CPU's. So let's be conservative and only ask for |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 32bb47adbe39..008fd6618a5f 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -359,16 +359,6 @@ static void netxen_pcie_strap_init(struct netxen_adapter *adapter) | |||
359 | int i, pos; | 359 | int i, pos; |
360 | struct pci_dev *pdev; | 360 | struct pci_dev *pdev; |
361 | 361 | ||
362 | pdev = pci_get_device(0x1166, 0x0140, NULL); | ||
363 | if (pdev) { | ||
364 | pci_dev_put(pdev); | ||
365 | adapter->hw_read_wx(adapter, | ||
366 | NETXEN_PCIE_REG(PCIE_TGT_SPLIT_CHICKEN), &chicken, 4); | ||
367 | chicken |= 0x4000; | ||
368 | adapter->hw_write_wx(adapter, | ||
369 | NETXEN_PCIE_REG(PCIE_TGT_SPLIT_CHICKEN), &chicken, 4); | ||
370 | } | ||
371 | |||
372 | pdev = adapter->pdev; | 362 | pdev = adapter->pdev; |
373 | 363 | ||
374 | adapter->hw_read_wx(adapter, | 364 | adapter->hw_read_wx(adapter, |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 3f682d49a4e6..52bf11b73c6e 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -784,6 +784,7 @@ static struct pcmcia_device_id axnet_ids[] = { | |||
784 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEther PCC-TXD", 0x5261440f, 0x436768c5), | 784 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEther PCC-TXD", 0x5261440f, 0x436768c5), |
785 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEtherII PCC-TXD", 0x5261440f, 0x730df72e), | 785 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEtherII PCC-TXD", 0x5261440f, 0x730df72e), |
786 | PCMCIA_DEVICE_PROD_ID12("Dynalink", "L100C16", 0x55632fd5, 0x66bc2a90), | 786 | PCMCIA_DEVICE_PROD_ID12("Dynalink", "L100C16", 0x55632fd5, 0x66bc2a90), |
787 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "ETXPCM", 0x547e66dc, 0x233adac2), | ||
787 | PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V3)", 0x0733cc81, 0x232019a8), | 788 | PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V3)", 0x0733cc81, 0x232019a8), |
788 | PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC3-TX", 0x481e0094, 0xf91af609), | 789 | PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC3-TX", 0x481e0094, 0xf91af609), |
789 | PCMCIA_DEVICE_PROD_ID12("PCMCIA", "100BASE", 0x281f1c5d, 0x7c2add04), | 790 | PCMCIA_DEVICE_PROD_ID12("PCMCIA", "100BASE", 0x281f1c5d, 0x7c2add04), |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 2d4c4ad89b8d..ebc1ae6bcbe5 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -1626,6 +1626,7 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1626 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d), | 1626 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d), |
1627 | PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), | 1627 | PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), |
1628 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), | 1628 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), |
1629 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-TD", 0x5261440f, 0x47d5ca83), | ||
1629 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), | 1630 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), |
1630 | PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2), | 1631 | PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2), |
1631 | PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2), | 1632 | PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2), |
@@ -1737,7 +1738,6 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1737 | PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360), | 1738 | PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360), |
1738 | PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de), | 1739 | PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de), |
1739 | PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f), | 1740 | PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f), |
1740 | PCMCIA_DEVICE_PROD_ID1("IC-CARD", 0x60cb09a6), | ||
1741 | PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a), | 1741 | PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a), |
1742 | PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078), | 1742 | PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078), |
1743 | /* too generic! */ | 1743 | /* too generic! */ |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index a84ba487c713..8c19307e5040 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -117,7 +117,7 @@ static void ctrl_callback(struct urb *urb) | |||
117 | case -ENOENT: | 117 | case -ENOENT: |
118 | break; | 118 | break; |
119 | default: | 119 | default: |
120 | if (netif_msg_drv(pegasus)) | 120 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
121 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", | 121 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", |
122 | __FUNCTION__, urb->status); | 122 | __FUNCTION__, urb->status); |
123 | } | 123 | } |
@@ -166,7 +166,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size, | |||
166 | set_current_state(TASK_RUNNING); | 166 | set_current_state(TASK_RUNNING); |
167 | if (ret == -ENODEV) | 167 | if (ret == -ENODEV) |
168 | netif_device_detach(pegasus->net); | 168 | netif_device_detach(pegasus->net); |
169 | if (netif_msg_drv(pegasus)) | 169 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
170 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 170 | dev_err(&pegasus->intf->dev, "%s, status %d\n", |
171 | __FUNCTION__, ret); | 171 | __FUNCTION__, ret); |
172 | goto out; | 172 | goto out; |
@@ -275,7 +275,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data) | |||
275 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { | 275 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { |
276 | if (ret == -ENODEV) | 276 | if (ret == -ENODEV) |
277 | netif_device_detach(pegasus->net); | 277 | netif_device_detach(pegasus->net); |
278 | if (netif_msg_drv(pegasus)) | 278 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
279 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 279 | dev_err(&pegasus->intf->dev, "%s, status %d\n", |
280 | __FUNCTION__, ret); | 280 | __FUNCTION__, ret); |
281 | goto out; | 281 | goto out; |
@@ -1209,8 +1209,7 @@ static void pegasus_set_multicast(struct net_device *net) | |||
1209 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; | 1209 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; |
1210 | if (netif_msg_link(pegasus)) | 1210 | if (netif_msg_link(pegasus)) |
1211 | pr_info("%s: Promiscuous mode enabled.\n", net->name); | 1211 | pr_info("%s: Promiscuous mode enabled.\n", net->name); |
1212 | } else if (net->mc_count || | 1212 | } else if (net->mc_count || (net->flags & IFF_ALLMULTI)) { |
1213 | (net->flags & IFF_ALLMULTI)) { | ||
1214 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; | 1213 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; |
1215 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1214 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
1216 | if (netif_msg_link(pegasus)) | 1215 | if (netif_msg_link(pegasus)) |
@@ -1220,6 +1219,8 @@ static void pegasus_set_multicast(struct net_device *net) | |||
1220 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1219 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
1221 | } | 1220 | } |
1222 | 1221 | ||
1222 | pegasus->ctrl_urb->status = 0; | ||
1223 | |||
1223 | pegasus->flags |= ETH_REGS_CHANGE; | 1224 | pegasus->flags |= ETH_REGS_CHANGE; |
1224 | ctrl_callback(pegasus->ctrl_urb); | 1225 | ctrl_callback(pegasus->ctrl_urb); |
1225 | } | 1226 | } |
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c index a17eb130f574..6dbfed0b4149 100644 --- a/drivers/net/wireless/ath9k/hw.c +++ b/drivers/net/wireless/ath9k/hw.c | |||
@@ -7285,15 +7285,15 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, | |||
7285 | } | 7285 | } |
7286 | break; | 7286 | break; |
7287 | case ATH9K_CIPHER_WEP: | 7287 | case ATH9K_CIPHER_WEP: |
7288 | if (k->kv_len < 40 / NBBY) { | 7288 | if (k->kv_len < LEN_WEP40) { |
7289 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, | 7289 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, |
7290 | "%s: WEP key length %u too small\n", | 7290 | "%s: WEP key length %u too small\n", |
7291 | __func__, k->kv_len); | 7291 | __func__, k->kv_len); |
7292 | return false; | 7292 | return false; |
7293 | } | 7293 | } |
7294 | if (k->kv_len <= 40 / NBBY) | 7294 | if (k->kv_len <= LEN_WEP40) |
7295 | keyType = AR_KEYTABLE_TYPE_40; | 7295 | keyType = AR_KEYTABLE_TYPE_40; |
7296 | else if (k->kv_len <= 104 / NBBY) | 7296 | else if (k->kv_len <= LEN_WEP104) |
7297 | keyType = AR_KEYTABLE_TYPE_104; | 7297 | keyType = AR_KEYTABLE_TYPE_104; |
7298 | else | 7298 | else |
7299 | keyType = AR_KEYTABLE_TYPE_128; | 7299 | keyType = AR_KEYTABLE_TYPE_128; |
@@ -7313,7 +7313,7 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, | |||
7313 | key2 = get_unaligned_le32(k->kv_val + 6) ^ xorMask; | 7313 | key2 = get_unaligned_le32(k->kv_val + 6) ^ xorMask; |
7314 | key3 = (get_unaligned_le16(k->kv_val + 10) ^ xorMask) & 0xffff; | 7314 | key3 = (get_unaligned_le16(k->kv_val + 10) ^ xorMask) & 0xffff; |
7315 | key4 = get_unaligned_le32(k->kv_val + 12) ^ xorMask; | 7315 | key4 = get_unaligned_le32(k->kv_val + 12) ^ xorMask; |
7316 | if (k->kv_len <= 104 / NBBY) | 7316 | if (k->kv_len <= LEN_WEP104) |
7317 | key4 &= 0xff; | 7317 | key4 &= 0xff; |
7318 | 7318 | ||
7319 | if (keyType == AR_KEYTABLE_TYPE_TKIP && ATH9K_IS_MIC_ENABLED(ah)) { | 7319 | if (keyType == AR_KEYTABLE_TYPE_TKIP && ATH9K_IS_MIC_ENABLED(ah)) { |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 2888778040e4..c5107f269f24 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -206,7 +206,8 @@ static int ath_key_config(struct ath_softc *sc, | |||
206 | if (!ret) | 206 | if (!ret) |
207 | return -EIO; | 207 | return -EIO; |
208 | 208 | ||
209 | sc->sc_keytype = hk.kv_type; | 209 | if (mac) |
210 | sc->sc_keytype = hk.kv_type; | ||
210 | return 0; | 211 | return 0; |
211 | } | 212 | } |
212 | 213 | ||
@@ -756,7 +757,8 @@ static int ath9k_set_key(struct ieee80211_hw *hw, | |||
756 | key->hw_key_idx = key->keyidx; | 757 | key->hw_key_idx = key->keyidx; |
757 | /* push IV and Michael MIC generation to stack */ | 758 | /* push IV and Michael MIC generation to stack */ |
758 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | 759 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; |
759 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | 760 | if (key->alg == ALG_TKIP) |
761 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | ||
760 | } | 762 | } |
761 | break; | 763 | break; |
762 | case DISABLE_KEY: | 764 | case DISABLE_KEY: |
@@ -1065,8 +1067,16 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
1065 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; | 1067 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; |
1066 | tx_status->flags &= ~ATH_TX_BAR; | 1068 | tx_status->flags &= ~ATH_TX_BAR; |
1067 | } | 1069 | } |
1068 | if (tx_status->flags) | 1070 | |
1069 | tx_info->status.excessive_retries = 1; | 1071 | if (tx_status->flags & (ATH_TX_ERROR | ATH_TX_XRETRY)) { |
1072 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { | ||
1073 | /* Frame was not ACKed, but an ACK was expected */ | ||
1074 | tx_info->status.excessive_retries = 1; | ||
1075 | } | ||
1076 | } else { | ||
1077 | /* Frame was ACKed */ | ||
1078 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | ||
1079 | } | ||
1070 | 1080 | ||
1071 | tx_info->status.retry_count = tx_status->retries; | 1081 | tx_info->status.retry_count = tx_status->retries; |
1072 | 1082 | ||
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 2fe806175c01..20ddb7acdb94 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c | |||
@@ -360,8 +360,9 @@ static void ath_rx_flush_tid(struct ath_softc *sc, | |||
360 | struct ath_arx_tid *rxtid, int drop) | 360 | struct ath_arx_tid *rxtid, int drop) |
361 | { | 361 | { |
362 | struct ath_rxbuf *rxbuf; | 362 | struct ath_rxbuf *rxbuf; |
363 | unsigned long flag; | ||
363 | 364 | ||
364 | spin_lock_bh(&rxtid->tidlock); | 365 | spin_lock_irqsave(&rxtid->tidlock, flag); |
365 | while (rxtid->baw_head != rxtid->baw_tail) { | 366 | while (rxtid->baw_head != rxtid->baw_tail) { |
366 | rxbuf = rxtid->rxbuf + rxtid->baw_head; | 367 | rxbuf = rxtid->rxbuf + rxtid->baw_head; |
367 | if (!rxbuf->rx_wbuf) { | 368 | if (!rxbuf->rx_wbuf) { |
@@ -382,7 +383,7 @@ static void ath_rx_flush_tid(struct ath_softc *sc, | |||
382 | INCR(rxtid->baw_head, ATH_TID_MAX_BUFS); | 383 | INCR(rxtid->baw_head, ATH_TID_MAX_BUFS); |
383 | INCR(rxtid->seq_next, IEEE80211_SEQ_MAX); | 384 | INCR(rxtid->seq_next, IEEE80211_SEQ_MAX); |
384 | } | 385 | } |
385 | spin_unlock_bh(&rxtid->tidlock); | 386 | spin_unlock_irqrestore(&rxtid->tidlock, flag); |
386 | } | 387 | } |
387 | 388 | ||
388 | static struct sk_buff *ath_rxbuf_alloc(struct ath_softc *sc, | 389 | static struct sk_buff *ath_rxbuf_alloc(struct ath_softc *sc, |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 157f830ee6b8..550129f717e2 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -357,9 +357,9 @@ static int ath_tx_prepare(struct ath_softc *sc, | |||
357 | txctl->flags = ATH9K_TXDESC_CLRDMASK; /* needed for crypto errors */ | 357 | txctl->flags = ATH9K_TXDESC_CLRDMASK; /* needed for crypto errors */ |
358 | 358 | ||
359 | if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) | 359 | if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) |
360 | tx_info->flags |= ATH9K_TXDESC_NOACK; | 360 | txctl->flags |= ATH9K_TXDESC_NOACK; |
361 | if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) | 361 | if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) |
362 | tx_info->flags |= ATH9K_TXDESC_RTSENA; | 362 | txctl->flags |= ATH9K_TXDESC_RTSENA; |
363 | 363 | ||
364 | /* | 364 | /* |
365 | * Setup for rate calculations. | 365 | * Setup for rate calculations. |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index e2581229d8b2..23fed3298962 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -474,8 +474,8 @@ static void iwl4965_apm_stop(struct iwl_priv *priv) | |||
474 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); | 474 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); |
475 | 475 | ||
476 | udelay(10); | 476 | udelay(10); |
477 | 477 | /* clear "init complete" move adapter D0A* --> D0U state */ | |
478 | iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | 478 | iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); |
479 | spin_unlock_irqrestore(&priv->lock, flags); | 479 | spin_unlock_irqrestore(&priv->lock, flags); |
480 | } | 480 | } |
481 | 481 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index cbc01a00eaf4..b08036a9d894 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -145,7 +145,8 @@ static void iwl5000_apm_stop(struct iwl_priv *priv) | |||
145 | 145 | ||
146 | udelay(10); | 146 | udelay(10); |
147 | 147 | ||
148 | iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | 148 | /* clear "init complete" move adapter D0A* --> D0U state */ |
149 | iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | ||
149 | 150 | ||
150 | spin_unlock_irqrestore(&priv->lock, flags); | 151 | spin_unlock_irqrestore(&priv->lock, flags); |
151 | } | 152 | } |
@@ -577,14 +578,11 @@ static int iwl5000_load_section(struct iwl_priv *priv, | |||
577 | FH_TFDIB_CTRL0_REG(FH_SRVC_CHNL), | 578 | FH_TFDIB_CTRL0_REG(FH_SRVC_CHNL), |
578 | phy_addr & FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK); | 579 | phy_addr & FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK); |
579 | 580 | ||
580 | /* FIME: write the MSB of the phy_addr in CTRL1 | ||
581 | * iwl_write_direct32(priv, | ||
582 | IWL_FH_TFDIB_CTRL1_REG(IWL_FH_SRVC_CHNL), | ||
583 | ((phy_addr & MSB_MSK) | ||
584 | << FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_count); | ||
585 | */ | ||
586 | iwl_write_direct32(priv, | 581 | iwl_write_direct32(priv, |
587 | FH_TFDIB_CTRL1_REG(FH_SRVC_CHNL), byte_cnt); | 582 | FH_TFDIB_CTRL1_REG(FH_SRVC_CHNL), |
583 | (iwl_get_dma_hi_address(phy_addr) | ||
584 | << FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_cnt); | ||
585 | |||
588 | iwl_write_direct32(priv, | 586 | iwl_write_direct32(priv, |
589 | FH_TCSR_CHNL_TX_BUF_STS_REG(FH_SRVC_CHNL), | 587 | FH_TCSR_CHNL_TX_BUF_STS_REG(FH_SRVC_CHNL), |
590 | 1 << FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM | | 588 | 1 << FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM | |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 754fef5b592f..90a2b6dee7c0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -1153,7 +1153,8 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv, | |||
1153 | !sta->ht_info.ht_supported) | 1153 | !sta->ht_info.ht_supported) |
1154 | return -1; | 1154 | return -1; |
1155 | 1155 | ||
1156 | if (priv->current_ht_config.tx_mimo_ps_mode == IWL_MIMO_PS_STATIC) | 1156 | if (((sta->ht_info.cap & IEEE80211_HT_CAP_MIMO_PS) >> 2) |
1157 | == IWL_MIMO_PS_STATIC) | ||
1157 | return -1; | 1158 | return -1; |
1158 | 1159 | ||
1159 | /* Need both Tx chains/antennas to support MIMO */ | 1160 | /* Need both Tx chains/antennas to support MIMO */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 061ffba9c884..e01f048a02dd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -181,14 +181,14 @@ static int iwl4965_check_rxon_cmd(struct iwl_rxon_cmd *rxon) | |||
181 | } | 181 | } |
182 | 182 | ||
183 | /** | 183 | /** |
184 | * iwl4965_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed | 184 | * iwl_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed |
185 | * @priv: staging_rxon is compared to active_rxon | 185 | * @priv: staging_rxon is compared to active_rxon |
186 | * | 186 | * |
187 | * If the RXON structure is changing enough to require a new tune, | 187 | * If the RXON structure is changing enough to require a new tune, |
188 | * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that | 188 | * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that |
189 | * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required. | 189 | * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required. |
190 | */ | 190 | */ |
191 | static int iwl4965_full_rxon_required(struct iwl_priv *priv) | 191 | static int iwl_full_rxon_required(struct iwl_priv *priv) |
192 | { | 192 | { |
193 | 193 | ||
194 | /* These items are only settable from the full RXON command */ | 194 | /* These items are only settable from the full RXON command */ |
@@ -207,7 +207,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv) | |||
207 | priv->active_rxon.ofdm_ht_single_stream_basic_rates) || | 207 | priv->active_rxon.ofdm_ht_single_stream_basic_rates) || |
208 | (priv->staging_rxon.ofdm_ht_dual_stream_basic_rates != | 208 | (priv->staging_rxon.ofdm_ht_dual_stream_basic_rates != |
209 | priv->active_rxon.ofdm_ht_dual_stream_basic_rates) || | 209 | priv->active_rxon.ofdm_ht_dual_stream_basic_rates) || |
210 | (priv->staging_rxon.rx_chain != priv->active_rxon.rx_chain) || | ||
211 | (priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id)) | 210 | (priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id)) |
212 | return 1; | 211 | return 1; |
213 | 212 | ||
@@ -263,7 +262,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv) | |||
263 | /* If we don't need to send a full RXON, we can use | 262 | /* If we don't need to send a full RXON, we can use |
264 | * iwl4965_rxon_assoc_cmd which is used to reconfigure filter | 263 | * iwl4965_rxon_assoc_cmd which is used to reconfigure filter |
265 | * and other flags for the current radio configuration. */ | 264 | * and other flags for the current radio configuration. */ |
266 | if (!iwl4965_full_rxon_required(priv)) { | 265 | if (!iwl_full_rxon_required(priv)) { |
267 | ret = iwl_send_rxon_assoc(priv); | 266 | ret = iwl_send_rxon_assoc(priv); |
268 | if (ret) { | 267 | if (ret) { |
269 | IWL_ERROR("Error setting RXON_ASSOC (%d)\n", ret); | 268 | IWL_ERROR("Error setting RXON_ASSOC (%d)\n", ret); |
@@ -587,8 +586,6 @@ static void iwl4965_ht_conf(struct iwl_priv *priv, | |||
587 | iwl_conf->supported_chan_width = 0; | 586 | iwl_conf->supported_chan_width = 0; |
588 | } | 587 | } |
589 | 588 | ||
590 | iwl_conf->tx_mimo_ps_mode = | ||
591 | (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2); | ||
592 | memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); | 589 | memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); |
593 | 590 | ||
594 | iwl_conf->control_channel = ht_bss_conf->primary_channel; | 591 | iwl_conf->control_channel = ht_bss_conf->primary_channel; |
@@ -2190,7 +2187,10 @@ static void __iwl4965_down(struct iwl_priv *priv) | |||
2190 | udelay(5); | 2187 | udelay(5); |
2191 | 2188 | ||
2192 | /* FIXME: apm_ops.suspend(priv) */ | 2189 | /* FIXME: apm_ops.suspend(priv) */ |
2193 | priv->cfg->ops->lib->apm_ops.reset(priv); | 2190 | if (exit_pending || test_bit(STATUS_IN_SUSPEND, &priv->status)) |
2191 | priv->cfg->ops->lib->apm_ops.stop(priv); | ||
2192 | else | ||
2193 | priv->cfg->ops->lib->apm_ops.reset(priv); | ||
2194 | priv->cfg->ops->lib->free_shared_mem(priv); | 2194 | priv->cfg->ops->lib->free_shared_mem(priv); |
2195 | 2195 | ||
2196 | exit: | 2196 | exit: |
@@ -2602,6 +2602,7 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw) | |||
2602 | { | 2602 | { |
2603 | struct iwl_priv *priv = hw->priv; | 2603 | struct iwl_priv *priv = hw->priv; |
2604 | int ret; | 2604 | int ret; |
2605 | u16 pci_cmd; | ||
2605 | 2606 | ||
2606 | IWL_DEBUG_MAC80211("enter\n"); | 2607 | IWL_DEBUG_MAC80211("enter\n"); |
2607 | 2608 | ||
@@ -2612,6 +2613,13 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw) | |||
2612 | pci_restore_state(priv->pci_dev); | 2613 | pci_restore_state(priv->pci_dev); |
2613 | pci_enable_msi(priv->pci_dev); | 2614 | pci_enable_msi(priv->pci_dev); |
2614 | 2615 | ||
2616 | /* enable interrupts if needed: hw bug w/a */ | ||
2617 | pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd); | ||
2618 | if (pci_cmd & PCI_COMMAND_INTX_DISABLE) { | ||
2619 | pci_cmd &= ~PCI_COMMAND_INTX_DISABLE; | ||
2620 | pci_write_config_word(priv->pci_dev, PCI_COMMAND, pci_cmd); | ||
2621 | } | ||
2622 | |||
2615 | ret = request_irq(priv->pci_dev->irq, iwl4965_isr, IRQF_SHARED, | 2623 | ret = request_irq(priv->pci_dev->irq, iwl4965_isr, IRQF_SHARED, |
2616 | DRV_NAME, priv); | 2624 | DRV_NAME, priv); |
2617 | if (ret) { | 2625 | if (ret) { |
@@ -3580,7 +3588,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk | |||
3580 | 3588 | ||
3581 | priv->assoc_id = 0; | 3589 | priv->assoc_id = 0; |
3582 | timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; | 3590 | timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; |
3583 | priv->timestamp = le64_to_cpu(timestamp) + (priv->beacon_int * 1000); | 3591 | priv->timestamp = le64_to_cpu(timestamp); |
3584 | 3592 | ||
3585 | IWL_DEBUG_MAC80211("leave\n"); | 3593 | IWL_DEBUG_MAC80211("leave\n"); |
3586 | spin_unlock_irqrestore(&priv->lock, flags); | 3594 | spin_unlock_irqrestore(&priv->lock, flags); |
@@ -4364,15 +4372,18 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) | |||
4364 | iwl_dbgfs_unregister(priv); | 4372 | iwl_dbgfs_unregister(priv); |
4365 | sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); | 4373 | sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); |
4366 | 4374 | ||
4375 | /* ieee80211_unregister_hw call wil cause iwl4965_mac_stop to | ||
4376 | * to be called and iwl4965_down since we are removing the device | ||
4377 | * we need to set STATUS_EXIT_PENDING bit. | ||
4378 | */ | ||
4379 | set_bit(STATUS_EXIT_PENDING, &priv->status); | ||
4367 | if (priv->mac80211_registered) { | 4380 | if (priv->mac80211_registered) { |
4368 | ieee80211_unregister_hw(priv->hw); | 4381 | ieee80211_unregister_hw(priv->hw); |
4369 | priv->mac80211_registered = 0; | 4382 | priv->mac80211_registered = 0; |
4383 | } else { | ||
4384 | iwl4965_down(priv); | ||
4370 | } | 4385 | } |
4371 | 4386 | ||
4372 | set_bit(STATUS_EXIT_PENDING, &priv->status); | ||
4373 | |||
4374 | iwl4965_down(priv); | ||
4375 | |||
4376 | /* make sure we flush any pending irq or | 4387 | /* make sure we flush any pending irq or |
4377 | * tasklet for the driver | 4388 | * tasklet for the driver |
4378 | */ | 4389 | */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index c72f72579bea..80f2f84defa8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -592,12 +592,11 @@ static void iwlcore_free_geos(struct iwl_priv *priv) | |||
592 | clear_bit(STATUS_GEO_CONFIGURED, &priv->status); | 592 | clear_bit(STATUS_GEO_CONFIGURED, &priv->status); |
593 | } | 593 | } |
594 | 594 | ||
595 | static u8 is_single_rx_stream(struct iwl_priv *priv) | 595 | static bool is_single_rx_stream(struct iwl_priv *priv) |
596 | { | 596 | { |
597 | return !priv->current_ht_config.is_ht || | 597 | return !priv->current_ht_config.is_ht || |
598 | ((priv->current_ht_config.supp_mcs_set[1] == 0) && | 598 | ((priv->current_ht_config.supp_mcs_set[1] == 0) && |
599 | (priv->current_ht_config.supp_mcs_set[2] == 0)) || | 599 | (priv->current_ht_config.supp_mcs_set[2] == 0)); |
600 | priv->ps_mode == IWL_MIMO_PS_STATIC; | ||
601 | } | 600 | } |
602 | 601 | ||
603 | static u8 iwl_is_channel_extension(struct iwl_priv *priv, | 602 | static u8 iwl_is_channel_extension(struct iwl_priv *priv, |
@@ -704,33 +703,39 @@ EXPORT_SYMBOL(iwl_set_rxon_ht); | |||
704 | * MIMO (dual stream) requires at least 2, but works better with 3. | 703 | * MIMO (dual stream) requires at least 2, but works better with 3. |
705 | * This does not determine *which* chains to use, just how many. | 704 | * This does not determine *which* chains to use, just how many. |
706 | */ | 705 | */ |
707 | static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv, | 706 | static int iwl_get_active_rx_chain_count(struct iwl_priv *priv) |
708 | u8 *idle_state, u8 *rx_state) | ||
709 | { | 707 | { |
710 | u8 is_single = is_single_rx_stream(priv); | 708 | bool is_single = is_single_rx_stream(priv); |
711 | u8 is_cam = test_bit(STATUS_POWER_PMI, &priv->status) ? 0 : 1; | 709 | bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); |
712 | 710 | ||
713 | /* # of Rx chains to use when expecting MIMO. */ | 711 | /* # of Rx chains to use when expecting MIMO. */ |
714 | if (is_single || (!is_cam && (priv->ps_mode == IWL_MIMO_PS_STATIC))) | 712 | if (is_single || (!is_cam && (priv->ps_mode == IWL_MIMO_PS_STATIC))) |
715 | *rx_state = 2; | 713 | return 2; |
716 | else | 714 | else |
717 | *rx_state = 3; | 715 | return 3; |
716 | } | ||
718 | 717 | ||
718 | static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt) | ||
719 | { | ||
720 | int idle_cnt; | ||
721 | bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); | ||
719 | /* # Rx chains when idling and maybe trying to save power */ | 722 | /* # Rx chains when idling and maybe trying to save power */ |
720 | switch (priv->ps_mode) { | 723 | switch (priv->ps_mode) { |
721 | case IWL_MIMO_PS_STATIC: | 724 | case IWL_MIMO_PS_STATIC: |
722 | case IWL_MIMO_PS_DYNAMIC: | 725 | case IWL_MIMO_PS_DYNAMIC: |
723 | *idle_state = (is_cam) ? 2 : 1; | 726 | idle_cnt = (is_cam) ? 2 : 1; |
724 | break; | 727 | break; |
725 | case IWL_MIMO_PS_NONE: | 728 | case IWL_MIMO_PS_NONE: |
726 | *idle_state = (is_cam) ? *rx_state : 1; | 729 | idle_cnt = (is_cam) ? active_cnt : 1; |
727 | break; | 730 | break; |
731 | case IWL_MIMO_PS_INVALID: | ||
728 | default: | 732 | default: |
729 | *idle_state = 1; | 733 | IWL_ERROR("invalide mimo ps mode %d\n", priv->ps_mode); |
734 | WARN_ON(1); | ||
735 | idle_cnt = -1; | ||
730 | break; | 736 | break; |
731 | } | 737 | } |
732 | 738 | return idle_cnt; | |
733 | return 0; | ||
734 | } | 739 | } |
735 | 740 | ||
736 | /** | 741 | /** |
@@ -741,34 +746,44 @@ static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv, | |||
741 | */ | 746 | */ |
742 | void iwl_set_rxon_chain(struct iwl_priv *priv) | 747 | void iwl_set_rxon_chain(struct iwl_priv *priv) |
743 | { | 748 | { |
744 | u8 is_single = is_single_rx_stream(priv); | 749 | bool is_single = is_single_rx_stream(priv); |
745 | u8 idle_state, rx_state; | 750 | bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); |
746 | 751 | u8 idle_rx_cnt, active_rx_cnt; | |
747 | priv->staging_rxon.rx_chain = 0; | 752 | u16 rx_chain; |
748 | rx_state = idle_state = 3; | ||
749 | 753 | ||
750 | /* Tell uCode which antennas are actually connected. | 754 | /* Tell uCode which antennas are actually connected. |
751 | * Before first association, we assume all antennas are connected. | 755 | * Before first association, we assume all antennas are connected. |
752 | * Just after first association, iwl_chain_noise_calibration() | 756 | * Just after first association, iwl_chain_noise_calibration() |
753 | * checks which antennas actually *are* connected. */ | 757 | * checks which antennas actually *are* connected. */ |
754 | priv->staging_rxon.rx_chain |= | 758 | rx_chain = priv->hw_params.valid_rx_ant << RXON_RX_CHAIN_VALID_POS; |
755 | cpu_to_le16(priv->hw_params.valid_rx_ant << | ||
756 | RXON_RX_CHAIN_VALID_POS); | ||
757 | 759 | ||
758 | /* How many receivers should we use? */ | 760 | /* How many receivers should we use? */ |
759 | iwlcore_get_rx_chain_counter(priv, &idle_state, &rx_state); | 761 | active_rx_cnt = iwl_get_active_rx_chain_count(priv); |
760 | priv->staging_rxon.rx_chain |= | 762 | idle_rx_cnt = iwl_get_idle_rx_chain_count(priv, active_rx_cnt); |
761 | cpu_to_le16(rx_state << RXON_RX_CHAIN_MIMO_CNT_POS); | 763 | |
762 | priv->staging_rxon.rx_chain |= | 764 | /* correct rx chain count accoridng hw settings */ |
763 | cpu_to_le16(idle_state << RXON_RX_CHAIN_CNT_POS); | 765 | if (priv->hw_params.rx_chains_num < active_rx_cnt) |
764 | 766 | active_rx_cnt = priv->hw_params.rx_chains_num; | |
765 | if (!is_single && (rx_state >= 2) && | 767 | |
766 | !test_bit(STATUS_POWER_PMI, &priv->status)) | 768 | if (priv->hw_params.rx_chains_num < idle_rx_cnt) |
769 | idle_rx_cnt = priv->hw_params.rx_chains_num; | ||
770 | |||
771 | rx_chain |= active_rx_cnt << RXON_RX_CHAIN_MIMO_CNT_POS; | ||
772 | rx_chain |= idle_rx_cnt << RXON_RX_CHAIN_CNT_POS; | ||
773 | |||
774 | priv->staging_rxon.rx_chain = cpu_to_le16(rx_chain); | ||
775 | |||
776 | if (!is_single && (active_rx_cnt >= 2) && is_cam) | ||
767 | priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK; | 777 | priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK; |
768 | else | 778 | else |
769 | priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; | 779 | priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; |
770 | 780 | ||
771 | IWL_DEBUG_ASSOC("rx chain %X\n", priv->staging_rxon.rx_chain); | 781 | IWL_DEBUG_ASSOC("rx_chain=0x%Xi active=%d idle=%d\n", |
782 | priv->staging_rxon.rx_chain, | ||
783 | active_rx_cnt, idle_rx_cnt); | ||
784 | |||
785 | WARN_ON(active_rx_cnt == 0 || idle_rx_cnt == 0 || | ||
786 | active_rx_cnt < idle_rx_cnt); | ||
772 | } | 787 | } |
773 | EXPORT_SYMBOL(iwl_set_rxon_chain); | 788 | EXPORT_SYMBOL(iwl_set_rxon_chain); |
774 | 789 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index c19db438306c..cdfb343c7ec6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -412,7 +412,6 @@ struct iwl_ht_info { | |||
412 | /* self configuration data */ | 412 | /* self configuration data */ |
413 | u8 is_ht; | 413 | u8 is_ht; |
414 | u8 supported_chan_width; | 414 | u8 supported_chan_width; |
415 | u16 tx_mimo_ps_mode; | ||
416 | u8 is_green_field; | 415 | u8 is_green_field; |
417 | u8 sgf; /* HT_SHORT_GI_* short guard interval */ | 416 | u8 sgf; /* HT_SHORT_GI_* short guard interval */ |
418 | u8 max_amsdu_size; | 417 | u8 max_amsdu_size; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h index 944642450d3d..cd11c0ca2991 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fh.h +++ b/drivers/net/wireless/iwlwifi/iwl-fh.h | |||
@@ -287,6 +287,7 @@ | |||
287 | 287 | ||
288 | #define FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE (0x01000000) | 288 | #define FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE (0x01000000) |
289 | 289 | ||
290 | #define FH_MEM_TFDIB_REG1_ADDR_BITSHIFT 28 | ||
290 | 291 | ||
291 | /** | 292 | /** |
292 | * Transmit DMA Channel Control/Status Registers (TCSR) | 293 | * Transmit DMA Channel Control/Status Registers (TCSR) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index f3f6ea49fdd2..e81bfc42a7cb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -1173,7 +1173,10 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, | |||
1173 | 1173 | ||
1174 | rx_status.antenna = 0; | 1174 | rx_status.antenna = 0; |
1175 | rx_status.flag = 0; | 1175 | rx_status.flag = 0; |
1176 | rx_status.flag |= RX_FLAG_TSFT; | 1176 | |
1177 | /* TSF isn't reliable. In order to allow smooth user experience, | ||
1178 | * this W/A doesn't propagate it to the mac80211 */ | ||
1179 | /*rx_status.flag |= RX_FLAG_TSFT;*/ | ||
1177 | 1180 | ||
1178 | if ((unlikely(rx_start->cfg_phy_cnt > 20))) { | 1181 | if ((unlikely(rx_start->cfg_phy_cnt > 20))) { |
1179 | IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n", | 1182 | IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n", |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 9bb6adb28b73..6c8ac3a87d54 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -421,7 +421,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv, | |||
421 | else | 421 | else |
422 | scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; | 422 | scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; |
423 | 423 | ||
424 | if ((scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) && n_probes) | 424 | if (n_probes) |
425 | scan_ch->type |= IWL_SCAN_PROBE_MASK(n_probes); | 425 | scan_ch->type |= IWL_SCAN_PROBE_MASK(n_probes); |
426 | 426 | ||
427 | scan_ch->active_dwell = cpu_to_le16(active_dwell); | 427 | scan_ch->active_dwell = cpu_to_le16(active_dwell); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index d82823b5c8ab..78b1a7a4ca40 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -402,12 +402,11 @@ static int iwl_hw_tx_queue_init(struct iwl_priv *priv, | |||
402 | /** | 402 | /** |
403 | * iwl_tx_queue_init - Allocate and initialize one tx/cmd queue | 403 | * iwl_tx_queue_init - Allocate and initialize one tx/cmd queue |
404 | */ | 404 | */ |
405 | static int iwl_tx_queue_init(struct iwl_priv *priv, | 405 | static int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq, |
406 | struct iwl_tx_queue *txq, | ||
407 | int slots_num, u32 txq_id) | 406 | int slots_num, u32 txq_id) |
408 | { | 407 | { |
409 | int i, len; | 408 | int i, len; |
410 | int rc = 0; | 409 | int ret; |
411 | 410 | ||
412 | /* | 411 | /* |
413 | * Alloc buffer array for commands (Tx or other types of commands). | 412 | * Alloc buffer array for commands (Tx or other types of commands). |
@@ -426,19 +425,16 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, | |||
426 | continue; | 425 | continue; |
427 | } | 426 | } |
428 | 427 | ||
429 | txq->cmd[i] = kmalloc(len, GFP_KERNEL | GFP_DMA); | 428 | txq->cmd[i] = kmalloc(len, GFP_KERNEL); |
430 | if (!txq->cmd[i]) | 429 | if (!txq->cmd[i]) |
431 | return -ENOMEM; | 430 | goto err; |
432 | } | 431 | } |
433 | 432 | ||
434 | /* Alloc driver data array and TFD circular buffer */ | 433 | /* Alloc driver data array and TFD circular buffer */ |
435 | rc = iwl_tx_queue_alloc(priv, txq, txq_id); | 434 | ret = iwl_tx_queue_alloc(priv, txq, txq_id); |
436 | if (rc) { | 435 | if (ret) |
437 | for (i = 0; i < slots_num; i++) | 436 | goto err; |
438 | kfree(txq->cmd[i]); | ||
439 | 437 | ||
440 | return -ENOMEM; | ||
441 | } | ||
442 | txq->need_update = 0; | 438 | txq->need_update = 0; |
443 | 439 | ||
444 | /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise | 440 | /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise |
@@ -452,6 +448,17 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, | |||
452 | iwl_hw_tx_queue_init(priv, txq); | 448 | iwl_hw_tx_queue_init(priv, txq); |
453 | 449 | ||
454 | return 0; | 450 | return 0; |
451 | err: | ||
452 | for (i = 0; i < slots_num; i++) { | ||
453 | kfree(txq->cmd[i]); | ||
454 | txq->cmd[i] = NULL; | ||
455 | } | ||
456 | |||
457 | if (txq_id == IWL_CMD_QUEUE_NUM) { | ||
458 | kfree(txq->cmd[slots_num]); | ||
459 | txq->cmd[slots_num] = NULL; | ||
460 | } | ||
461 | return -ENOMEM; | ||
455 | } | 462 | } |
456 | /** | 463 | /** |
457 | * iwl_hw_txq_ctx_free - Free TXQ Context | 464 | * iwl_hw_txq_ctx_free - Free TXQ Context |
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 04d7a251e3f0..8941919001bb 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -595,7 +595,7 @@ static int if_cs_prog_helper(struct if_cs_card *card) | |||
595 | if (ret < 0) { | 595 | if (ret < 0) { |
596 | lbs_pr_err("can't download helper at 0x%x, ret %d\n", | 596 | lbs_pr_err("can't download helper at 0x%x, ret %d\n", |
597 | sent, ret); | 597 | sent, ret); |
598 | goto done; | 598 | goto err_release; |
599 | } | 599 | } |
600 | 600 | ||
601 | if (count == 0) | 601 | if (count == 0) |
@@ -604,9 +604,8 @@ static int if_cs_prog_helper(struct if_cs_card *card) | |||
604 | sent += count; | 604 | sent += count; |
605 | } | 605 | } |
606 | 606 | ||
607 | err_release: | ||
607 | release_firmware(fw); | 608 | release_firmware(fw); |
608 | ret = 0; | ||
609 | |||
610 | done: | 609 | done: |
611 | lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); | 610 | lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); |
612 | return ret; | 611 | return ret; |
@@ -676,14 +675,8 @@ static int if_cs_prog_real(struct if_cs_card *card) | |||
676 | } | 675 | } |
677 | 676 | ||
678 | ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); | 677 | ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); |
679 | if (ret < 0) { | 678 | if (ret < 0) |
680 | lbs_pr_err("firmware download failed\n"); | 679 | lbs_pr_err("firmware download failed\n"); |
681 | goto err_release; | ||
682 | } | ||
683 | |||
684 | ret = 0; | ||
685 | goto done; | ||
686 | |||
687 | 680 | ||
688 | err_release: | 681 | err_release: |
689 | release_firmware(fw); | 682 | release_firmware(fw); |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 1ebcafe7ca5f..36c004e15602 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -1970,6 +1970,9 @@ __orinoco_set_multicast_list(struct net_device *dev) | |||
1970 | priv->promiscuous = promisc; | 1970 | priv->promiscuous = promisc; |
1971 | } | 1971 | } |
1972 | 1972 | ||
1973 | /* If we're not in promiscuous mode, then we need to set the | ||
1974 | * group address if either we want to multicast, or if we were | ||
1975 | * multicasting and want to stop */ | ||
1973 | if (! promisc && (mc_count || priv->mc_count) ) { | 1976 | if (! promisc && (mc_count || priv->mc_count) ) { |
1974 | struct dev_mc_list *p = dev->mc_list; | 1977 | struct dev_mc_list *p = dev->mc_list; |
1975 | struct hermes_multicast mclist; | 1978 | struct hermes_multicast mclist; |
@@ -1989,9 +1992,10 @@ __orinoco_set_multicast_list(struct net_device *dev) | |||
1989 | printk(KERN_WARNING "%s: Multicast list is " | 1992 | printk(KERN_WARNING "%s: Multicast list is " |
1990 | "longer than mc_count\n", dev->name); | 1993 | "longer than mc_count\n", dev->name); |
1991 | 1994 | ||
1992 | err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFGROUPADDRESSES, | 1995 | err = hermes_write_ltv(hw, USER_BAP, |
1993 | HERMES_BYTES_TO_RECLEN(priv->mc_count * ETH_ALEN), | 1996 | HERMES_RID_CNFGROUPADDRESSES, |
1994 | &mclist); | 1997 | HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN), |
1998 | &mclist); | ||
1995 | if (err) | 1999 | if (err) |
1996 | printk(KERN_ERR "%s: Error %d setting multicast list.\n", | 2000 | printk(KERN_ERR "%s: Error %d setting multicast list.\n", |
1997 | dev->name, err); | 2001 | dev->name, err); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h index 7e88ce5651b9..2ea7866abd5d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00reg.h +++ b/drivers/net/wireless/rt2x00/rt2x00reg.h | |||
@@ -136,7 +136,7 @@ struct rt2x00_field32 { | |||
136 | */ | 136 | */ |
137 | #define is_power_of_two(x) ( !((x) & ((x)-1)) ) | 137 | #define is_power_of_two(x) ( !((x) & ((x)-1)) ) |
138 | #define low_bit_mask(x) ( ((x)-1) & ~(x) ) | 138 | #define low_bit_mask(x) ( ((x)-1) & ~(x) ) |
139 | #define is_valid_mask(x) is_power_of_two(1 + (x) + low_bit_mask(x)) | 139 | #define is_valid_mask(x) is_power_of_two(1LU + (x) + low_bit_mask(x)) |
140 | 140 | ||
141 | /* | 141 | /* |
142 | * Macro's to find first set bit in a variable. | 142 | * Macro's to find first set bit in a variable. |
@@ -173,8 +173,7 @@ struct rt2x00_field32 { | |||
173 | * does not exceed the given typelimit. | 173 | * does not exceed the given typelimit. |
174 | */ | 174 | */ |
175 | #define FIELD_CHECK(__mask, __type) \ | 175 | #define FIELD_CHECK(__mask, __type) \ |
176 | BUILD_BUG_ON(!__builtin_constant_p(__mask) || \ | 176 | BUILD_BUG_ON(!(__mask) || \ |
177 | !(__mask) || \ | ||
178 | !is_valid_mask(__mask) || \ | 177 | !is_valid_mask(__mask) || \ |
179 | (__mask) != (__type)(__mask)) \ | 178 | (__mask) != (__type)(__mask)) \ |
180 | 179 | ||
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 6ea349aba3ba..b184367637d0 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c | |||
@@ -800,7 +800,6 @@ static void __exit cmos_do_remove(struct device *dev) | |||
800 | static int cmos_suspend(struct device *dev, pm_message_t mesg) | 800 | static int cmos_suspend(struct device *dev, pm_message_t mesg) |
801 | { | 801 | { |
802 | struct cmos_rtc *cmos = dev_get_drvdata(dev); | 802 | struct cmos_rtc *cmos = dev_get_drvdata(dev); |
803 | int do_wake = device_may_wakeup(dev); | ||
804 | unsigned char tmp; | 803 | unsigned char tmp; |
805 | 804 | ||
806 | /* only the alarm might be a wakeup event source */ | 805 | /* only the alarm might be a wakeup event source */ |
@@ -809,7 +808,7 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg) | |||
809 | if (tmp & (RTC_PIE|RTC_AIE|RTC_UIE)) { | 808 | if (tmp & (RTC_PIE|RTC_AIE|RTC_UIE)) { |
810 | unsigned char mask; | 809 | unsigned char mask; |
811 | 810 | ||
812 | if (do_wake) | 811 | if (device_may_wakeup(dev)) |
813 | mask = RTC_IRQMASK & ~RTC_AIE; | 812 | mask = RTC_IRQMASK & ~RTC_AIE; |
814 | else | 813 | else |
815 | mask = RTC_IRQMASK; | 814 | mask = RTC_IRQMASK; |
@@ -837,6 +836,17 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg) | |||
837 | return 0; | 836 | return 0; |
838 | } | 837 | } |
839 | 838 | ||
839 | /* We want RTC alarms to wake us from e.g. ACPI G2/S5 "soft off", even | ||
840 | * after a detour through G3 "mechanical off", although the ACPI spec | ||
841 | * says wakeup should only work from G1/S4 "hibernate". To most users, | ||
842 | * distinctions between S4 and S5 are pointless. So when the hardware | ||
843 | * allows, don't draw that distinction. | ||
844 | */ | ||
845 | static inline int cmos_poweroff(struct device *dev) | ||
846 | { | ||
847 | return cmos_suspend(dev, PMSG_HIBERNATE); | ||
848 | } | ||
849 | |||
840 | static int cmos_resume(struct device *dev) | 850 | static int cmos_resume(struct device *dev) |
841 | { | 851 | { |
842 | struct cmos_rtc *cmos = dev_get_drvdata(dev); | 852 | struct cmos_rtc *cmos = dev_get_drvdata(dev); |
@@ -884,6 +894,12 @@ static int cmos_resume(struct device *dev) | |||
884 | #else | 894 | #else |
885 | #define cmos_suspend NULL | 895 | #define cmos_suspend NULL |
886 | #define cmos_resume NULL | 896 | #define cmos_resume NULL |
897 | |||
898 | static inline int cmos_poweroff(struct device *dev) | ||
899 | { | ||
900 | return -ENOSYS; | ||
901 | } | ||
902 | |||
887 | #endif | 903 | #endif |
888 | 904 | ||
889 | /*----------------------------------------------------------------*/ | 905 | /*----------------------------------------------------------------*/ |
@@ -903,10 +919,6 @@ static int cmos_resume(struct device *dev) | |||
903 | static int __devinit | 919 | static int __devinit |
904 | cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) | 920 | cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) |
905 | { | 921 | { |
906 | /* REVISIT paranoia argues for a shutdown notifier, since PNP | ||
907 | * drivers can't provide shutdown() methods to disable IRQs. | ||
908 | * Or better yet, fix PNP to allow those methods... | ||
909 | */ | ||
910 | if (pnp_port_start(pnp,0) == 0x70 && !pnp_irq_valid(pnp,0)) | 922 | if (pnp_port_start(pnp,0) == 0x70 && !pnp_irq_valid(pnp,0)) |
911 | /* Some machines contain a PNP entry for the RTC, but | 923 | /* Some machines contain a PNP entry for the RTC, but |
912 | * don't define the IRQ. It should always be safe to | 924 | * don't define the IRQ. It should always be safe to |
@@ -942,6 +954,13 @@ static int cmos_pnp_resume(struct pnp_dev *pnp) | |||
942 | #define cmos_pnp_resume NULL | 954 | #define cmos_pnp_resume NULL |
943 | #endif | 955 | #endif |
944 | 956 | ||
957 | static void cmos_pnp_shutdown(struct device *pdev) | ||
958 | { | ||
959 | if (system_state == SYSTEM_POWER_OFF && !cmos_poweroff(pdev)) | ||
960 | return; | ||
961 | |||
962 | cmos_do_shutdown(); | ||
963 | } | ||
945 | 964 | ||
946 | static const struct pnp_device_id rtc_ids[] = { | 965 | static const struct pnp_device_id rtc_ids[] = { |
947 | { .id = "PNP0b00", }, | 966 | { .id = "PNP0b00", }, |
@@ -961,6 +980,10 @@ static struct pnp_driver cmos_pnp_driver = { | |||
961 | .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, | 980 | .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, |
962 | .suspend = cmos_pnp_suspend, | 981 | .suspend = cmos_pnp_suspend, |
963 | .resume = cmos_pnp_resume, | 982 | .resume = cmos_pnp_resume, |
983 | .driver = { | ||
984 | .name = (char *)driver_name, | ||
985 | .shutdown = cmos_pnp_shutdown, | ||
986 | } | ||
964 | }; | 987 | }; |
965 | 988 | ||
966 | #endif /* CONFIG_PNP */ | 989 | #endif /* CONFIG_PNP */ |
@@ -986,6 +1009,9 @@ static int __exit cmos_platform_remove(struct platform_device *pdev) | |||
986 | 1009 | ||
987 | static void cmos_platform_shutdown(struct platform_device *pdev) | 1010 | static void cmos_platform_shutdown(struct platform_device *pdev) |
988 | { | 1011 | { |
1012 | if (system_state == SYSTEM_POWER_OFF && !cmos_poweroff(&pdev->dev)) | ||
1013 | return; | ||
1014 | |||
989 | cmos_do_shutdown(); | 1015 | cmos_do_shutdown(); |
990 | } | 1016 | } |
991 | 1017 | ||
diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c index 9f996ec881ce..dd70bf73ce9d 100644 --- a/drivers/rtc/rtc-lib.c +++ b/drivers/rtc/rtc-lib.c | |||
@@ -51,10 +51,11 @@ EXPORT_SYMBOL(rtc_year_days); | |||
51 | */ | 51 | */ |
52 | void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) | 52 | void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) |
53 | { | 53 | { |
54 | unsigned int days, month, year; | 54 | unsigned int month, year; |
55 | int days; | ||
55 | 56 | ||
56 | days = time / 86400; | 57 | days = time / 86400; |
57 | time -= days * 86400; | 58 | time -= (unsigned int) days * 86400; |
58 | 59 | ||
59 | /* day of the week, 1970-01-01 was a Thursday */ | 60 | /* day of the week, 1970-01-01 was a Thursday */ |
60 | tm->tm_wday = (days + 4) % 7; | 61 | tm->tm_wday = (days + 4) % 7; |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e5e7d7856454..2a2bc89aba83 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1875,6 +1875,7 @@ static int sd_probe(struct device *dev) | |||
1875 | 1875 | ||
1876 | dev_set_drvdata(dev, sdkp); | 1876 | dev_set_drvdata(dev, sdkp); |
1877 | add_disk(gd); | 1877 | add_disk(gd); |
1878 | blk_register_filter(gd); | ||
1878 | sd_dif_config_host(sdkp); | 1879 | sd_dif_config_host(sdkp); |
1879 | 1880 | ||
1880 | sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", | 1881 | sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", |
@@ -1908,6 +1909,7 @@ static int sd_remove(struct device *dev) | |||
1908 | struct scsi_disk *sdkp = dev_get_drvdata(dev); | 1909 | struct scsi_disk *sdkp = dev_get_drvdata(dev); |
1909 | 1910 | ||
1910 | device_del(&sdkp->dev); | 1911 | device_del(&sdkp->dev); |
1912 | blk_unregister_filter(sdkp->disk); | ||
1911 | del_gendisk(sdkp->disk); | 1913 | del_gendisk(sdkp->disk); |
1912 | sd_shutdown(dev); | 1914 | sd_shutdown(dev); |
1913 | 1915 | ||
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 27f5bfd1def3..3292965bfd84 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -656,6 +656,7 @@ static int sr_probe(struct device *dev) | |||
656 | dev_set_drvdata(dev, cd); | 656 | dev_set_drvdata(dev, cd); |
657 | disk->flags |= GENHD_FL_REMOVABLE; | 657 | disk->flags |= GENHD_FL_REMOVABLE; |
658 | add_disk(disk); | 658 | add_disk(disk); |
659 | blk_register_filter(disk); | ||
659 | 660 | ||
660 | sdev_printk(KERN_DEBUG, sdev, | 661 | sdev_printk(KERN_DEBUG, sdev, |
661 | "Attached scsi CD-ROM %s\n", cd->cdi.name); | 662 | "Attached scsi CD-ROM %s\n", cd->cdi.name); |
@@ -894,6 +895,7 @@ static int sr_remove(struct device *dev) | |||
894 | { | 895 | { |
895 | struct scsi_cd *cd = dev_get_drvdata(dev); | 896 | struct scsi_cd *cd = dev_get_drvdata(dev); |
896 | 897 | ||
898 | blk_unregister_filter(cd->disk); | ||
897 | del_gendisk(cd->disk); | 899 | del_gendisk(cd->disk); |
898 | 900 | ||
899 | mutex_lock(&sr_ref_mutex); | 901 | mutex_lock(&sr_ref_mutex); |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 342e12fb1c25..9ccc563d8730 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -1908,15 +1908,23 @@ static int serial8250_startup(struct uart_port *port) | |||
1908 | * kick the UART on a regular basis. | 1908 | * kick the UART on a regular basis. |
1909 | */ | 1909 | */ |
1910 | if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) { | 1910 | if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) { |
1911 | up->bugs |= UART_BUG_THRE; | ||
1911 | pr_debug("ttyS%d - using backup timer\n", port->line); | 1912 | pr_debug("ttyS%d - using backup timer\n", port->line); |
1912 | up->timer.function = serial8250_backup_timeout; | ||
1913 | up->timer.data = (unsigned long)up; | ||
1914 | mod_timer(&up->timer, jiffies + | ||
1915 | poll_timeout(up->port.timeout) + HZ / 5); | ||
1916 | } | 1913 | } |
1917 | } | 1914 | } |
1918 | 1915 | ||
1919 | /* | 1916 | /* |
1917 | * The above check will only give an accurate result the first time | ||
1918 | * the port is opened so this value needs to be preserved. | ||
1919 | */ | ||
1920 | if (up->bugs & UART_BUG_THRE) { | ||
1921 | up->timer.function = serial8250_backup_timeout; | ||
1922 | up->timer.data = (unsigned long)up; | ||
1923 | mod_timer(&up->timer, jiffies + | ||
1924 | poll_timeout(up->port.timeout) + HZ / 5); | ||
1925 | } | ||
1926 | |||
1927 | /* | ||
1920 | * If the "interrupt" for this port doesn't correspond with any | 1928 | * If the "interrupt" for this port doesn't correspond with any |
1921 | * hardware interrupt, we use a timer-based system. The original | 1929 | * hardware interrupt, we use a timer-based system. The original |
1922 | * driver used to do this with IRQ0. | 1930 | * driver used to do this with IRQ0. |
diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h index 78c00162b04e..520260326f3d 100644 --- a/drivers/serial/8250.h +++ b/drivers/serial/8250.h | |||
@@ -47,6 +47,7 @@ struct serial8250_config { | |||
47 | #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ | 47 | #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ |
48 | #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ | 48 | #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ |
49 | #define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */ | 49 | #define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */ |
50 | #define UART_BUG_THRE (1 << 3) /* UART has buggy THRE reassertion */ | ||
50 | 51 | ||
51 | #define PROBE_RSA (1 << 0) | 52 | #define PROBE_RSA (1 << 0) |
52 | #define PROBE_ANY (~0) | 53 | #define PROBE_ANY (~0) |
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index c14b2435d23e..e729fb279645 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c | |||
@@ -628,27 +628,18 @@ static long cirrusfb_get_mclk(long freq, int bpp, long *div) | |||
628 | static int cirrusfb_check_var(struct fb_var_screeninfo *var, | 628 | static int cirrusfb_check_var(struct fb_var_screeninfo *var, |
629 | struct fb_info *info) | 629 | struct fb_info *info) |
630 | { | 630 | { |
631 | int nom, den; /* translyting from pixels->bytes */ | 631 | int yres; |
632 | int yres, i; | 632 | /* memory size in pixels */ |
633 | static struct { int xres, yres; } modes[] = | 633 | unsigned pixels = info->screen_size * 8 / var->bits_per_pixel; |
634 | { { 1600, 1280 }, | ||
635 | { 1280, 1024 }, | ||
636 | { 1024, 768 }, | ||
637 | { 800, 600 }, | ||
638 | { 640, 480 }, | ||
639 | { -1, -1 } }; | ||
640 | 634 | ||
641 | switch (var->bits_per_pixel) { | 635 | switch (var->bits_per_pixel) { |
642 | case 1: | 636 | case 1: |
643 | nom = 4; | 637 | pixels /= 4; |
644 | den = 8; | ||
645 | break; /* 8 pixel per byte, only 1/4th of mem usable */ | 638 | break; /* 8 pixel per byte, only 1/4th of mem usable */ |
646 | case 8: | 639 | case 8: |
647 | case 16: | 640 | case 16: |
648 | case 24: | 641 | case 24: |
649 | case 32: | 642 | case 32: |
650 | nom = var->bits_per_pixel / 8; | ||
651 | den = 1; | ||
652 | break; /* 1 pixel == 1 byte */ | 643 | break; /* 1 pixel == 1 byte */ |
653 | default: | 644 | default: |
654 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." | 645 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." |
@@ -658,43 +649,29 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var, | |||
658 | return -EINVAL; | 649 | return -EINVAL; |
659 | } | 650 | } |
660 | 651 | ||
661 | if (var->xres * nom / den * var->yres > info->screen_size) { | 652 | if (var->xres_virtual < var->xres) |
662 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." | 653 | var->xres_virtual = var->xres; |
663 | "resolution too high to fit into video memory!\n", | ||
664 | var->xres, var->yres, var->bits_per_pixel); | ||
665 | DPRINTK("EXIT - EINVAL error\n"); | ||
666 | return -EINVAL; | ||
667 | } | ||
668 | |||
669 | /* use highest possible virtual resolution */ | 654 | /* use highest possible virtual resolution */ |
670 | if (var->xres_virtual == -1 && | 655 | if (var->yres_virtual == -1) { |
671 | var->yres_virtual == -1) { | 656 | var->yres_virtual = pixels / var->xres_virtual; |
672 | printk(KERN_INFO | ||
673 | "cirrusfb: using maximum available virtual resolution\n"); | ||
674 | for (i = 0; modes[i].xres != -1; i++) { | ||
675 | int size = modes[i].xres * nom / den * modes[i].yres; | ||
676 | if (size < info->screen_size / 2) | ||
677 | break; | ||
678 | } | ||
679 | if (modes[i].xres == -1) { | ||
680 | printk(KERN_ERR "cirrusfb: could not find a virtual " | ||
681 | "resolution that fits into video memory!!\n"); | ||
682 | DPRINTK("EXIT - EINVAL error\n"); | ||
683 | return -EINVAL; | ||
684 | } | ||
685 | var->xres_virtual = modes[i].xres; | ||
686 | var->yres_virtual = modes[i].yres; | ||
687 | 657 | ||
688 | printk(KERN_INFO "cirrusfb: virtual resolution set to " | 658 | printk(KERN_INFO "cirrusfb: virtual resolution set to " |
689 | "maximum of %dx%d\n", var->xres_virtual, | 659 | "maximum of %dx%d\n", var->xres_virtual, |
690 | var->yres_virtual); | 660 | var->yres_virtual); |
691 | } | 661 | } |
692 | |||
693 | if (var->xres_virtual < var->xres) | ||
694 | var->xres_virtual = var->xres; | ||
695 | if (var->yres_virtual < var->yres) | 662 | if (var->yres_virtual < var->yres) |
696 | var->yres_virtual = var->yres; | 663 | var->yres_virtual = var->yres; |
697 | 664 | ||
665 | if (var->xres_virtual * var->yres_virtual > pixels) { | ||
666 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected... " | ||
667 | "virtual resolution too high to fit into video memory!\n", | ||
668 | var->xres_virtual, var->yres_virtual, | ||
669 | var->bits_per_pixel); | ||
670 | DPRINTK("EXIT - EINVAL error\n"); | ||
671 | return -EINVAL; | ||
672 | } | ||
673 | |||
674 | |||
698 | if (var->xoffset < 0) | 675 | if (var->xoffset < 0) |
699 | var->xoffset = 0; | 676 | var->xoffset = 0; |
700 | if (var->yoffset < 0) | 677 | if (var->yoffset < 0) |
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 77aafcfae037..4599a4385bc9 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c | |||
@@ -95,7 +95,6 @@ static inline int mtrr_del(int reg, unsigned long base, | |||
95 | #define VOODOO5_MAX_PIXCLOCK 350000 | 95 | #define VOODOO5_MAX_PIXCLOCK 350000 |
96 | 96 | ||
97 | static struct fb_fix_screeninfo tdfx_fix __devinitdata = { | 97 | static struct fb_fix_screeninfo tdfx_fix __devinitdata = { |
98 | .id = "3Dfx", | ||
99 | .type = FB_TYPE_PACKED_PIXELS, | 98 | .type = FB_TYPE_PACKED_PIXELS, |
100 | .visual = FB_VISUAL_PSEUDOCOLOR, | 99 | .visual = FB_VISUAL_PSEUDOCOLOR, |
101 | .ypanstep = 1, | 100 | .ypanstep = 1, |
@@ -426,7 +425,7 @@ static unsigned long do_lfb_size(struct tdfx_par *par, unsigned short dev_id) | |||
426 | if (dev_id < PCI_DEVICE_ID_3DFX_VOODOO5) { | 425 | if (dev_id < PCI_DEVICE_ID_3DFX_VOODOO5) { |
427 | /* Banshee/Voodoo3 */ | 426 | /* Banshee/Voodoo3 */ |
428 | chip_size = 2; | 427 | chip_size = 2; |
429 | if (has_sgram && (draminit0 & DRAMINIT0_SGRAM_TYPE)) | 428 | if (has_sgram && !(draminit0 & DRAMINIT0_SGRAM_TYPE)) |
430 | chip_size = 1; | 429 | chip_size = 1; |
431 | } else { | 430 | } else { |
432 | /* Voodoo4/5 */ | 431 | /* Voodoo4/5 */ |
@@ -1200,15 +1199,15 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev, | |||
1200 | /* Configure the default fb_fix_screeninfo first */ | 1199 | /* Configure the default fb_fix_screeninfo first */ |
1201 | switch (pdev->device) { | 1200 | switch (pdev->device) { |
1202 | case PCI_DEVICE_ID_3DFX_BANSHEE: | 1201 | case PCI_DEVICE_ID_3DFX_BANSHEE: |
1203 | strcat(tdfx_fix.id, " Banshee"); | 1202 | strcpy(tdfx_fix.id, "3Dfx Banshee"); |
1204 | default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK; | 1203 | default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK; |
1205 | break; | 1204 | break; |
1206 | case PCI_DEVICE_ID_3DFX_VOODOO3: | 1205 | case PCI_DEVICE_ID_3DFX_VOODOO3: |
1207 | strcat(tdfx_fix.id, " Voodoo3"); | 1206 | strcpy(tdfx_fix.id, "3Dfx Voodoo3"); |
1208 | default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK; | 1207 | default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK; |
1209 | break; | 1208 | break; |
1210 | case PCI_DEVICE_ID_3DFX_VOODOO5: | 1209 | case PCI_DEVICE_ID_3DFX_VOODOO5: |
1211 | strcat(tdfx_fix.id, " Voodoo5"); | 1210 | strcpy(tdfx_fix.id, "3Dfx Voodoo5"); |
1212 | default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK; | 1211 | default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK; |
1213 | break; | 1212 | break; |
1214 | } | 1213 | } |