diff options
Diffstat (limited to 'drivers')
57 files changed, 637 insertions, 515 deletions
diff --git a/drivers/atm/he.c b/drivers/atm/he.c index ffc4a5a41946..ea495b21f916 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
@@ -1542,7 +1542,8 @@ he_start(struct atm_dev *dev) | |||
1542 | /* initialize framer */ | 1542 | /* initialize framer */ |
1543 | 1543 | ||
1544 | #ifdef CONFIG_ATM_HE_USE_SUNI | 1544 | #ifdef CONFIG_ATM_HE_USE_SUNI |
1545 | suni_init(he_dev->atm_dev); | 1545 | if (he_isMM(he_dev)) |
1546 | suni_init(he_dev->atm_dev); | ||
1546 | if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->start) | 1547 | if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->start) |
1547 | he_dev->atm_dev->phy->start(he_dev->atm_dev); | 1548 | he_dev->atm_dev->phy->start(he_dev->atm_dev); |
1548 | #endif /* CONFIG_ATM_HE_USE_SUNI */ | 1549 | #endif /* CONFIG_ATM_HE_USE_SUNI */ |
@@ -1554,6 +1555,7 @@ he_start(struct atm_dev *dev) | |||
1554 | val = he_phy_get(he_dev->atm_dev, SUNI_TPOP_APM); | 1555 | val = he_phy_get(he_dev->atm_dev, SUNI_TPOP_APM); |
1555 | val = (val & ~SUNI_TPOP_APM_S) | (SUNI_TPOP_S_SDH << SUNI_TPOP_APM_S_SHIFT); | 1556 | val = (val & ~SUNI_TPOP_APM_S) | (SUNI_TPOP_S_SDH << SUNI_TPOP_APM_S_SHIFT); |
1556 | he_phy_put(he_dev->atm_dev, val, SUNI_TPOP_APM); | 1557 | he_phy_put(he_dev->atm_dev, val, SUNI_TPOP_APM); |
1558 | he_phy_put(he_dev->atm_dev, SUNI_TACP_IUCHP_CLP, SUNI_TACP_IUCHP); | ||
1557 | } | 1559 | } |
1558 | 1560 | ||
1559 | /* 5.1.12 enable transmit and receive */ | 1561 | /* 5.1.12 enable transmit and receive */ |
@@ -2844,10 +2846,15 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void __user *arg) | |||
2844 | if (copy_from_user(®, arg, | 2846 | if (copy_from_user(®, arg, |
2845 | sizeof(struct he_ioctl_reg))) | 2847 | sizeof(struct he_ioctl_reg))) |
2846 | return -EFAULT; | 2848 | return -EFAULT; |
2847 | 2849 | ||
2848 | spin_lock_irqsave(&he_dev->global_lock, flags); | 2850 | spin_lock_irqsave(&he_dev->global_lock, flags); |
2849 | switch (reg.type) { | 2851 | switch (reg.type) { |
2850 | case HE_REGTYPE_PCI: | 2852 | case HE_REGTYPE_PCI: |
2853 | if (reg.addr < 0 || reg.addr >= HE_REGMAP_SIZE) { | ||
2854 | err = -EINVAL; | ||
2855 | break; | ||
2856 | } | ||
2857 | |||
2851 | reg.val = he_readl(he_dev, reg.addr); | 2858 | reg.val = he_readl(he_dev, reg.addr); |
2852 | break; | 2859 | break; |
2853 | case HE_REGTYPE_RCM: | 2860 | case HE_REGTYPE_RCM: |
diff --git a/drivers/atm/he.h b/drivers/atm/he.h index fe6cd15a78a4..b87d6ccabac1 100644 --- a/drivers/atm/he.h +++ b/drivers/atm/he.h | |||
@@ -267,13 +267,7 @@ struct he_dev { | |||
267 | 267 | ||
268 | char prod_id[30]; | 268 | char prod_id[30]; |
269 | char mac_addr[6]; | 269 | char mac_addr[6]; |
270 | int media; /* | 270 | int media; |
271 | * 0x26 = HE155 MM | ||
272 | * 0x27 = HE622 MM | ||
273 | * 0x46 = HE155 SM | ||
274 | * 0x47 = HE622 SM | ||
275 | */ | ||
276 | |||
277 | 271 | ||
278 | unsigned int vcibits, vpibits; | 272 | unsigned int vcibits, vpibits; |
279 | unsigned int cells_per_row; | 273 | unsigned int cells_per_row; |
@@ -392,6 +386,7 @@ struct he_vcc | |||
392 | #define HE_DEV(dev) ((struct he_dev *) (dev)->dev_data) | 386 | #define HE_DEV(dev) ((struct he_dev *) (dev)->dev_data) |
393 | 387 | ||
394 | #define he_is622(dev) ((dev)->media & 0x1) | 388 | #define he_is622(dev) ((dev)->media & 0x1) |
389 | #define he_isMM(dev) ((dev)->media & 0x20) | ||
395 | 390 | ||
396 | #define HE_REGMAP_SIZE 0x100000 | 391 | #define HE_REGMAP_SIZE 0x100000 |
397 | 392 | ||
@@ -876,8 +871,8 @@ struct he_vcc | |||
876 | #define M_SN 0x3a /* integer */ | 871 | #define M_SN 0x3a /* integer */ |
877 | #define MEDIA 0x3e /* integer */ | 872 | #define MEDIA 0x3e /* integer */ |
878 | #define HE155MM 0x26 | 873 | #define HE155MM 0x26 |
879 | #define HE155SM 0x27 | 874 | #define HE622MM 0x27 |
880 | #define HE622MM 0x46 | 875 | #define HE155SM 0x46 |
881 | #define HE622SM 0x47 | 876 | #define HE622SM 0x47 |
882 | #define MAC_ADDR 0x42 /* char[] */ | 877 | #define MAC_ADDR 0x42 /* char[] */ |
883 | 878 | ||
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 5c28ca7380ff..139fce6968a6 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -2562,17 +2562,11 @@ static int __devinit ia_start(struct atm_dev *dev) | |||
2562 | error = suni_init(dev); | 2562 | error = suni_init(dev); |
2563 | if (error) | 2563 | if (error) |
2564 | goto err_free_rx; | 2564 | goto err_free_rx; |
2565 | /* | 2565 | if (dev->phy->start) { |
2566 | * Enable interrupt on loss of signal | 2566 | error = dev->phy->start(dev); |
2567 | * SUNI_RSOP_CIE - 0x10 | 2567 | if (error) |
2568 | * SUNI_RSOP_CIE_LOSE - 0x04 | 2568 | goto err_free_rx; |
2569 | */ | 2569 | } |
2570 | ia_phy_put(dev, ia_phy_get(dev, 0x10) | 0x04, 0x10); | ||
2571 | #ifndef MODULE | ||
2572 | error = dev->phy->start(dev); | ||
2573 | if (error) | ||
2574 | goto err_free_rx; | ||
2575 | #endif | ||
2576 | /* Get iadev->carrier_detect status */ | 2570 | /* Get iadev->carrier_detect status */ |
2577 | IaFrontEndIntr(iadev); | 2571 | IaFrontEndIntr(iadev); |
2578 | } | 2572 | } |
@@ -3198,6 +3192,8 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
3198 | IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev, | 3192 | IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev, |
3199 | iadev->LineRate);) | 3193 | iadev->LineRate);) |
3200 | 3194 | ||
3195 | pci_set_drvdata(pdev, dev); | ||
3196 | |||
3201 | ia_dev[iadev_count] = iadev; | 3197 | ia_dev[iadev_count] = iadev; |
3202 | _ia_dev[iadev_count] = dev; | 3198 | _ia_dev[iadev_count] = dev; |
3203 | iadev_count++; | 3199 | iadev_count++; |
@@ -3219,8 +3215,6 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
3219 | iadev->next_board = ia_boards; | 3215 | iadev->next_board = ia_boards; |
3220 | ia_boards = dev; | 3216 | ia_boards = dev; |
3221 | 3217 | ||
3222 | pci_set_drvdata(pdev, dev); | ||
3223 | |||
3224 | return 0; | 3218 | return 0; |
3225 | 3219 | ||
3226 | err_out_deregister_dev: | 3220 | err_out_deregister_dev: |
@@ -3238,9 +3232,14 @@ static void __devexit ia_remove_one(struct pci_dev *pdev) | |||
3238 | struct atm_dev *dev = pci_get_drvdata(pdev); | 3232 | struct atm_dev *dev = pci_get_drvdata(pdev); |
3239 | IADEV *iadev = INPH_IA_DEV(dev); | 3233 | IADEV *iadev = INPH_IA_DEV(dev); |
3240 | 3234 | ||
3241 | ia_phy_put(dev, ia_phy_get(dev,0x10) & ~(0x4), 0x10); | 3235 | /* Disable phy interrupts */ |
3236 | ia_phy_put(dev, ia_phy_get(dev, SUNI_RSOP_CIE) & ~(SUNI_RSOP_CIE_LOSE), | ||
3237 | SUNI_RSOP_CIE); | ||
3242 | udelay(1); | 3238 | udelay(1); |
3243 | 3239 | ||
3240 | if (dev->phy && dev->phy->stop) | ||
3241 | dev->phy->stop(dev); | ||
3242 | |||
3244 | /* De-register device */ | 3243 | /* De-register device */ |
3245 | free_irq(iadev->irq, dev); | 3244 | free_irq(iadev->irq, dev); |
3246 | iadev_count--; | 3245 | iadev_count--; |
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h index 99e6a406efb4..81e14bea54bd 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/char/agp/agp.h | |||
@@ -99,8 +99,8 @@ struct agp_bridge_driver { | |||
99 | const void *aperture_sizes; | 99 | const void *aperture_sizes; |
100 | int num_aperture_sizes; | 100 | int num_aperture_sizes; |
101 | enum aper_size_type size_type; | 101 | enum aper_size_type size_type; |
102 | int cant_use_aperture; | 102 | bool cant_use_aperture; |
103 | int needs_scratch_page; | 103 | bool needs_scratch_page; |
104 | const struct gatt_mask *masks; | 104 | const struct gatt_mask *masks; |
105 | int (*fetch_size)(void); | 105 | int (*fetch_size)(void); |
106 | int (*configure)(void); | 106 | int (*configure)(void); |
@@ -278,7 +278,7 @@ void agp_generic_destroy_page(void *addr, int flags); | |||
278 | void agp_free_key(int key); | 278 | void agp_free_key(int key); |
279 | int agp_num_entries(void); | 279 | int agp_num_entries(void); |
280 | u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 mode, u32 command); | 280 | u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 mode, u32 command); |
281 | void agp_device_command(u32 command, int agp_v3); | 281 | void agp_device_command(u32 command, bool agp_v3); |
282 | int agp_3_5_enable(struct agp_bridge_data *bridge); | 282 | int agp_3_5_enable(struct agp_bridge_data *bridge); |
283 | void global_cache_flush(void); | 283 | void global_cache_flush(void); |
284 | void get_agp_version(struct agp_bridge_data *bridge); | 284 | void get_agp_version(struct agp_bridge_data *bridge); |
diff --git a/drivers/char/agp/alpha-agp.c b/drivers/char/agp/alpha-agp.c index e77c17838c8a..5da89f6c6c25 100644 --- a/drivers/char/agp/alpha-agp.c +++ b/drivers/char/agp/alpha-agp.c | |||
@@ -80,7 +80,7 @@ static void alpha_core_agp_enable(struct agp_bridge_data *bridge, u32 mode) | |||
80 | agp->mode.bits.enable = 1; | 80 | agp->mode.bits.enable = 1; |
81 | agp->ops->configure(agp); | 81 | agp->ops->configure(agp); |
82 | 82 | ||
83 | agp_device_command(agp->mode.lw, 0); | 83 | agp_device_command(agp->mode.lw, false); |
84 | } | 84 | } |
85 | 85 | ||
86 | static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start, | 86 | static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start, |
@@ -126,7 +126,7 @@ struct agp_bridge_driver alpha_core_agp_driver = { | |||
126 | .aperture_sizes = alpha_core_agp_sizes, | 126 | .aperture_sizes = alpha_core_agp_sizes, |
127 | .num_aperture_sizes = 1, | 127 | .num_aperture_sizes = 1, |
128 | .size_type = FIXED_APER_SIZE, | 128 | .size_type = FIXED_APER_SIZE, |
129 | .cant_use_aperture = 1, | 129 | .cant_use_aperture = true, |
130 | .masks = NULL, | 130 | .masks = NULL, |
131 | 131 | ||
132 | .fetch_size = alpha_core_agp_fetch_size, | 132 | .fetch_size = alpha_core_agp_fetch_size, |
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index 96bdb9296b07..39a0718bc616 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -314,9 +314,9 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) | |||
314 | j++; | 314 | j++; |
315 | } | 315 | } |
316 | 316 | ||
317 | if (mem->is_flushed == FALSE) { | 317 | if (!mem->is_flushed) { |
318 | global_cache_flush(); | 318 | global_cache_flush(); |
319 | mem->is_flushed = TRUE; | 319 | mem->is_flushed = true; |
320 | } | 320 | } |
321 | 321 | ||
322 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 322 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index d8200ac8f8cb..13665db363d6 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -90,9 +90,9 @@ static int amd64_insert_memory(struct agp_memory *mem, off_t pg_start, int type) | |||
90 | j++; | 90 | j++; |
91 | } | 91 | } |
92 | 92 | ||
93 | if (mem->is_flushed == FALSE) { | 93 | if (!mem->is_flushed) { |
94 | global_cache_flush(); | 94 | global_cache_flush(); |
95 | mem->is_flushed = TRUE; | 95 | mem->is_flushed = true; |
96 | } | 96 | } |
97 | 97 | ||
98 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 98 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c index 07b4d8ff56e5..3a4566c0d84f 100644 --- a/drivers/char/agp/ati-agp.c +++ b/drivers/char/agp/ati-agp.c | |||
@@ -287,10 +287,10 @@ static int ati_insert_memory(struct agp_memory * mem, | |||
287 | j++; | 287 | j++; |
288 | } | 288 | } |
289 | 289 | ||
290 | if (mem->is_flushed == FALSE) { | 290 | if (!mem->is_flushed) { |
291 | /*CACHE_FLUSH(); */ | 291 | /*CACHE_FLUSH(); */ |
292 | global_cache_flush(); | 292 | global_cache_flush(); |
293 | mem->is_flushed = TRUE; | 293 | mem->is_flushed = true; |
294 | } | 294 | } |
295 | 295 | ||
296 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 296 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index b1bdd015165c..1ec87104e68c 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c | |||
@@ -188,10 +188,10 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
188 | 188 | ||
189 | err_out: | 189 | err_out: |
190 | if (bridge->driver->needs_scratch_page) { | 190 | if (bridge->driver->needs_scratch_page) { |
191 | bridge->driver->agp_destroy_page(gart_to_virt(bridge->scratch_page_real), | 191 | void *va = gart_to_virt(bridge->scratch_page_real); |
192 | AGP_PAGE_DESTROY_UNMAP); | 192 | |
193 | bridge->driver->agp_destroy_page(gart_to_virt(bridge->scratch_page_real), | 193 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP); |
194 | AGP_PAGE_DESTROY_FREE); | 194 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE); |
195 | } | 195 | } |
196 | if (got_gatt) | 196 | if (got_gatt) |
197 | bridge->driver->free_gatt_table(bridge); | 197 | bridge->driver->free_gatt_table(bridge); |
@@ -215,10 +215,10 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge) | |||
215 | 215 | ||
216 | if (bridge->driver->agp_destroy_page && | 216 | if (bridge->driver->agp_destroy_page && |
217 | bridge->driver->needs_scratch_page) { | 217 | bridge->driver->needs_scratch_page) { |
218 | bridge->driver->agp_destroy_page(gart_to_virt(bridge->scratch_page_real), | 218 | void *va = gart_to_virt(bridge->scratch_page_real); |
219 | AGP_PAGE_DESTROY_UNMAP); | 219 | |
220 | bridge->driver->agp_destroy_page(gart_to_virt(bridge->scratch_page_real), | 220 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP); |
221 | AGP_PAGE_DESTROY_FREE); | 221 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE); |
222 | } | 222 | } |
223 | } | 223 | } |
224 | 224 | ||
diff --git a/drivers/char/agp/compat_ioctl.c b/drivers/char/agp/compat_ioctl.c index 39275794fe63..58c57cb2518c 100644 --- a/drivers/char/agp/compat_ioctl.c +++ b/drivers/char/agp/compat_ioctl.c | |||
@@ -214,7 +214,7 @@ long compat_agp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
214 | ret_val = -EINVAL; | 214 | ret_val = -EINVAL; |
215 | goto ioctl_out; | 215 | goto ioctl_out; |
216 | } | 216 | } |
217 | if ((agp_fe.backend_acquired != TRUE) && | 217 | if ((agp_fe.backend_acquired != true) && |
218 | (cmd != AGPIOC_ACQUIRE32)) { | 218 | (cmd != AGPIOC_ACQUIRE32)) { |
219 | ret_val = -EBUSY; | 219 | ret_val = -EBUSY; |
220 | goto ioctl_out; | 220 | goto ioctl_out; |
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index cac0009cebc1..8ca6f262ef85 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c | |||
@@ -249,9 +249,9 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t | |||
249 | if (type != 0 || mem->type != 0) | 249 | if (type != 0 || mem->type != 0) |
250 | return -EINVAL; | 250 | return -EINVAL; |
251 | 251 | ||
252 | if (mem->is_flushed == FALSE) { | 252 | if (!mem->is_flushed) { |
253 | global_cache_flush(); | 253 | global_cache_flush(); |
254 | mem->is_flushed = TRUE; | 254 | mem->is_flushed = true; |
255 | } | 255 | } |
256 | 256 | ||
257 | last_page = NULL; | 257 | last_page = NULL; |
@@ -329,7 +329,7 @@ static const struct agp_bridge_driver efficeon_driver = { | |||
329 | .free_gatt_table = efficeon_free_gatt_table, | 329 | .free_gatt_table = efficeon_free_gatt_table, |
330 | .insert_memory = efficeon_insert_memory, | 330 | .insert_memory = efficeon_insert_memory, |
331 | .remove_memory = efficeon_remove_memory, | 331 | .remove_memory = efficeon_remove_memory, |
332 | .cant_use_aperture = 0, // 1 might be faster? | 332 | .cant_use_aperture = false, // true might be faster? |
333 | 333 | ||
334 | // Generic | 334 | // Generic |
335 | .alloc_by_type = agp_generic_alloc_by_type, | 335 | .alloc_by_type = agp_generic_alloc_by_type, |
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index 857b26227d87..e6cb1ab03e06 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c | |||
@@ -395,7 +395,7 @@ static int agp_remove_controller(struct agp_controller *controller) | |||
395 | 395 | ||
396 | if (agp_fe.current_controller == controller) { | 396 | if (agp_fe.current_controller == controller) { |
397 | agp_fe.current_controller = NULL; | 397 | agp_fe.current_controller = NULL; |
398 | agp_fe.backend_acquired = FALSE; | 398 | agp_fe.backend_acquired = false; |
399 | agp_backend_release(agp_bridge); | 399 | agp_backend_release(agp_bridge); |
400 | } | 400 | } |
401 | kfree(controller); | 401 | kfree(controller); |
@@ -443,7 +443,7 @@ static void agp_controller_release_current(struct agp_controller *controller, | |||
443 | } | 443 | } |
444 | 444 | ||
445 | agp_fe.current_controller = NULL; | 445 | agp_fe.current_controller = NULL; |
446 | agp_fe.used_by_controller = FALSE; | 446 | agp_fe.used_by_controller = false; |
447 | agp_backend_release(agp_bridge); | 447 | agp_backend_release(agp_bridge); |
448 | } | 448 | } |
449 | 449 | ||
@@ -573,7 +573,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma) | |||
573 | 573 | ||
574 | mutex_lock(&(agp_fe.agp_mutex)); | 574 | mutex_lock(&(agp_fe.agp_mutex)); |
575 | 575 | ||
576 | if (agp_fe.backend_acquired != TRUE) | 576 | if (agp_fe.backend_acquired != true) |
577 | goto out_eperm; | 577 | goto out_eperm; |
578 | 578 | ||
579 | if (!(test_bit(AGP_FF_IS_VALID, &priv->access_flags))) | 579 | if (!(test_bit(AGP_FF_IS_VALID, &priv->access_flags))) |
@@ -768,7 +768,7 @@ int agpioc_acquire_wrap(struct agp_file_private *priv) | |||
768 | 768 | ||
769 | atomic_inc(&agp_bridge->agp_in_use); | 769 | atomic_inc(&agp_bridge->agp_in_use); |
770 | 770 | ||
771 | agp_fe.backend_acquired = TRUE; | 771 | agp_fe.backend_acquired = true; |
772 | 772 | ||
773 | controller = agp_find_controller_by_pid(priv->my_pid); | 773 | controller = agp_find_controller_by_pid(priv->my_pid); |
774 | 774 | ||
@@ -778,7 +778,7 @@ int agpioc_acquire_wrap(struct agp_file_private *priv) | |||
778 | controller = agp_create_controller(priv->my_pid); | 778 | controller = agp_create_controller(priv->my_pid); |
779 | 779 | ||
780 | if (controller == NULL) { | 780 | if (controller == NULL) { |
781 | agp_fe.backend_acquired = FALSE; | 781 | agp_fe.backend_acquired = false; |
782 | agp_backend_release(agp_bridge); | 782 | agp_backend_release(agp_bridge); |
783 | return -ENOMEM; | 783 | return -ENOMEM; |
784 | } | 784 | } |
@@ -981,7 +981,7 @@ static long agp_ioctl(struct file *file, | |||
981 | ret_val = -EINVAL; | 981 | ret_val = -EINVAL; |
982 | goto ioctl_out; | 982 | goto ioctl_out; |
983 | } | 983 | } |
984 | if ((agp_fe.backend_acquired != TRUE) && | 984 | if ((agp_fe.backend_acquired != true) && |
985 | (cmd != AGPIOC_ACQUIRE)) { | 985 | (cmd != AGPIOC_ACQUIRE)) { |
986 | ret_val = -EBUSY; | 986 | ret_val = -EBUSY; |
987 | goto ioctl_out; | 987 | goto ioctl_out; |
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 7fc0c99a3a58..564daaa6c7d0 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c | |||
@@ -96,13 +96,13 @@ EXPORT_SYMBOL(agp_flush_chipset); | |||
96 | void agp_alloc_page_array(size_t size, struct agp_memory *mem) | 96 | void agp_alloc_page_array(size_t size, struct agp_memory *mem) |
97 | { | 97 | { |
98 | mem->memory = NULL; | 98 | mem->memory = NULL; |
99 | mem->vmalloc_flag = 0; | 99 | mem->vmalloc_flag = false; |
100 | 100 | ||
101 | if (size <= 2*PAGE_SIZE) | 101 | if (size <= 2*PAGE_SIZE) |
102 | mem->memory = kmalloc(size, GFP_KERNEL | __GFP_NORETRY); | 102 | mem->memory = kmalloc(size, GFP_KERNEL | __GFP_NORETRY); |
103 | if (mem->memory == NULL) { | 103 | if (mem->memory == NULL) { |
104 | mem->memory = vmalloc(size); | 104 | mem->memory = vmalloc(size); |
105 | mem->vmalloc_flag = 1; | 105 | mem->vmalloc_flag = true; |
106 | } | 106 | } |
107 | } | 107 | } |
108 | EXPORT_SYMBOL(agp_alloc_page_array); | 108 | EXPORT_SYMBOL(agp_alloc_page_array); |
@@ -188,7 +188,7 @@ void agp_free_memory(struct agp_memory *curr) | |||
188 | if (curr == NULL) | 188 | if (curr == NULL) |
189 | return; | 189 | return; |
190 | 190 | ||
191 | if (curr->is_bound == TRUE) | 191 | if (curr->is_bound) |
192 | agp_unbind_memory(curr); | 192 | agp_unbind_memory(curr); |
193 | 193 | ||
194 | if (curr->type >= AGP_USER_TYPES) { | 194 | if (curr->type >= AGP_USER_TYPES) { |
@@ -202,10 +202,13 @@ void agp_free_memory(struct agp_memory *curr) | |||
202 | } | 202 | } |
203 | if (curr->page_count != 0) { | 203 | if (curr->page_count != 0) { |
204 | for (i = 0; i < curr->page_count; i++) { | 204 | for (i = 0; i < curr->page_count; i++) { |
205 | curr->bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[i]), AGP_PAGE_DESTROY_UNMAP); | 205 | curr->memory[i] = (unsigned long)gart_to_virt(curr->memory[i]); |
206 | curr->bridge->driver->agp_destroy_page((void *)curr->memory[i], | ||
207 | AGP_PAGE_DESTROY_UNMAP); | ||
206 | } | 208 | } |
207 | for (i = 0; i < curr->page_count; i++) { | 209 | for (i = 0; i < curr->page_count; i++) { |
208 | curr->bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[i]), AGP_PAGE_DESTROY_FREE); | 210 | curr->bridge->driver->agp_destroy_page((void *)curr->memory[i], |
211 | AGP_PAGE_DESTROY_FREE); | ||
209 | } | 212 | } |
210 | } | 213 | } |
211 | agp_free_key(curr->key); | 214 | agp_free_key(curr->key); |
@@ -411,20 +414,20 @@ int agp_bind_memory(struct agp_memory *curr, off_t pg_start) | |||
411 | if (curr == NULL) | 414 | if (curr == NULL) |
412 | return -EINVAL; | 415 | return -EINVAL; |
413 | 416 | ||
414 | if (curr->is_bound == TRUE) { | 417 | if (curr->is_bound) { |
415 | printk(KERN_INFO PFX "memory %p is already bound!\n", curr); | 418 | printk(KERN_INFO PFX "memory %p is already bound!\n", curr); |
416 | return -EINVAL; | 419 | return -EINVAL; |
417 | } | 420 | } |
418 | if (curr->is_flushed == FALSE) { | 421 | if (!curr->is_flushed) { |
419 | curr->bridge->driver->cache_flush(); | 422 | curr->bridge->driver->cache_flush(); |
420 | curr->is_flushed = TRUE; | 423 | curr->is_flushed = true; |
421 | } | 424 | } |
422 | ret_val = curr->bridge->driver->insert_memory(curr, pg_start, curr->type); | 425 | ret_val = curr->bridge->driver->insert_memory(curr, pg_start, curr->type); |
423 | 426 | ||
424 | if (ret_val != 0) | 427 | if (ret_val != 0) |
425 | return ret_val; | 428 | return ret_val; |
426 | 429 | ||
427 | curr->is_bound = TRUE; | 430 | curr->is_bound = true; |
428 | curr->pg_start = pg_start; | 431 | curr->pg_start = pg_start; |
429 | return 0; | 432 | return 0; |
430 | } | 433 | } |
@@ -446,7 +449,7 @@ int agp_unbind_memory(struct agp_memory *curr) | |||
446 | if (curr == NULL) | 449 | if (curr == NULL) |
447 | return -EINVAL; | 450 | return -EINVAL; |
448 | 451 | ||
449 | if (curr->is_bound != TRUE) { | 452 | if (!curr->is_bound) { |
450 | printk(KERN_INFO PFX "memory %p was not bound!\n", curr); | 453 | printk(KERN_INFO PFX "memory %p was not bound!\n", curr); |
451 | return -EINVAL; | 454 | return -EINVAL; |
452 | } | 455 | } |
@@ -456,7 +459,7 @@ int agp_unbind_memory(struct agp_memory *curr) | |||
456 | if (ret_val != 0) | 459 | if (ret_val != 0) |
457 | return ret_val; | 460 | return ret_val; |
458 | 461 | ||
459 | curr->is_bound = FALSE; | 462 | curr->is_bound = false; |
460 | curr->pg_start = 0; | 463 | curr->pg_start = 0; |
461 | return 0; | 464 | return 0; |
462 | } | 465 | } |
@@ -754,7 +757,7 @@ u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode | |||
754 | EXPORT_SYMBOL(agp_collect_device_status); | 757 | EXPORT_SYMBOL(agp_collect_device_status); |
755 | 758 | ||
756 | 759 | ||
757 | void agp_device_command(u32 bridge_agpstat, int agp_v3) | 760 | void agp_device_command(u32 bridge_agpstat, bool agp_v3) |
758 | { | 761 | { |
759 | struct pci_dev *device = NULL; | 762 | struct pci_dev *device = NULL; |
760 | int mode; | 763 | int mode; |
@@ -818,7 +821,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode) | |||
818 | /* If we have 3.5, we can do the isoch stuff. */ | 821 | /* If we have 3.5, we can do the isoch stuff. */ |
819 | if (bridge->minor_version >= 5) | 822 | if (bridge->minor_version >= 5) |
820 | agp_3_5_enable(bridge); | 823 | agp_3_5_enable(bridge); |
821 | agp_device_command(bridge_agpstat, TRUE); | 824 | agp_device_command(bridge_agpstat, true); |
822 | return; | 825 | return; |
823 | } else { | 826 | } else { |
824 | /* Disable calibration cycle in RX91<1> when not in AGP3.0 mode of operation.*/ | 827 | /* Disable calibration cycle in RX91<1> when not in AGP3.0 mode of operation.*/ |
@@ -835,7 +838,7 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode) | |||
835 | } | 838 | } |
836 | 839 | ||
837 | /* AGP v<3 */ | 840 | /* AGP v<3 */ |
838 | agp_device_command(bridge_agpstat, FALSE); | 841 | agp_device_command(bridge_agpstat, false); |
839 | } | 842 | } |
840 | EXPORT_SYMBOL(agp_generic_enable); | 843 | EXPORT_SYMBOL(agp_generic_enable); |
841 | 844 | ||
@@ -1083,9 +1086,9 @@ int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type) | |||
1083 | j++; | 1086 | j++; |
1084 | } | 1087 | } |
1085 | 1088 | ||
1086 | if (mem->is_flushed == FALSE) { | 1089 | if (!mem->is_flushed) { |
1087 | bridge->driver->cache_flush(); | 1090 | bridge->driver->cache_flush(); |
1088 | mem->is_flushed = TRUE; | 1091 | mem->is_flushed = true; |
1089 | } | 1092 | } |
1090 | 1093 | ||
1091 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 1094 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index cbb0444467ba..80d7317f85c9 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c | |||
@@ -353,9 +353,9 @@ hp_zx1_insert_memory (struct agp_memory *mem, off_t pg_start, int type) | |||
353 | j++; | 353 | j++; |
354 | } | 354 | } |
355 | 355 | ||
356 | if (mem->is_flushed == FALSE) { | 356 | if (!mem->is_flushed) { |
357 | global_cache_flush(); | 357 | global_cache_flush(); |
358 | mem->is_flushed = TRUE; | 358 | mem->is_flushed = true; |
359 | } | 359 | } |
360 | 360 | ||
361 | for (i = 0, j = io_pg_start; i < mem->page_count; i++) { | 361 | for (i = 0, j = io_pg_start; i < mem->page_count; i++) { |
@@ -437,7 +437,7 @@ const struct agp_bridge_driver hp_zx1_driver = { | |||
437 | .agp_alloc_page = agp_generic_alloc_page, | 437 | .agp_alloc_page = agp_generic_alloc_page, |
438 | .agp_destroy_page = agp_generic_destroy_page, | 438 | .agp_destroy_page = agp_generic_destroy_page, |
439 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | 439 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, |
440 | .cant_use_aperture = 1, | 440 | .cant_use_aperture = true, |
441 | }; | 441 | }; |
442 | 442 | ||
443 | static int __init | 443 | static int __init |
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c index 76f581c85a7d..e587eebebc67 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/char/agp/i460-agp.c | |||
@@ -580,7 +580,7 @@ const struct agp_bridge_driver intel_i460_driver = { | |||
580 | .alloc_by_type = agp_generic_alloc_by_type, | 580 | .alloc_by_type = agp_generic_alloc_by_type, |
581 | .free_by_type = agp_generic_free_by_type, | 581 | .free_by_type = agp_generic_free_by_type, |
582 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | 582 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, |
583 | .cant_use_aperture = 1, | 583 | .cant_use_aperture = true, |
584 | }; | 584 | }; |
585 | 585 | ||
586 | static int __devinit agp_intel_i460_probe(struct pci_dev *pdev, | 586 | static int __devinit agp_intel_i460_probe(struct pci_dev *pdev, |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index eeea50a1d22a..1ae64bb36771 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -34,6 +34,12 @@ | |||
34 | #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 | 34 | #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 |
35 | #define PCI_DEVICE_ID_INTEL_IGD_HB 0x2A40 | 35 | #define PCI_DEVICE_ID_INTEL_IGD_HB 0x2A40 |
36 | #define PCI_DEVICE_ID_INTEL_IGD_IG 0x2A42 | 36 | #define PCI_DEVICE_ID_INTEL_IGD_IG 0x2A42 |
37 | #define PCI_DEVICE_ID_INTEL_IGD_E_HB 0x2E00 | ||
38 | #define PCI_DEVICE_ID_INTEL_IGD_E_IG 0x2E02 | ||
39 | #define PCI_DEVICE_ID_INTEL_Q45_HB 0x2E10 | ||
40 | #define PCI_DEVICE_ID_INTEL_Q45_IG 0x2E12 | ||
41 | #define PCI_DEVICE_ID_INTEL_G45_HB 0x2E20 | ||
42 | #define PCI_DEVICE_ID_INTEL_G45_IG 0x2E22 | ||
37 | 43 | ||
38 | /* cover 915 and 945 variants */ | 44 | /* cover 915 and 945 variants */ |
39 | #define IS_I915 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_E7221_HB || \ | 45 | #define IS_I915 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_E7221_HB || \ |
@@ -55,6 +61,10 @@ | |||
55 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q35_HB || \ | 61 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q35_HB || \ |
56 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q33_HB) | 62 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q33_HB) |
57 | 63 | ||
64 | #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGD_E_HB || \ | ||
65 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \ | ||
66 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB) | ||
67 | |||
58 | extern int agp_memory_reserved; | 68 | extern int agp_memory_reserved; |
59 | 69 | ||
60 | 70 | ||
@@ -80,8 +90,13 @@ extern int agp_memory_reserved; | |||
80 | #define I915_PTEADDR 0x1C | 90 | #define I915_PTEADDR 0x1C |
81 | #define I915_GMCH_GMS_STOLEN_48M (0x6 << 4) | 91 | #define I915_GMCH_GMS_STOLEN_48M (0x6 << 4) |
82 | #define I915_GMCH_GMS_STOLEN_64M (0x7 << 4) | 92 | #define I915_GMCH_GMS_STOLEN_64M (0x7 << 4) |
83 | #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4) | 93 | #define G33_GMCH_GMS_STOLEN_128M (0x8 << 4) |
84 | #define G33_GMCH_GMS_STOLEN_256M (0x9 << 4) | 94 | #define G33_GMCH_GMS_STOLEN_256M (0x9 << 4) |
95 | #define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4) | ||
96 | #define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4) | ||
97 | #define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4) | ||
98 | #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) | ||
99 | |||
85 | #define I915_IFPADDR 0x60 | 100 | #define I915_IFPADDR 0x60 |
86 | 101 | ||
87 | /* Intel 965G registers */ | 102 | /* Intel 965G registers */ |
@@ -325,7 +340,7 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start, | |||
325 | out: | 340 | out: |
326 | ret = 0; | 341 | ret = 0; |
327 | out_err: | 342 | out_err: |
328 | mem->is_flushed = 1; | 343 | mem->is_flushed = true; |
329 | return ret; | 344 | return ret; |
330 | } | 345 | } |
331 | 346 | ||
@@ -418,9 +433,11 @@ static void intel_i810_free_by_type(struct agp_memory *curr) | |||
418 | if (curr->page_count == 4) | 433 | if (curr->page_count == 4) |
419 | i8xx_destroy_pages(gart_to_virt(curr->memory[0])); | 434 | i8xx_destroy_pages(gart_to_virt(curr->memory[0])); |
420 | else { | 435 | else { |
421 | agp_bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[0]), | 436 | void *va = gart_to_virt(curr->memory[0]); |
437 | |||
438 | agp_bridge->driver->agp_destroy_page(va, | ||
422 | AGP_PAGE_DESTROY_UNMAP); | 439 | AGP_PAGE_DESTROY_UNMAP); |
423 | agp_bridge->driver->agp_destroy_page(gart_to_virt(curr->memory[0]), | 440 | agp_bridge->driver->agp_destroy_page(va, |
424 | AGP_PAGE_DESTROY_FREE); | 441 | AGP_PAGE_DESTROY_FREE); |
425 | } | 442 | } |
426 | agp_free_page_array(curr); | 443 | agp_free_page_array(curr); |
@@ -504,6 +521,10 @@ static void intel_i830_init_gtt_entries(void) | |||
504 | size = 512; | 521 | size = 512; |
505 | } | 522 | } |
506 | size += 4; | 523 | size += 4; |
524 | } else if (IS_G4X) { | ||
525 | /* On 4 series hardware, GTT stolen is separate from graphics | ||
526 | * stolen, ignore it in stolen gtt entries counting */ | ||
527 | size = 0; | ||
507 | } else { | 528 | } else { |
508 | /* On previous hardware, the GTT size was just what was | 529 | /* On previous hardware, the GTT size was just what was |
509 | * required to map the aperture. | 530 | * required to map the aperture. |
@@ -552,30 +573,54 @@ static void intel_i830_init_gtt_entries(void) | |||
552 | break; | 573 | break; |
553 | case I915_GMCH_GMS_STOLEN_48M: | 574 | case I915_GMCH_GMS_STOLEN_48M: |
554 | /* Check it's really I915G */ | 575 | /* Check it's really I915G */ |
555 | if (IS_I915 || IS_I965 || IS_G33) | 576 | if (IS_I915 || IS_I965 || IS_G33 || IS_G4X) |
556 | gtt_entries = MB(48) - KB(size); | 577 | gtt_entries = MB(48) - KB(size); |
557 | else | 578 | else |
558 | gtt_entries = 0; | 579 | gtt_entries = 0; |
559 | break; | 580 | break; |
560 | case I915_GMCH_GMS_STOLEN_64M: | 581 | case I915_GMCH_GMS_STOLEN_64M: |
561 | /* Check it's really I915G */ | 582 | /* Check it's really I915G */ |
562 | if (IS_I915 || IS_I965 || IS_G33) | 583 | if (IS_I915 || IS_I965 || IS_G33 || IS_G4X) |
563 | gtt_entries = MB(64) - KB(size); | 584 | gtt_entries = MB(64) - KB(size); |
564 | else | 585 | else |
565 | gtt_entries = 0; | 586 | gtt_entries = 0; |
566 | break; | 587 | break; |
567 | case G33_GMCH_GMS_STOLEN_128M: | 588 | case G33_GMCH_GMS_STOLEN_128M: |
568 | if (IS_G33) | 589 | if (IS_G33 || IS_I965 || IS_G4X) |
569 | gtt_entries = MB(128) - KB(size); | 590 | gtt_entries = MB(128) - KB(size); |
570 | else | 591 | else |
571 | gtt_entries = 0; | 592 | gtt_entries = 0; |
572 | break; | 593 | break; |
573 | case G33_GMCH_GMS_STOLEN_256M: | 594 | case G33_GMCH_GMS_STOLEN_256M: |
574 | if (IS_G33) | 595 | if (IS_G33 || IS_I965 || IS_G4X) |
575 | gtt_entries = MB(256) - KB(size); | 596 | gtt_entries = MB(256) - KB(size); |
576 | else | 597 | else |
577 | gtt_entries = 0; | 598 | gtt_entries = 0; |
578 | break; | 599 | break; |
600 | case INTEL_GMCH_GMS_STOLEN_96M: | ||
601 | if (IS_I965 || IS_G4X) | ||
602 | gtt_entries = MB(96) - KB(size); | ||
603 | else | ||
604 | gtt_entries = 0; | ||
605 | break; | ||
606 | case INTEL_GMCH_GMS_STOLEN_160M: | ||
607 | if (IS_I965 || IS_G4X) | ||
608 | gtt_entries = MB(160) - KB(size); | ||
609 | else | ||
610 | gtt_entries = 0; | ||
611 | break; | ||
612 | case INTEL_GMCH_GMS_STOLEN_224M: | ||
613 | if (IS_I965 || IS_G4X) | ||
614 | gtt_entries = MB(224) - KB(size); | ||
615 | else | ||
616 | gtt_entries = 0; | ||
617 | break; | ||
618 | case INTEL_GMCH_GMS_STOLEN_352M: | ||
619 | if (IS_I965 || IS_G4X) | ||
620 | gtt_entries = MB(352) - KB(size); | ||
621 | else | ||
622 | gtt_entries = 0; | ||
623 | break; | ||
579 | default: | 624 | default: |
580 | gtt_entries = 0; | 625 | gtt_entries = 0; |
581 | break; | 626 | break; |
@@ -793,7 +838,7 @@ static int intel_i830_insert_entries(struct agp_memory *mem, off_t pg_start, | |||
793 | out: | 838 | out: |
794 | ret = 0; | 839 | ret = 0; |
795 | out_err: | 840 | out_err: |
796 | mem->is_flushed = 1; | 841 | mem->is_flushed = true; |
797 | return ret; | 842 | return ret; |
798 | } | 843 | } |
799 | 844 | ||
@@ -1020,7 +1065,7 @@ static int intel_i915_insert_entries(struct agp_memory *mem, off_t pg_start, | |||
1020 | out: | 1065 | out: |
1021 | ret = 0; | 1066 | ret = 0; |
1022 | out_err: | 1067 | out_err: |
1023 | mem->is_flushed = 1; | 1068 | mem->is_flushed = true; |
1024 | return ret; | 1069 | return ret; |
1025 | } | 1070 | } |
1026 | 1071 | ||
@@ -1134,53 +1179,64 @@ static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge, | |||
1134 | return addr | bridge->driver->masks[type].mask; | 1179 | return addr | bridge->driver->masks[type].mask; |
1135 | } | 1180 | } |
1136 | 1181 | ||
1182 | static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) | ||
1183 | { | ||
1184 | switch (agp_bridge->dev->device) { | ||
1185 | case PCI_DEVICE_ID_INTEL_IGD_HB: | ||
1186 | case PCI_DEVICE_ID_INTEL_IGD_E_HB: | ||
1187 | case PCI_DEVICE_ID_INTEL_Q45_HB: | ||
1188 | case PCI_DEVICE_ID_INTEL_G45_HB: | ||
1189 | *gtt_offset = *gtt_size = MB(2); | ||
1190 | break; | ||
1191 | default: | ||
1192 | *gtt_offset = *gtt_size = KB(512); | ||
1193 | } | ||
1194 | } | ||
1195 | |||
1137 | /* The intel i965 automatically initializes the agp aperture during POST. | 1196 | /* The intel i965 automatically initializes the agp aperture during POST. |
1138 | * Use the memory already set aside for in the GTT. | 1197 | * Use the memory already set aside for in the GTT. |
1139 | */ | 1198 | */ |
1140 | static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge) | 1199 | static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge) |
1141 | { | 1200 | { |
1142 | int page_order; | 1201 | int page_order; |
1143 | struct aper_size_info_fixed *size; | 1202 | struct aper_size_info_fixed *size; |
1144 | int num_entries; | 1203 | int num_entries; |
1145 | u32 temp; | 1204 | u32 temp; |
1146 | int gtt_offset, gtt_size; | 1205 | int gtt_offset, gtt_size; |
1147 | 1206 | ||
1148 | size = agp_bridge->current_size; | 1207 | size = agp_bridge->current_size; |
1149 | page_order = size->page_order; | 1208 | page_order = size->page_order; |
1150 | num_entries = size->num_entries; | 1209 | num_entries = size->num_entries; |
1151 | agp_bridge->gatt_table_real = NULL; | 1210 | agp_bridge->gatt_table_real = NULL; |
1152 | 1211 | ||
1153 | pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); | 1212 | pci_read_config_dword(intel_private.pcidev, I915_MMADDR, &temp); |
1154 | 1213 | ||
1155 | temp &= 0xfff00000; | 1214 | temp &= 0xfff00000; |
1156 | 1215 | ||
1157 | if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGD_HB) | 1216 | intel_i965_get_gtt_range(>t_offset, >t_size); |
1158 | gtt_offset = gtt_size = MB(2); | ||
1159 | else | ||
1160 | gtt_offset = gtt_size = KB(512); | ||
1161 | 1217 | ||
1162 | intel_private.gtt = ioremap((temp + gtt_offset) , gtt_size); | 1218 | intel_private.gtt = ioremap((temp + gtt_offset) , gtt_size); |
1163 | 1219 | ||
1164 | if (!intel_private.gtt) | 1220 | if (!intel_private.gtt) |
1165 | return -ENOMEM; | 1221 | return -ENOMEM; |
1166 | 1222 | ||
1167 | intel_private.registers = ioremap(temp, 128 * 4096); | 1223 | intel_private.registers = ioremap(temp, 128 * 4096); |
1168 | if (!intel_private.registers) { | 1224 | if (!intel_private.registers) { |
1169 | iounmap(intel_private.gtt); | 1225 | iounmap(intel_private.gtt); |
1170 | return -ENOMEM; | 1226 | return -ENOMEM; |
1171 | } | 1227 | } |
1172 | 1228 | ||
1173 | temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000; | 1229 | temp = readl(intel_private.registers+I810_PGETBL_CTL) & 0xfffff000; |
1174 | global_cache_flush(); /* FIXME: ? */ | 1230 | global_cache_flush(); /* FIXME: ? */ |
1175 | 1231 | ||
1176 | /* we have to call this as early as possible after the MMIO base address is known */ | 1232 | /* we have to call this as early as possible after the MMIO base address is known */ |
1177 | intel_i830_init_gtt_entries(); | 1233 | intel_i830_init_gtt_entries(); |
1178 | 1234 | ||
1179 | agp_bridge->gatt_table = NULL; | 1235 | agp_bridge->gatt_table = NULL; |
1180 | 1236 | ||
1181 | agp_bridge->gatt_bus_addr = temp; | 1237 | agp_bridge->gatt_bus_addr = temp; |
1182 | 1238 | ||
1183 | return 0; | 1239 | return 0; |
1184 | } | 1240 | } |
1185 | 1241 | ||
1186 | 1242 | ||
@@ -1656,7 +1712,7 @@ static const struct agp_bridge_driver intel_810_driver = { | |||
1656 | .aperture_sizes = intel_i810_sizes, | 1712 | .aperture_sizes = intel_i810_sizes, |
1657 | .size_type = FIXED_APER_SIZE, | 1713 | .size_type = FIXED_APER_SIZE, |
1658 | .num_aperture_sizes = 2, | 1714 | .num_aperture_sizes = 2, |
1659 | .needs_scratch_page = TRUE, | 1715 | .needs_scratch_page = true, |
1660 | .configure = intel_i810_configure, | 1716 | .configure = intel_i810_configure, |
1661 | .fetch_size = intel_i810_fetch_size, | 1717 | .fetch_size = intel_i810_fetch_size, |
1662 | .cleanup = intel_i810_cleanup, | 1718 | .cleanup = intel_i810_cleanup, |
@@ -1697,7 +1753,7 @@ static const struct agp_bridge_driver intel_815_driver = { | |||
1697 | .free_by_type = agp_generic_free_by_type, | 1753 | .free_by_type = agp_generic_free_by_type, |
1698 | .agp_alloc_page = agp_generic_alloc_page, | 1754 | .agp_alloc_page = agp_generic_alloc_page, |
1699 | .agp_destroy_page = agp_generic_destroy_page, | 1755 | .agp_destroy_page = agp_generic_destroy_page, |
1700 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | 1756 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, |
1701 | }; | 1757 | }; |
1702 | 1758 | ||
1703 | static const struct agp_bridge_driver intel_830_driver = { | 1759 | static const struct agp_bridge_driver intel_830_driver = { |
@@ -1705,7 +1761,7 @@ static const struct agp_bridge_driver intel_830_driver = { | |||
1705 | .aperture_sizes = intel_i830_sizes, | 1761 | .aperture_sizes = intel_i830_sizes, |
1706 | .size_type = FIXED_APER_SIZE, | 1762 | .size_type = FIXED_APER_SIZE, |
1707 | .num_aperture_sizes = 4, | 1763 | .num_aperture_sizes = 4, |
1708 | .needs_scratch_page = TRUE, | 1764 | .needs_scratch_page = true, |
1709 | .configure = intel_i830_configure, | 1765 | .configure = intel_i830_configure, |
1710 | .fetch_size = intel_i830_fetch_size, | 1766 | .fetch_size = intel_i830_fetch_size, |
1711 | .cleanup = intel_i830_cleanup, | 1767 | .cleanup = intel_i830_cleanup, |
@@ -1876,7 +1932,7 @@ static const struct agp_bridge_driver intel_915_driver = { | |||
1876 | .aperture_sizes = intel_i830_sizes, | 1932 | .aperture_sizes = intel_i830_sizes, |
1877 | .size_type = FIXED_APER_SIZE, | 1933 | .size_type = FIXED_APER_SIZE, |
1878 | .num_aperture_sizes = 4, | 1934 | .num_aperture_sizes = 4, |
1879 | .needs_scratch_page = TRUE, | 1935 | .needs_scratch_page = true, |
1880 | .configure = intel_i915_configure, | 1936 | .configure = intel_i915_configure, |
1881 | .fetch_size = intel_i9xx_fetch_size, | 1937 | .fetch_size = intel_i9xx_fetch_size, |
1882 | .cleanup = intel_i915_cleanup, | 1938 | .cleanup = intel_i915_cleanup, |
@@ -1898,28 +1954,28 @@ static const struct agp_bridge_driver intel_915_driver = { | |||
1898 | }; | 1954 | }; |
1899 | 1955 | ||
1900 | static const struct agp_bridge_driver intel_i965_driver = { | 1956 | static const struct agp_bridge_driver intel_i965_driver = { |
1901 | .owner = THIS_MODULE, | 1957 | .owner = THIS_MODULE, |
1902 | .aperture_sizes = intel_i830_sizes, | 1958 | .aperture_sizes = intel_i830_sizes, |
1903 | .size_type = FIXED_APER_SIZE, | 1959 | .size_type = FIXED_APER_SIZE, |
1904 | .num_aperture_sizes = 4, | 1960 | .num_aperture_sizes = 4, |
1905 | .needs_scratch_page = TRUE, | 1961 | .needs_scratch_page = true, |
1906 | .configure = intel_i915_configure, | 1962 | .configure = intel_i915_configure, |
1907 | .fetch_size = intel_i9xx_fetch_size, | 1963 | .fetch_size = intel_i9xx_fetch_size, |
1908 | .cleanup = intel_i915_cleanup, | 1964 | .cleanup = intel_i915_cleanup, |
1909 | .tlb_flush = intel_i810_tlbflush, | 1965 | .tlb_flush = intel_i810_tlbflush, |
1910 | .mask_memory = intel_i965_mask_memory, | 1966 | .mask_memory = intel_i965_mask_memory, |
1911 | .masks = intel_i810_masks, | 1967 | .masks = intel_i810_masks, |
1912 | .agp_enable = intel_i810_agp_enable, | 1968 | .agp_enable = intel_i810_agp_enable, |
1913 | .cache_flush = global_cache_flush, | 1969 | .cache_flush = global_cache_flush, |
1914 | .create_gatt_table = intel_i965_create_gatt_table, | 1970 | .create_gatt_table = intel_i965_create_gatt_table, |
1915 | .free_gatt_table = intel_i830_free_gatt_table, | 1971 | .free_gatt_table = intel_i830_free_gatt_table, |
1916 | .insert_memory = intel_i915_insert_entries, | 1972 | .insert_memory = intel_i915_insert_entries, |
1917 | .remove_memory = intel_i915_remove_entries, | 1973 | .remove_memory = intel_i915_remove_entries, |
1918 | .alloc_by_type = intel_i830_alloc_by_type, | 1974 | .alloc_by_type = intel_i830_alloc_by_type, |
1919 | .free_by_type = intel_i810_free_by_type, | 1975 | .free_by_type = intel_i810_free_by_type, |
1920 | .agp_alloc_page = agp_generic_alloc_page, | 1976 | .agp_alloc_page = agp_generic_alloc_page, |
1921 | .agp_destroy_page = agp_generic_destroy_page, | 1977 | .agp_destroy_page = agp_generic_destroy_page, |
1922 | .agp_type_to_mask_type = intel_i830_type_to_mask_type, | 1978 | .agp_type_to_mask_type = intel_i830_type_to_mask_type, |
1923 | .chipset_flush = intel_i915_chipset_flush, | 1979 | .chipset_flush = intel_i915_chipset_flush, |
1924 | }; | 1980 | }; |
1925 | 1981 | ||
@@ -1948,28 +2004,28 @@ static const struct agp_bridge_driver intel_7505_driver = { | |||
1948 | }; | 2004 | }; |
1949 | 2005 | ||
1950 | static const struct agp_bridge_driver intel_g33_driver = { | 2006 | static const struct agp_bridge_driver intel_g33_driver = { |
1951 | .owner = THIS_MODULE, | 2007 | .owner = THIS_MODULE, |
1952 | .aperture_sizes = intel_i830_sizes, | 2008 | .aperture_sizes = intel_i830_sizes, |
1953 | .size_type = FIXED_APER_SIZE, | 2009 | .size_type = FIXED_APER_SIZE, |
1954 | .num_aperture_sizes = 4, | 2010 | .num_aperture_sizes = 4, |
1955 | .needs_scratch_page = TRUE, | 2011 | .needs_scratch_page = true, |
1956 | .configure = intel_i915_configure, | 2012 | .configure = intel_i915_configure, |
1957 | .fetch_size = intel_i9xx_fetch_size, | 2013 | .fetch_size = intel_i9xx_fetch_size, |
1958 | .cleanup = intel_i915_cleanup, | 2014 | .cleanup = intel_i915_cleanup, |
1959 | .tlb_flush = intel_i810_tlbflush, | 2015 | .tlb_flush = intel_i810_tlbflush, |
1960 | .mask_memory = intel_i965_mask_memory, | 2016 | .mask_memory = intel_i965_mask_memory, |
1961 | .masks = intel_i810_masks, | 2017 | .masks = intel_i810_masks, |
1962 | .agp_enable = intel_i810_agp_enable, | 2018 | .agp_enable = intel_i810_agp_enable, |
1963 | .cache_flush = global_cache_flush, | 2019 | .cache_flush = global_cache_flush, |
1964 | .create_gatt_table = intel_i915_create_gatt_table, | 2020 | .create_gatt_table = intel_i915_create_gatt_table, |
1965 | .free_gatt_table = intel_i830_free_gatt_table, | 2021 | .free_gatt_table = intel_i830_free_gatt_table, |
1966 | .insert_memory = intel_i915_insert_entries, | 2022 | .insert_memory = intel_i915_insert_entries, |
1967 | .remove_memory = intel_i915_remove_entries, | 2023 | .remove_memory = intel_i915_remove_entries, |
1968 | .alloc_by_type = intel_i830_alloc_by_type, | 2024 | .alloc_by_type = intel_i830_alloc_by_type, |
1969 | .free_by_type = intel_i810_free_by_type, | 2025 | .free_by_type = intel_i810_free_by_type, |
1970 | .agp_alloc_page = agp_generic_alloc_page, | 2026 | .agp_alloc_page = agp_generic_alloc_page, |
1971 | .agp_destroy_page = agp_generic_destroy_page, | 2027 | .agp_destroy_page = agp_generic_destroy_page, |
1972 | .agp_type_to_mask_type = intel_i830_type_to_mask_type, | 2028 | .agp_type_to_mask_type = intel_i830_type_to_mask_type, |
1973 | .chipset_flush = intel_i915_chipset_flush, | 2029 | .chipset_flush = intel_i915_chipset_flush, |
1974 | }; | 2030 | }; |
1975 | 2031 | ||
@@ -2063,6 +2119,12 @@ static const struct intel_driver_description { | |||
2063 | NULL, &intel_g33_driver }, | 2119 | NULL, &intel_g33_driver }, |
2064 | { PCI_DEVICE_ID_INTEL_IGD_HB, PCI_DEVICE_ID_INTEL_IGD_IG, 0, | 2120 | { PCI_DEVICE_ID_INTEL_IGD_HB, PCI_DEVICE_ID_INTEL_IGD_IG, 0, |
2065 | "Intel Integrated Graphics Device", NULL, &intel_i965_driver }, | 2121 | "Intel Integrated Graphics Device", NULL, &intel_i965_driver }, |
2122 | { PCI_DEVICE_ID_INTEL_IGD_E_HB, PCI_DEVICE_ID_INTEL_IGD_E_IG, 0, | ||
2123 | "Intel Integrated Graphics Device", NULL, &intel_i965_driver }, | ||
2124 | { PCI_DEVICE_ID_INTEL_Q45_HB, PCI_DEVICE_ID_INTEL_Q45_IG, 0, | ||
2125 | "Q45/Q43", NULL, &intel_i965_driver }, | ||
2126 | { PCI_DEVICE_ID_INTEL_G45_HB, PCI_DEVICE_ID_INTEL_G45_IG, 0, | ||
2127 | "G45/G43", NULL, &intel_i965_driver }, | ||
2066 | { 0, 0, 0, NULL, NULL, NULL } | 2128 | { 0, 0, 0, NULL, NULL, NULL } |
2067 | }; | 2129 | }; |
2068 | 2130 | ||
@@ -2254,6 +2316,9 @@ static struct pci_device_id agp_intel_pci_table[] = { | |||
2254 | ID(PCI_DEVICE_ID_INTEL_Q35_HB), | 2316 | ID(PCI_DEVICE_ID_INTEL_Q35_HB), |
2255 | ID(PCI_DEVICE_ID_INTEL_Q33_HB), | 2317 | ID(PCI_DEVICE_ID_INTEL_Q33_HB), |
2256 | ID(PCI_DEVICE_ID_INTEL_IGD_HB), | 2318 | ID(PCI_DEVICE_ID_INTEL_IGD_HB), |
2319 | ID(PCI_DEVICE_ID_INTEL_IGD_E_HB), | ||
2320 | ID(PCI_DEVICE_ID_INTEL_Q45_HB), | ||
2321 | ID(PCI_DEVICE_ID_INTEL_G45_HB), | ||
2257 | { } | 2322 | { } |
2258 | }; | 2323 | }; |
2259 | 2324 | ||
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c index 225ed2a53d45..eaceb61ba2dc 100644 --- a/drivers/char/agp/nvidia-agp.c +++ b/drivers/char/agp/nvidia-agp.c | |||
@@ -214,9 +214,9 @@ static int nvidia_insert_memory(struct agp_memory *mem, off_t pg_start, int type | |||
214 | return -EBUSY; | 214 | return -EBUSY; |
215 | } | 215 | } |
216 | 216 | ||
217 | if (mem->is_flushed == FALSE) { | 217 | if (!mem->is_flushed) { |
218 | global_cache_flush(); | 218 | global_cache_flush(); |
219 | mem->is_flushed = TRUE; | 219 | mem->is_flushed = true; |
220 | } | 220 | } |
221 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 221 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
222 | writel(agp_bridge->driver->mask_memory(agp_bridge, | 222 | writel(agp_bridge->driver->mask_memory(agp_bridge, |
diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c index 2939e3570f9d..8c42dcc5958c 100644 --- a/drivers/char/agp/parisc-agp.c +++ b/drivers/char/agp/parisc-agp.c | |||
@@ -141,9 +141,9 @@ parisc_agp_insert_memory(struct agp_memory *mem, off_t pg_start, int type) | |||
141 | j++; | 141 | j++; |
142 | } | 142 | } |
143 | 143 | ||
144 | if (mem->is_flushed == FALSE) { | 144 | if (!mem->is_flushed) { |
145 | global_cache_flush(); | 145 | global_cache_flush(); |
146 | mem->is_flushed = TRUE; | 146 | mem->is_flushed = true; |
147 | } | 147 | } |
148 | 148 | ||
149 | for (i = 0, j = io_pg_start; i < mem->page_count; i++) { | 149 | for (i = 0, j = io_pg_start; i < mem->page_count; i++) { |
@@ -226,7 +226,7 @@ static const struct agp_bridge_driver parisc_agp_driver = { | |||
226 | .agp_alloc_page = agp_generic_alloc_page, | 226 | .agp_alloc_page = agp_generic_alloc_page, |
227 | .agp_destroy_page = agp_generic_destroy_page, | 227 | .agp_destroy_page = agp_generic_destroy_page, |
228 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | 228 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, |
229 | .cant_use_aperture = 1, | 229 | .cant_use_aperture = true, |
230 | }; | 230 | }; |
231 | 231 | ||
232 | static int __init | 232 | static int __init |
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c index 98cf8abb3e57..b972d83bb1b2 100644 --- a/drivers/char/agp/sgi-agp.c +++ b/drivers/char/agp/sgi-agp.c | |||
@@ -182,9 +182,9 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start, | |||
182 | j++; | 182 | j++; |
183 | } | 183 | } |
184 | 184 | ||
185 | if (mem->is_flushed == FALSE) { | 185 | if (!mem->is_flushed) { |
186 | bridge->driver->cache_flush(); | 186 | bridge->driver->cache_flush(); |
187 | mem->is_flushed = TRUE; | 187 | mem->is_flushed = true; |
188 | } | 188 | } |
189 | 189 | ||
190 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 190 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
@@ -264,8 +264,8 @@ const struct agp_bridge_driver sgi_tioca_driver = { | |||
264 | .agp_alloc_page = sgi_tioca_alloc_page, | 264 | .agp_alloc_page = sgi_tioca_alloc_page, |
265 | .agp_destroy_page = agp_generic_destroy_page, | 265 | .agp_destroy_page = agp_generic_destroy_page, |
266 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | 266 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, |
267 | .cant_use_aperture = 1, | 267 | .cant_use_aperture = true, |
268 | .needs_scratch_page = 0, | 268 | .needs_scratch_page = false, |
269 | .num_aperture_sizes = 1, | 269 | .num_aperture_sizes = 1, |
270 | }; | 270 | }; |
271 | 271 | ||
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c index e08934e58f32..0e054c134490 100644 --- a/drivers/char/agp/sworks-agp.c +++ b/drivers/char/agp/sworks-agp.c | |||
@@ -339,9 +339,9 @@ static int serverworks_insert_memory(struct agp_memory *mem, | |||
339 | j++; | 339 | j++; |
340 | } | 340 | } |
341 | 341 | ||
342 | if (mem->is_flushed == FALSE) { | 342 | if (!mem->is_flushed) { |
343 | global_cache_flush(); | 343 | global_cache_flush(); |
344 | mem->is_flushed = TRUE; | 344 | mem->is_flushed = true; |
345 | } | 345 | } |
346 | 346 | ||
347 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 347 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
@@ -412,7 +412,7 @@ static void serverworks_agp_enable(struct agp_bridge_data *bridge, u32 mode) | |||
412 | bridge->capndx + PCI_AGP_COMMAND, | 412 | bridge->capndx + PCI_AGP_COMMAND, |
413 | command); | 413 | command); |
414 | 414 | ||
415 | agp_device_command(command, 0); | 415 | agp_device_command(command, false); |
416 | } | 416 | } |
417 | 417 | ||
418 | static const struct agp_bridge_driver sworks_driver = { | 418 | static const struct agp_bridge_driver sworks_driver = { |
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 42c0a600b1ac..d2fa3cfca02a 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c | |||
@@ -281,10 +281,10 @@ static void uninorth_agp_enable(struct agp_bridge_data *bridge, u32 mode) | |||
281 | 281 | ||
282 | if (uninorth_rev >= 0x30) { | 282 | if (uninorth_rev >= 0x30) { |
283 | /* This is an AGP V3 */ | 283 | /* This is an AGP V3 */ |
284 | agp_device_command(command, (status & AGPSTAT_MODE_3_0)); | 284 | agp_device_command(command, (status & AGPSTAT_MODE_3_0) != 0); |
285 | } else { | 285 | } else { |
286 | /* AGP V2 */ | 286 | /* AGP V2 */ |
287 | agp_device_command(command, 0); | 287 | agp_device_command(command, false); |
288 | } | 288 | } |
289 | 289 | ||
290 | uninorth_tlbflush(NULL); | 290 | uninorth_tlbflush(NULL); |
@@ -511,7 +511,7 @@ const struct agp_bridge_driver uninorth_agp_driver = { | |||
511 | .agp_alloc_page = agp_generic_alloc_page, | 511 | .agp_alloc_page = agp_generic_alloc_page, |
512 | .agp_destroy_page = agp_generic_destroy_page, | 512 | .agp_destroy_page = agp_generic_destroy_page, |
513 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | 513 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, |
514 | .cant_use_aperture = 1, | 514 | .cant_use_aperture = true, |
515 | }; | 515 | }; |
516 | 516 | ||
517 | const struct agp_bridge_driver u3_agp_driver = { | 517 | const struct agp_bridge_driver u3_agp_driver = { |
@@ -536,8 +536,8 @@ const struct agp_bridge_driver u3_agp_driver = { | |||
536 | .agp_alloc_page = agp_generic_alloc_page, | 536 | .agp_alloc_page = agp_generic_alloc_page, |
537 | .agp_destroy_page = agp_generic_destroy_page, | 537 | .agp_destroy_page = agp_generic_destroy_page, |
538 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | 538 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, |
539 | .cant_use_aperture = 1, | 539 | .cant_use_aperture = true, |
540 | .needs_scratch_page = 1, | 540 | .needs_scratch_page = true, |
541 | }; | 541 | }; |
542 | 542 | ||
543 | static struct agp_device_ids uninorth_agp_device_ids[] __devinitdata = { | 543 | static struct agp_device_ids uninorth_agp_device_ids[] __devinitdata = { |
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c index 0ecc54d327bc..7b36476dff41 100644 --- a/drivers/char/agp/via-agp.c +++ b/drivers/char/agp/via-agp.c | |||
@@ -389,11 +389,20 @@ static struct agp_device_ids via_agp_device_ids[] __devinitdata = | |||
389 | .device_id = PCI_DEVICE_ID_VIA_VT3324, | 389 | .device_id = PCI_DEVICE_ID_VIA_VT3324, |
390 | .chipset_name = "CX700", | 390 | .chipset_name = "CX700", |
391 | }, | 391 | }, |
392 | /* VT3336 */ | 392 | /* VT3336 - this is a chipset for AMD Athlon/K8 CPU. Due to K8's unique |
393 | * architecture, the AGP resource and behavior are different from | ||
394 | * the traditional AGP which resides only in chipset. AGP is used | ||
395 | * by 3D driver which wasn't available for the VT3336 and VT3364 | ||
396 | * generation until now. Unfortunately, by testing, VT3364 works | ||
397 | * but VT3336 doesn't. - explaination from via, just leave this as | ||
398 | * as a placeholder to avoid future patches adding it back in. | ||
399 | */ | ||
400 | #if 0 | ||
393 | { | 401 | { |
394 | .device_id = PCI_DEVICE_ID_VIA_VT3336, | 402 | .device_id = PCI_DEVICE_ID_VIA_VT3336, |
395 | .chipset_name = "VT3336", | 403 | .chipset_name = "VT3336", |
396 | }, | 404 | }, |
405 | #endif | ||
397 | /* P4M890 */ | 406 | /* P4M890 */ |
398 | { | 407 | { |
399 | .device_id = PCI_DEVICE_ID_VIA_P4M890, | 408 | .device_id = PCI_DEVICE_ID_VIA_P4M890, |
@@ -546,8 +555,8 @@ static const struct pci_device_id agp_via_pci_table[] = { | |||
546 | ID(PCI_DEVICE_ID_VIA_3296_0), | 555 | ID(PCI_DEVICE_ID_VIA_3296_0), |
547 | ID(PCI_DEVICE_ID_VIA_P4M800CE), | 556 | ID(PCI_DEVICE_ID_VIA_P4M800CE), |
548 | ID(PCI_DEVICE_ID_VIA_VT3324), | 557 | ID(PCI_DEVICE_ID_VIA_VT3324), |
549 | ID(PCI_DEVICE_ID_VIA_VT3336), | ||
550 | ID(PCI_DEVICE_ID_VIA_P4M890), | 558 | ID(PCI_DEVICE_ID_VIA_P4M890), |
559 | ID(PCI_DEVICE_ID_VIA_VT3364), | ||
551 | { } | 560 | { } |
552 | }; | 561 | }; |
553 | 562 | ||
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index f806da184b51..caed42bf7ef5 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -423,7 +423,7 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file, | |||
423 | unsigned long flags; | 423 | unsigned long flags; |
424 | 424 | ||
425 | spin_lock_irqsave(&file->async_file->lock, flags); | 425 | spin_lock_irqsave(&file->async_file->lock, flags); |
426 | if (!file->async_file->is_closed) { | 426 | if (file->async_file->is_closed) { |
427 | spin_unlock_irqrestore(&file->async_file->lock, flags); | 427 | spin_unlock_irqrestore(&file->async_file->lock, flags); |
428 | return; | 428 | return; |
429 | } | 429 | } |
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 99b3c4ae86eb..d617da9bd351 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c | |||
@@ -2456,10 +2456,8 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, | |||
2456 | if ((page_count!=0)&&(page_count<<12)-(region->offset&(4096-1))>=region->length) | 2456 | if ((page_count!=0)&&(page_count<<12)-(region->offset&(4096-1))>=region->length) |
2457 | goto enough_pages; | 2457 | goto enough_pages; |
2458 | if ((page_count&0x01FF) == 0) { | 2458 | if ((page_count&0x01FF) == 0) { |
2459 | if (page_count>(1024*512)) { | 2459 | if (page_count >= 1024 * 512) { |
2460 | ib_umem_release(region); | 2460 | ib_umem_release(region); |
2461 | pci_free_consistent(nesdev->pcidev, 4096, vpbl.pbl_vbase, | ||
2462 | vpbl.pbl_pbase); | ||
2463 | nes_free_resource(nesadapter, | 2461 | nes_free_resource(nesadapter, |
2464 | nesadapter->allocated_mrs, stag_index); | 2462 | nesadapter->allocated_mrs, stag_index); |
2465 | kfree(nesmr); | 2463 | kfree(nesmr); |
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 3ad8bd9f7543..432699d61c58 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -15,7 +15,6 @@ if INPUT_MISC | |||
15 | config INPUT_PCSPKR | 15 | config INPUT_PCSPKR |
16 | tristate "PC Speaker support" | 16 | tristate "PC Speaker support" |
17 | depends on PCSPKR_PLATFORM | 17 | depends on PCSPKR_PLATFORM |
18 | depends on SND_PCSP=n | ||
19 | help | 18 | help |
20 | Say Y here if you want the standard PC Speaker to be used for | 19 | Say Y here if you want the standard PC Speaker to be used for |
21 | bells and whistles. | 20 | bells and whistles. |
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 8dd3942f3022..ce6fdec19e14 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c | |||
@@ -589,6 +589,21 @@ static void atp_close(struct input_dev *input) | |||
589 | dev->open = 0; | 589 | dev->open = 0; |
590 | } | 590 | } |
591 | 591 | ||
592 | static int atp_handle_geyser(struct atp *dev) | ||
593 | { | ||
594 | struct usb_device *udev = dev->udev; | ||
595 | |||
596 | if (!atp_is_fountain(dev)) { | ||
597 | /* switch to raw sensor mode */ | ||
598 | if (atp_geyser_init(udev)) | ||
599 | return -EIO; | ||
600 | |||
601 | printk(KERN_INFO "appletouch: Geyser mode initialized.\n"); | ||
602 | } | ||
603 | |||
604 | return 0; | ||
605 | } | ||
606 | |||
592 | static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id) | 607 | static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id) |
593 | { | 608 | { |
594 | struct atp *dev; | 609 | struct atp *dev; |
@@ -633,14 +648,6 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id | |||
633 | else | 648 | else |
634 | dev->datalen = 81; | 649 | dev->datalen = 81; |
635 | 650 | ||
636 | if (!atp_is_fountain(dev)) { | ||
637 | /* switch to raw sensor mode */ | ||
638 | if (atp_geyser_init(udev)) | ||
639 | goto err_free_devs; | ||
640 | |||
641 | printk(KERN_INFO "appletouch: Geyser mode initialized.\n"); | ||
642 | } | ||
643 | |||
644 | dev->urb = usb_alloc_urb(0, GFP_KERNEL); | 651 | dev->urb = usb_alloc_urb(0, GFP_KERNEL); |
645 | if (!dev->urb) | 652 | if (!dev->urb) |
646 | goto err_free_devs; | 653 | goto err_free_devs; |
@@ -654,6 +661,10 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id | |||
654 | usb_rcvintpipe(udev, int_in_endpointAddr), | 661 | usb_rcvintpipe(udev, int_in_endpointAddr), |
655 | dev->data, dev->datalen, atp_complete, dev, 1); | 662 | dev->data, dev->datalen, atp_complete, dev, 1); |
656 | 663 | ||
664 | error = atp_handle_geyser(dev); | ||
665 | if (error) | ||
666 | goto err_free_buffer; | ||
667 | |||
657 | usb_make_path(udev, dev->phys, sizeof(dev->phys)); | 668 | usb_make_path(udev, dev->phys, sizeof(dev->phys)); |
658 | strlcat(dev->phys, "/input0", sizeof(dev->phys)); | 669 | strlcat(dev->phys, "/input0", sizeof(dev->phys)); |
659 | 670 | ||
@@ -744,6 +755,20 @@ static void atp_disconnect(struct usb_interface *iface) | |||
744 | printk(KERN_INFO "input: appletouch disconnected\n"); | 755 | printk(KERN_INFO "input: appletouch disconnected\n"); |
745 | } | 756 | } |
746 | 757 | ||
758 | static int atp_recover(struct atp *dev) | ||
759 | { | ||
760 | int error; | ||
761 | |||
762 | error = atp_handle_geyser(dev); | ||
763 | if (error) | ||
764 | return error; | ||
765 | |||
766 | if (dev->open && usb_submit_urb(dev->urb, GFP_ATOMIC)) | ||
767 | return -EIO; | ||
768 | |||
769 | return 0; | ||
770 | } | ||
771 | |||
747 | static int atp_suspend(struct usb_interface *iface, pm_message_t message) | 772 | static int atp_suspend(struct usb_interface *iface, pm_message_t message) |
748 | { | 773 | { |
749 | struct atp *dev = usb_get_intfdata(iface); | 774 | struct atp *dev = usb_get_intfdata(iface); |
@@ -764,12 +789,20 @@ static int atp_resume(struct usb_interface *iface) | |||
764 | return 0; | 789 | return 0; |
765 | } | 790 | } |
766 | 791 | ||
792 | static int atp_reset_resume(struct usb_interface *iface) | ||
793 | { | ||
794 | struct atp *dev = usb_get_intfdata(iface); | ||
795 | |||
796 | return atp_recover(dev); | ||
797 | } | ||
798 | |||
767 | static struct usb_driver atp_driver = { | 799 | static struct usb_driver atp_driver = { |
768 | .name = "appletouch", | 800 | .name = "appletouch", |
769 | .probe = atp_probe, | 801 | .probe = atp_probe, |
770 | .disconnect = atp_disconnect, | 802 | .disconnect = atp_disconnect, |
771 | .suspend = atp_suspend, | 803 | .suspend = atp_suspend, |
772 | .resume = atp_resume, | 804 | .resume = atp_resume, |
805 | .reset_resume = atp_reset_resume, | ||
773 | .id_table = atp_table, | 806 | .id_table = atp_table, |
774 | }; | 807 | }; |
775 | 808 | ||
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 9aafa96cb746..78eb7841174c 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -193,6 +193,13 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { | |||
193 | }, | 193 | }, |
194 | }, | 194 | }, |
195 | { | 195 | { |
196 | .ident = "Fujitsu-Siemens Amilo Pro 2030", | ||
197 | .matches = { | ||
198 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | ||
199 | DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"), | ||
200 | }, | ||
201 | }, | ||
202 | { | ||
196 | /* | 203 | /* |
197 | * No data is coming from the touchscreen unless KBC | 204 | * No data is coming from the touchscreen unless KBC |
198 | * is in legacy mode. | 205 | * is in legacy mode. |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 592ff55b62d0..170f71ee5772 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -952,8 +952,12 @@ static int i8042_resume(struct platform_device *dev) | |||
952 | i8042_ctr |= I8042_CTR_AUXDIS | I8042_CTR_KBDDIS; | 952 | i8042_ctr |= I8042_CTR_AUXDIS | I8042_CTR_KBDDIS; |
953 | i8042_ctr &= ~(I8042_CTR_AUXINT | I8042_CTR_KBDINT); | 953 | i8042_ctr &= ~(I8042_CTR_AUXINT | I8042_CTR_KBDINT); |
954 | if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { | 954 | if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { |
955 | printk(KERN_ERR "i8042: Can't write CTR to resume\n"); | 955 | printk(KERN_WARNING "i8042: Can't write CTR to resume, retrying...\n"); |
956 | return -EIO; | 956 | msleep(50); |
957 | if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) { | ||
958 | printk(KERN_ERR "i8042: CTR write retry failed\n"); | ||
959 | return -EIO; | ||
960 | } | ||
957 | } | 961 | } |
958 | 962 | ||
959 | 963 | ||
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index c34bdf852e32..818aba368541 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c | |||
@@ -84,7 +84,7 @@ struct media_bay_info { | |||
84 | int cd_irq; | 84 | int cd_irq; |
85 | int cd_retry; | 85 | int cd_retry; |
86 | #endif | 86 | #endif |
87 | #if defined(CONFIG_BLK_DEV_IDE_PMAC) || defined(CONFIG_MAC_FLOPPY) | 87 | #if defined(CONFIG_BLK_DEV_IDE_PMAC) |
88 | int cd_index; | 88 | int cd_index; |
89 | #endif | 89 | #endif |
90 | }; | 90 | }; |
@@ -417,6 +417,7 @@ static void poll_media_bay(struct media_bay_info* bay) | |||
417 | } | 417 | } |
418 | } | 418 | } |
419 | 419 | ||
420 | #ifdef CONFIG_BLK_DEV_IDE_PMAC | ||
420 | int check_media_bay(struct device_node *which_bay, int what) | 421 | int check_media_bay(struct device_node *which_bay, int what) |
421 | { | 422 | { |
422 | int i; | 423 | int i; |
@@ -432,7 +433,6 @@ int check_media_bay(struct device_node *which_bay, int what) | |||
432 | } | 433 | } |
433 | EXPORT_SYMBOL(check_media_bay); | 434 | EXPORT_SYMBOL(check_media_bay); |
434 | 435 | ||
435 | #ifdef CONFIG_BLK_DEV_IDE_PMAC | ||
436 | int check_media_bay_by_base(unsigned long base, int what) | 436 | int check_media_bay_by_base(unsigned long base, int what) |
437 | { | 437 | { |
438 | int i; | 438 | int i; |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 77ad192962c5..d86d57af282a 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -483,12 +483,15 @@ int __init smu_init (void) | |||
483 | 483 | ||
484 | if (smu_cmdbuf_abs == 0) { | 484 | if (smu_cmdbuf_abs == 0) { |
485 | printk(KERN_ERR "SMU: Command buffer not allocated !\n"); | 485 | printk(KERN_ERR "SMU: Command buffer not allocated !\n"); |
486 | of_node_put(np); | ||
486 | return -EINVAL; | 487 | return -EINVAL; |
487 | } | 488 | } |
488 | 489 | ||
489 | smu = alloc_bootmem(sizeof(struct smu_device)); | 490 | smu = alloc_bootmem(sizeof(struct smu_device)); |
490 | if (smu == NULL) | 491 | if (smu == NULL) { |
492 | of_node_put(np); | ||
491 | return -ENOMEM; | 493 | return -ENOMEM; |
494 | } | ||
492 | memset(smu, 0, sizeof(*smu)); | 495 | memset(smu, 0, sizeof(*smu)); |
493 | 496 | ||
494 | spin_lock_init(&smu->lock); | 497 | spin_lock_init(&smu->lock); |
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 54f4942a2968..5366dc93fb38 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
@@ -562,18 +562,24 @@ thermostat_init(void) | |||
562 | therm_type = ADT7460; | 562 | therm_type = ADT7460; |
563 | else if (of_device_is_compatible(np, "adt7467")) | 563 | else if (of_device_is_compatible(np, "adt7467")) |
564 | therm_type = ADT7467; | 564 | therm_type = ADT7467; |
565 | else | 565 | else { |
566 | of_node_put(np); | ||
566 | return -ENODEV; | 567 | return -ENODEV; |
568 | } | ||
567 | 569 | ||
568 | prop = of_get_property(np, "hwsensor-params-version", NULL); | 570 | prop = of_get_property(np, "hwsensor-params-version", NULL); |
569 | printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop, | 571 | printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop, |
570 | (*prop == 1)?"":"un"); | 572 | (*prop == 1)?"":"un"); |
571 | if (*prop != 1) | 573 | if (*prop != 1) { |
574 | of_node_put(np); | ||
572 | return -ENODEV; | 575 | return -ENODEV; |
576 | } | ||
573 | 577 | ||
574 | prop = of_get_property(np, "reg", NULL); | 578 | prop = of_get_property(np, "reg", NULL); |
575 | if (!prop) | 579 | if (!prop) { |
580 | of_node_put(np); | ||
576 | return -ENODEV; | 581 | return -ENODEV; |
582 | } | ||
577 | 583 | ||
578 | /* look for bus either by path or using "reg" */ | 584 | /* look for bus either by path or using "reg" */ |
579 | if (strstr(np->full_name, "/i2c-bus@") != NULL) { | 585 | if (strstr(np->full_name, "/i2c-bus@") != NULL) { |
@@ -610,6 +616,7 @@ thermostat_init(void) | |||
610 | 616 | ||
611 | if (of_dev == NULL) { | 617 | if (of_dev == NULL) { |
612 | printk(KERN_ERR "Can't register temperatures device !\n"); | 618 | printk(KERN_ERR "Can't register temperatures device !\n"); |
619 | of_node_put(np); | ||
613 | return -ENODEV; | 620 | return -ENODEV; |
614 | } | 621 | } |
615 | 622 | ||
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 99e0b4cdc56f..3c798ae5c343 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -471,7 +471,6 @@ static int atl1_get_permanent_address(struct atl1_hw *hw) | |||
471 | memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN); | 471 | memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN); |
472 | return 0; | 472 | return 0; |
473 | } | 473 | } |
474 | return 1; | ||
475 | } | 474 | } |
476 | 475 | ||
477 | /* see if SPI FLAGS exist ? */ | 476 | /* see if SPI FLAGS exist ? */ |
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 46a90e9ec563..c05cb159c772 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c | |||
@@ -400,26 +400,31 @@ enc28j60_packet_write(struct enc28j60_net *priv, int len, const u8 *data) | |||
400 | mutex_unlock(&priv->lock); | 400 | mutex_unlock(&priv->lock); |
401 | } | 401 | } |
402 | 402 | ||
403 | /* | 403 | static unsigned long msec20_to_jiffies; |
404 | * Wait until the PHY operation is complete. | 404 | |
405 | */ | 405 | static int poll_ready(struct enc28j60_net *priv, u8 reg, u8 mask, u8 val) |
406 | static int wait_phy_ready(struct enc28j60_net *priv) | ||
407 | { | 406 | { |
408 | unsigned long timeout = jiffies + 20 * HZ / 1000; | 407 | unsigned long timeout = jiffies + msec20_to_jiffies; |
409 | int ret = 1; | ||
410 | 408 | ||
411 | /* 20 msec timeout read */ | 409 | /* 20 msec timeout read */ |
412 | while (nolock_regb_read(priv, MISTAT) & MISTAT_BUSY) { | 410 | while ((nolock_regb_read(priv, reg) & mask) != val) { |
413 | if (time_after(jiffies, timeout)) { | 411 | if (time_after(jiffies, timeout)) { |
414 | if (netif_msg_drv(priv)) | 412 | if (netif_msg_drv(priv)) |
415 | printk(KERN_DEBUG DRV_NAME | 413 | dev_dbg(&priv->spi->dev, |
416 | ": PHY ready timeout!\n"); | 414 | "reg %02x ready timeout!\n", reg); |
417 | ret = 0; | 415 | return -ETIMEDOUT; |
418 | break; | ||
419 | } | 416 | } |
420 | cpu_relax(); | 417 | cpu_relax(); |
421 | } | 418 | } |
422 | return ret; | 419 | return 0; |
420 | } | ||
421 | |||
422 | /* | ||
423 | * Wait until the PHY operation is complete. | ||
424 | */ | ||
425 | static int wait_phy_ready(struct enc28j60_net *priv) | ||
426 | { | ||
427 | return poll_ready(priv, MISTAT, MISTAT_BUSY, 0) ? 0 : 1; | ||
423 | } | 428 | } |
424 | 429 | ||
425 | /* | 430 | /* |
@@ -594,6 +599,32 @@ static void nolock_txfifo_init(struct enc28j60_net *priv, u16 start, u16 end) | |||
594 | nolock_regw_write(priv, ETXNDL, end); | 599 | nolock_regw_write(priv, ETXNDL, end); |
595 | } | 600 | } |
596 | 601 | ||
602 | /* | ||
603 | * Low power mode shrinks power consumption about 100x, so we'd like | ||
604 | * the chip to be in that mode whenever it's inactive. (However, we | ||
605 | * can't stay in lowpower mode during suspend with WOL active.) | ||
606 | */ | ||
607 | static void enc28j60_lowpower(struct enc28j60_net *priv, bool is_low) | ||
608 | { | ||
609 | if (netif_msg_drv(priv)) | ||
610 | dev_dbg(&priv->spi->dev, "%s power...\n", | ||
611 | is_low ? "low" : "high"); | ||
612 | |||
613 | mutex_lock(&priv->lock); | ||
614 | if (is_low) { | ||
615 | nolock_reg_bfclr(priv, ECON1, ECON1_RXEN); | ||
616 | poll_ready(priv, ESTAT, ESTAT_RXBUSY, 0); | ||
617 | poll_ready(priv, ECON1, ECON1_TXRTS, 0); | ||
618 | /* ECON2_VRPS was set during initialization */ | ||
619 | nolock_reg_bfset(priv, ECON2, ECON2_PWRSV); | ||
620 | } else { | ||
621 | nolock_reg_bfclr(priv, ECON2, ECON2_PWRSV); | ||
622 | poll_ready(priv, ESTAT, ESTAT_CLKRDY, ESTAT_CLKRDY); | ||
623 | /* caller sets ECON1_RXEN */ | ||
624 | } | ||
625 | mutex_unlock(&priv->lock); | ||
626 | } | ||
627 | |||
597 | static int enc28j60_hw_init(struct enc28j60_net *priv) | 628 | static int enc28j60_hw_init(struct enc28j60_net *priv) |
598 | { | 629 | { |
599 | u8 reg; | 630 | u8 reg; |
@@ -612,8 +643,8 @@ static int enc28j60_hw_init(struct enc28j60_net *priv) | |||
612 | priv->tx_retry_count = 0; | 643 | priv->tx_retry_count = 0; |
613 | priv->max_pk_counter = 0; | 644 | priv->max_pk_counter = 0; |
614 | priv->rxfilter = RXFILTER_NORMAL; | 645 | priv->rxfilter = RXFILTER_NORMAL; |
615 | /* enable address auto increment */ | 646 | /* enable address auto increment and voltage regulator powersave */ |
616 | nolock_regb_write(priv, ECON2, ECON2_AUTOINC); | 647 | nolock_regb_write(priv, ECON2, ECON2_AUTOINC | ECON2_VRPS); |
617 | 648 | ||
618 | nolock_rxfifo_init(priv, RXSTART_INIT, RXEND_INIT); | 649 | nolock_rxfifo_init(priv, RXSTART_INIT, RXEND_INIT); |
619 | nolock_txfifo_init(priv, TXSTART_INIT, TXEND_INIT); | 650 | nolock_txfifo_init(priv, TXSTART_INIT, TXEND_INIT); |
@@ -690,7 +721,7 @@ static int enc28j60_hw_init(struct enc28j60_net *priv) | |||
690 | 721 | ||
691 | static void enc28j60_hw_enable(struct enc28j60_net *priv) | 722 | static void enc28j60_hw_enable(struct enc28j60_net *priv) |
692 | { | 723 | { |
693 | /* enable interrutps */ | 724 | /* enable interrupts */ |
694 | if (netif_msg_hw(priv)) | 725 | if (netif_msg_hw(priv)) |
695 | printk(KERN_DEBUG DRV_NAME ": %s() enabling interrupts.\n", | 726 | printk(KERN_DEBUG DRV_NAME ": %s() enabling interrupts.\n", |
696 | __FUNCTION__); | 727 | __FUNCTION__); |
@@ -726,15 +757,12 @@ enc28j60_setlink(struct net_device *ndev, u8 autoneg, u16 speed, u8 duplex) | |||
726 | int ret = 0; | 757 | int ret = 0; |
727 | 758 | ||
728 | if (!priv->hw_enable) { | 759 | if (!priv->hw_enable) { |
729 | if (autoneg == AUTONEG_DISABLE && speed == SPEED_10) { | 760 | /* link is in low power mode now; duplex setting |
761 | * will take effect on next enc28j60_hw_init(). | ||
762 | */ | ||
763 | if (autoneg == AUTONEG_DISABLE && speed == SPEED_10) | ||
730 | priv->full_duplex = (duplex == DUPLEX_FULL); | 764 | priv->full_duplex = (duplex == DUPLEX_FULL); |
731 | if (!enc28j60_hw_init(priv)) { | 765 | else { |
732 | if (netif_msg_drv(priv)) | ||
733 | dev_err(&ndev->dev, | ||
734 | "hw_reset() failed\n"); | ||
735 | ret = -EINVAL; | ||
736 | } | ||
737 | } else { | ||
738 | if (netif_msg_link(priv)) | 766 | if (netif_msg_link(priv)) |
739 | dev_warn(&ndev->dev, | 767 | dev_warn(&ndev->dev, |
740 | "unsupported link setting\n"); | 768 | "unsupported link setting\n"); |
@@ -1307,7 +1335,8 @@ static int enc28j60_net_open(struct net_device *dev) | |||
1307 | } | 1335 | } |
1308 | return -EADDRNOTAVAIL; | 1336 | return -EADDRNOTAVAIL; |
1309 | } | 1337 | } |
1310 | /* Reset the hardware here */ | 1338 | /* Reset the hardware here (and take it out of low power mode) */ |
1339 | enc28j60_lowpower(priv, false); | ||
1311 | enc28j60_hw_disable(priv); | 1340 | enc28j60_hw_disable(priv); |
1312 | if (!enc28j60_hw_init(priv)) { | 1341 | if (!enc28j60_hw_init(priv)) { |
1313 | if (netif_msg_ifup(priv)) | 1342 | if (netif_msg_ifup(priv)) |
@@ -1337,6 +1366,7 @@ static int enc28j60_net_close(struct net_device *dev) | |||
1337 | printk(KERN_DEBUG DRV_NAME ": %s() enter\n", __FUNCTION__); | 1366 | printk(KERN_DEBUG DRV_NAME ": %s() enter\n", __FUNCTION__); |
1338 | 1367 | ||
1339 | enc28j60_hw_disable(priv); | 1368 | enc28j60_hw_disable(priv); |
1369 | enc28j60_lowpower(priv, true); | ||
1340 | netif_stop_queue(dev); | 1370 | netif_stop_queue(dev); |
1341 | 1371 | ||
1342 | return 0; | 1372 | return 0; |
@@ -1537,6 +1567,8 @@ static int __devinit enc28j60_probe(struct spi_device *spi) | |||
1537 | dev->watchdog_timeo = TX_TIMEOUT; | 1567 | dev->watchdog_timeo = TX_TIMEOUT; |
1538 | SET_ETHTOOL_OPS(dev, &enc28j60_ethtool_ops); | 1568 | SET_ETHTOOL_OPS(dev, &enc28j60_ethtool_ops); |
1539 | 1569 | ||
1570 | enc28j60_lowpower(priv, true); | ||
1571 | |||
1540 | ret = register_netdev(dev); | 1572 | ret = register_netdev(dev); |
1541 | if (ret) { | 1573 | if (ret) { |
1542 | if (netif_msg_probe(priv)) | 1574 | if (netif_msg_probe(priv)) |
@@ -1556,7 +1588,7 @@ error_alloc: | |||
1556 | return ret; | 1588 | return ret; |
1557 | } | 1589 | } |
1558 | 1590 | ||
1559 | static int enc28j60_remove(struct spi_device *spi) | 1591 | static int __devexit enc28j60_remove(struct spi_device *spi) |
1560 | { | 1592 | { |
1561 | struct enc28j60_net *priv = dev_get_drvdata(&spi->dev); | 1593 | struct enc28j60_net *priv = dev_get_drvdata(&spi->dev); |
1562 | 1594 | ||
@@ -1573,15 +1605,16 @@ static int enc28j60_remove(struct spi_device *spi) | |||
1573 | static struct spi_driver enc28j60_driver = { | 1605 | static struct spi_driver enc28j60_driver = { |
1574 | .driver = { | 1606 | .driver = { |
1575 | .name = DRV_NAME, | 1607 | .name = DRV_NAME, |
1576 | .bus = &spi_bus_type, | ||
1577 | .owner = THIS_MODULE, | 1608 | .owner = THIS_MODULE, |
1578 | }, | 1609 | }, |
1579 | .probe = enc28j60_probe, | 1610 | .probe = enc28j60_probe, |
1580 | .remove = __devexit_p(enc28j60_remove), | 1611 | .remove = __devexit_p(enc28j60_remove), |
1581 | }; | 1612 | }; |
1582 | 1613 | ||
1583 | static int __init enc28j60_init(void) | 1614 | static int __init enc28j60_init(void) |
1584 | { | 1615 | { |
1616 | msec20_to_jiffies = msecs_to_jiffies(20); | ||
1617 | |||
1585 | return spi_register_driver(&enc28j60_driver); | 1618 | return spi_register_driver(&enc28j60_driver); |
1586 | } | 1619 | } |
1587 | 1620 | ||
diff --git a/drivers/net/ibm_newemac/Kconfig b/drivers/net/ibm_newemac/Kconfig index 0d3e7380bad0..70a3272ee998 100644 --- a/drivers/net/ibm_newemac/Kconfig +++ b/drivers/net/ibm_newemac/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config IBM_NEW_EMAC | 1 | config IBM_NEW_EMAC |
2 | tristate "IBM EMAC Ethernet support" | 2 | tristate "IBM EMAC Ethernet support" |
3 | depends on PPC_DCR && PPC_MERGE | 3 | depends on PPC_DCR && PPC_MERGE |
4 | select CRC32 | ||
4 | help | 5 | help |
5 | This driver supports the IBM EMAC family of Ethernet controllers | 6 | This driver supports the IBM EMAC family of Ethernet controllers |
6 | typically found on 4xx embedded PowerPC chips, but also on the | 7 | typically found on 4xx embedded PowerPC chips, but also on the |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 8cb29f5b1038..da4c4fb97064 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -776,7 +776,6 @@ struct netxen_hardware_context { | |||
776 | 776 | ||
777 | u8 revision_id; | 777 | u8 revision_id; |
778 | u16 board_type; | 778 | u16 board_type; |
779 | u16 max_ports; | ||
780 | struct netxen_board_info boardcfg; | 779 | struct netxen_board_info boardcfg; |
781 | u32 xg_linkup; | 780 | u32 xg_linkup; |
782 | u32 qg_linksup; | 781 | u32 qg_linksup; |
@@ -863,6 +862,7 @@ struct netxen_adapter { | |||
863 | unsigned char mac_addr[ETH_ALEN]; | 862 | unsigned char mac_addr[ETH_ALEN]; |
864 | int mtu; | 863 | int mtu; |
865 | int portnum; | 864 | int portnum; |
865 | u8 physical_port; | ||
866 | 866 | ||
867 | struct work_struct watchdog_task; | 867 | struct work_struct watchdog_task; |
868 | struct timer_list watchdog_timer; | 868 | struct timer_list watchdog_timer; |
@@ -1034,7 +1034,6 @@ int netxen_rom_se(struct netxen_adapter *adapter, int addr); | |||
1034 | 1034 | ||
1035 | /* Functions from netxen_nic_isr.c */ | 1035 | /* Functions from netxen_nic_isr.c */ |
1036 | void netxen_initialize_adapter_sw(struct netxen_adapter *adapter); | 1036 | void netxen_initialize_adapter_sw(struct netxen_adapter *adapter); |
1037 | void netxen_initialize_adapter_hw(struct netxen_adapter *adapter); | ||
1038 | void *netxen_alloc(struct pci_dev *pdev, size_t sz, dma_addr_t * ptr, | 1037 | void *netxen_alloc(struct pci_dev *pdev, size_t sz, dma_addr_t * ptr, |
1039 | struct pci_dev **used_dev); | 1038 | struct pci_dev **used_dev); |
1040 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); | 1039 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); |
@@ -1077,20 +1076,6 @@ static const struct netxen_brdinfo netxen_boards[] = { | |||
1077 | 1076 | ||
1078 | #define NUM_SUPPORTED_BOARDS ARRAY_SIZE(netxen_boards) | 1077 | #define NUM_SUPPORTED_BOARDS ARRAY_SIZE(netxen_boards) |
1079 | 1078 | ||
1080 | static inline void get_brd_port_by_type(u32 type, int *ports) | ||
1081 | { | ||
1082 | int i, found = 0; | ||
1083 | for (i = 0; i < NUM_SUPPORTED_BOARDS; ++i) { | ||
1084 | if (netxen_boards[i].brdtype == type) { | ||
1085 | *ports = netxen_boards[i].ports; | ||
1086 | found = 1; | ||
1087 | break; | ||
1088 | } | ||
1089 | } | ||
1090 | if (!found) | ||
1091 | *ports = 0; | ||
1092 | } | ||
1093 | |||
1094 | static inline void get_brd_name_by_type(u32 type, char *name) | 1079 | static inline void get_brd_name_by_type(u32 type, char *name) |
1095 | { | 1080 | { |
1096 | int i, found = 0; | 1081 | int i, found = 0; |
@@ -1169,5 +1154,4 @@ extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, | |||
1169 | 1154 | ||
1170 | extern struct ethtool_ops netxen_nic_ethtool_ops; | 1155 | extern struct ethtool_ops netxen_nic_ethtool_ops; |
1171 | 1156 | ||
1172 | extern int physical_port[]; /* physical port # from virtual port.*/ | ||
1173 | #endif /* __NETXEN_NIC_H_ */ | 1157 | #endif /* __NETXEN_NIC_H_ */ |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 6e98d830eefb..723487bf200c 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -369,7 +369,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) | |||
369 | for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { | 369 | for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { |
370 | /* GB: port specific registers */ | 370 | /* GB: port specific registers */ |
371 | if (mode == 0 && i >= 19) | 371 | if (mode == 0 && i >= 19) |
372 | window = physical_port[adapter->portnum] * | 372 | window = adapter->physical_port * |
373 | NETXEN_NIC_PORT_WINDOW; | 373 | NETXEN_NIC_PORT_WINDOW; |
374 | 374 | ||
375 | NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode]. | 375 | NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode]. |
@@ -527,7 +527,7 @@ netxen_nic_get_pauseparam(struct net_device *dev, | |||
527 | { | 527 | { |
528 | struct netxen_adapter *adapter = netdev_priv(dev); | 528 | struct netxen_adapter *adapter = netdev_priv(dev); |
529 | __u32 val; | 529 | __u32 val; |
530 | int port = physical_port[adapter->portnum]; | 530 | int port = adapter->physical_port; |
531 | 531 | ||
532 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 532 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
533 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 533 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
@@ -573,7 +573,7 @@ netxen_nic_set_pauseparam(struct net_device *dev, | |||
573 | { | 573 | { |
574 | struct netxen_adapter *adapter = netdev_priv(dev); | 574 | struct netxen_adapter *adapter = netdev_priv(dev); |
575 | __u32 val; | 575 | __u32 val; |
576 | int port = physical_port[adapter->portnum]; | 576 | int port = adapter->physical_port; |
577 | /* read mode */ | 577 | /* read mode */ |
578 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 578 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
579 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) | 579 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index af7356468251..c43d06b8de9b 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -396,11 +396,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
396 | } | 396 | } |
397 | adapter->intr_scheme = readl( | 397 | adapter->intr_scheme = readl( |
398 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW)); | 398 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW)); |
399 | printk(KERN_NOTICE "%s: FW capabilities:0x%x\n", netxen_nic_driver_name, | ||
400 | adapter->intr_scheme); | ||
401 | adapter->msi_mode = readl( | 399 | adapter->msi_mode = readl( |
402 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_MSI_MODE_FW)); | 400 | NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_MSI_MODE_FW)); |
403 | DPRINTK(INFO, "Receive Peg ready too. starting stuff\n"); | ||
404 | 401 | ||
405 | addr = netxen_alloc(adapter->ahw.pdev, | 402 | addr = netxen_alloc(adapter->ahw.pdev, |
406 | sizeof(struct netxen_ring_ctx) + | 403 | sizeof(struct netxen_ring_ctx) + |
@@ -408,8 +405,6 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
408 | (dma_addr_t *) & adapter->ctx_desc_phys_addr, | 405 | (dma_addr_t *) & adapter->ctx_desc_phys_addr, |
409 | &adapter->ctx_desc_pdev); | 406 | &adapter->ctx_desc_pdev); |
410 | 407 | ||
411 | printk(KERN_INFO "ctx_desc_phys_addr: 0x%llx\n", | ||
412 | (unsigned long long) adapter->ctx_desc_phys_addr); | ||
413 | if (addr == NULL) { | 408 | if (addr == NULL) { |
414 | DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); | 409 | DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); |
415 | err = -ENOMEM; | 410 | err = -ENOMEM; |
@@ -429,8 +424,6 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
429 | adapter->max_tx_desc_count, | 424 | adapter->max_tx_desc_count, |
430 | (dma_addr_t *) & hw->cmd_desc_phys_addr, | 425 | (dma_addr_t *) & hw->cmd_desc_phys_addr, |
431 | &adapter->ahw.cmd_desc_pdev); | 426 | &adapter->ahw.cmd_desc_pdev); |
432 | printk(KERN_INFO "cmd_desc_phys_addr: 0x%llx\n", | ||
433 | (unsigned long long) hw->cmd_desc_phys_addr); | ||
434 | 427 | ||
435 | if (addr == NULL) { | 428 | if (addr == NULL) { |
436 | DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); | 429 | DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); |
@@ -1032,15 +1025,15 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
1032 | int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) | 1025 | int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) |
1033 | { | 1026 | { |
1034 | netxen_nic_write_w0(adapter, | 1027 | netxen_nic_write_w0(adapter, |
1035 | NETXEN_NIU_GB_MAX_FRAME_SIZE( | 1028 | NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->physical_port), |
1036 | physical_port[adapter->portnum]), new_mtu); | 1029 | new_mtu); |
1037 | return 0; | 1030 | return 0; |
1038 | } | 1031 | } |
1039 | 1032 | ||
1040 | int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) | 1033 | int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) |
1041 | { | 1034 | { |
1042 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; | 1035 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; |
1043 | if (physical_port[adapter->portnum] == 0) | 1036 | if (adapter->physical_port == 0) |
1044 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, | 1037 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, |
1045 | new_mtu); | 1038 | new_mtu); |
1046 | else | 1039 | else |
@@ -1051,7 +1044,7 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) | |||
1051 | 1044 | ||
1052 | void netxen_nic_init_niu_gb(struct netxen_adapter *adapter) | 1045 | void netxen_nic_init_niu_gb(struct netxen_adapter *adapter) |
1053 | { | 1046 | { |
1054 | netxen_niu_gbe_init_port(adapter, physical_port[adapter->portnum]); | 1047 | netxen_niu_gbe_init_port(adapter, adapter->physical_port); |
1055 | } | 1048 | } |
1056 | 1049 | ||
1057 | void | 1050 | void |
@@ -1127,7 +1120,6 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
1127 | 1120 | ||
1128 | void netxen_nic_flash_print(struct netxen_adapter *adapter) | 1121 | void netxen_nic_flash_print(struct netxen_adapter *adapter) |
1129 | { | 1122 | { |
1130 | int valid = 1; | ||
1131 | u32 fw_major = 0; | 1123 | u32 fw_major = 0; |
1132 | u32 fw_minor = 0; | 1124 | u32 fw_minor = 0; |
1133 | u32 fw_build = 0; | 1125 | u32 fw_build = 0; |
@@ -1137,70 +1129,62 @@ void netxen_nic_flash_print(struct netxen_adapter *adapter) | |||
1137 | __le32 *ptr32; | 1129 | __le32 *ptr32; |
1138 | 1130 | ||
1139 | struct netxen_board_info *board_info = &(adapter->ahw.boardcfg); | 1131 | struct netxen_board_info *board_info = &(adapter->ahw.boardcfg); |
1140 | if (board_info->magic != NETXEN_BDINFO_MAGIC) { | 1132 | |
1141 | printk | 1133 | adapter->driver_mismatch = 0; |
1142 | ("NetXen Unknown board config, Read 0x%x expected as 0x%x\n", | 1134 | |
1143 | board_info->magic, NETXEN_BDINFO_MAGIC); | 1135 | ptr32 = (u32 *)&serial_num; |
1144 | valid = 0; | 1136 | addr = NETXEN_USER_START + |
1145 | } | 1137 | offsetof(struct netxen_new_user_info, serial_num); |
1146 | if (board_info->header_version != NETXEN_BDINFO_VERSION) { | 1138 | for (i = 0; i < 8; i++) { |
1147 | printk("NetXen Unknown board config version." | 1139 | if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) { |
1148 | " Read %x, expected %x\n", | 1140 | printk("%s: ERROR reading %s board userarea.\n", |
1149 | board_info->header_version, NETXEN_BDINFO_VERSION); | 1141 | netxen_nic_driver_name, |
1150 | valid = 0; | 1142 | netxen_nic_driver_name); |
1151 | } | 1143 | adapter->driver_mismatch = 1; |
1152 | if (valid) { | 1144 | return; |
1153 | ptr32 = (u32 *)&serial_num; | ||
1154 | addr = NETXEN_USER_START + | ||
1155 | offsetof(struct netxen_new_user_info, serial_num); | ||
1156 | for (i = 0; i < 8; i++) { | ||
1157 | if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) { | ||
1158 | printk("%s: ERROR reading %s board userarea.\n", | ||
1159 | netxen_nic_driver_name, | ||
1160 | netxen_nic_driver_name); | ||
1161 | return; | ||
1162 | } | ||
1163 | ptr32++; | ||
1164 | addr += sizeof(u32); | ||
1165 | } | 1145 | } |
1146 | ptr32++; | ||
1147 | addr += sizeof(u32); | ||
1148 | } | ||
1149 | |||
1150 | fw_major = readl(NETXEN_CRB_NORMALIZE(adapter, | ||
1151 | NETXEN_FW_VERSION_MAJOR)); | ||
1152 | fw_minor = readl(NETXEN_CRB_NORMALIZE(adapter, | ||
1153 | NETXEN_FW_VERSION_MINOR)); | ||
1154 | fw_build = | ||
1155 | readl(NETXEN_CRB_NORMALIZE(adapter, NETXEN_FW_VERSION_SUB)); | ||
1166 | 1156 | ||
1157 | if (adapter->portnum == 0) { | ||
1167 | get_brd_name_by_type(board_info->board_type, brd_name); | 1158 | get_brd_name_by_type(board_info->board_type, brd_name); |
1168 | 1159 | ||
1169 | printk("NetXen %s Board S/N %s Chip id 0x%x\n", | 1160 | printk("NetXen %s Board S/N %s Chip id 0x%x\n", |
1170 | brd_name, serial_num, board_info->chip_id); | 1161 | brd_name, serial_num, board_info->chip_id); |
1171 | 1162 | printk("NetXen Firmware version %d.%d.%d\n", fw_major, | |
1172 | printk("NetXen %s Board #%d, Chip id 0x%x\n", | 1163 | fw_minor, fw_build); |
1173 | board_info->board_type == 0x0b ? "XGB" : "GBE", | ||
1174 | board_info->board_num, board_info->chip_id); | ||
1175 | fw_major = readl(NETXEN_CRB_NORMALIZE(adapter, | ||
1176 | NETXEN_FW_VERSION_MAJOR)); | ||
1177 | fw_minor = readl(NETXEN_CRB_NORMALIZE(adapter, | ||
1178 | NETXEN_FW_VERSION_MINOR)); | ||
1179 | fw_build = | ||
1180 | readl(NETXEN_CRB_NORMALIZE(adapter, NETXEN_FW_VERSION_SUB)); | ||
1181 | |||
1182 | printk("NetXen Firmware version %d.%d.%d\n", fw_major, fw_minor, | ||
1183 | fw_build); | ||
1184 | } | 1164 | } |
1165 | |||
1185 | if (fw_major != _NETXEN_NIC_LINUX_MAJOR) { | 1166 | if (fw_major != _NETXEN_NIC_LINUX_MAJOR) { |
1186 | printk(KERN_ERR "The mismatch in driver version and firmware " | ||
1187 | "version major number\n" | ||
1188 | "Driver version major number = %d \t" | ||
1189 | "Firmware version major number = %d \n", | ||
1190 | _NETXEN_NIC_LINUX_MAJOR, fw_major); | ||
1191 | adapter->driver_mismatch = 1; | 1167 | adapter->driver_mismatch = 1; |
1192 | } | 1168 | } |
1193 | if (fw_minor != _NETXEN_NIC_LINUX_MINOR && | 1169 | if (fw_minor != _NETXEN_NIC_LINUX_MINOR && |
1194 | fw_minor != (_NETXEN_NIC_LINUX_MINOR + 1)) { | 1170 | fw_minor != (_NETXEN_NIC_LINUX_MINOR + 1)) { |
1195 | printk(KERN_ERR "The mismatch in driver version and firmware " | ||
1196 | "version minor number\n" | ||
1197 | "Driver version minor number = %d \t" | ||
1198 | "Firmware version minor number = %d \n", | ||
1199 | _NETXEN_NIC_LINUX_MINOR, fw_minor); | ||
1200 | adapter->driver_mismatch = 1; | 1171 | adapter->driver_mismatch = 1; |
1201 | } | 1172 | } |
1202 | if (adapter->driver_mismatch) | 1173 | if (adapter->driver_mismatch) { |
1203 | printk(KERN_INFO "Use the driver with version no %d.%d.xxx\n", | 1174 | printk(KERN_ERR "%s: driver and firmware version mismatch\n", |
1204 | fw_major, fw_minor); | 1175 | adapter->netdev->name); |
1176 | return; | ||
1177 | } | ||
1178 | |||
1179 | switch (adapter->ahw.board_type) { | ||
1180 | case NETXEN_NIC_GBE: | ||
1181 | dev_info(&adapter->pdev->dev, "%s: GbE port initialized\n", | ||
1182 | adapter->netdev->name); | ||
1183 | break; | ||
1184 | case NETXEN_NIC_XGBE: | ||
1185 | dev_info(&adapter->pdev->dev, "%s: XGbE port initialized\n", | ||
1186 | adapter->netdev->name); | ||
1187 | break; | ||
1188 | } | ||
1205 | } | 1189 | } |
1206 | 1190 | ||
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 45fa33e0cb90..70d1b22ced22 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -203,21 +203,6 @@ void netxen_initialize_adapter_sw(struct netxen_adapter *adapter) | |||
203 | } | 203 | } |
204 | } | 204 | } |
205 | 205 | ||
206 | void netxen_initialize_adapter_hw(struct netxen_adapter *adapter) | ||
207 | { | ||
208 | int ports = 0; | ||
209 | struct netxen_board_info *board_info = &(adapter->ahw.boardcfg); | ||
210 | |||
211 | if (netxen_nic_get_board_info(adapter) != 0) | ||
212 | printk("%s: Error getting board config info.\n", | ||
213 | netxen_nic_driver_name); | ||
214 | get_brd_port_by_type(board_info->board_type, &ports); | ||
215 | if (ports == 0) | ||
216 | printk(KERN_ERR "%s: Unknown board type\n", | ||
217 | netxen_nic_driver_name); | ||
218 | adapter->ahw.max_ports = ports; | ||
219 | } | ||
220 | |||
221 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter) | 206 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter) |
222 | { | 207 | { |
223 | switch (adapter->ahw.board_type) { | 208 | switch (adapter->ahw.board_type) { |
@@ -765,18 +750,13 @@ int netxen_flash_unlock(struct netxen_adapter *adapter) | |||
765 | 750 | ||
766 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | 751 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) |
767 | { | 752 | { |
768 | int addr, val, status; | 753 | int addr, val; |
769 | int n, i; | 754 | int n, i; |
770 | int init_delay = 0; | 755 | int init_delay = 0; |
771 | struct crb_addr_pair *buf; | 756 | struct crb_addr_pair *buf; |
772 | u32 off; | 757 | u32 off; |
773 | 758 | ||
774 | /* resetall */ | 759 | /* resetall */ |
775 | status = netxen_nic_get_board_info(adapter); | ||
776 | if (status) | ||
777 | printk("%s: netxen_pinit_from_rom: Error getting board info\n", | ||
778 | netxen_nic_driver_name); | ||
779 | |||
780 | netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET, | 760 | netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET, |
781 | NETXEN_ROMBUS_RESET); | 761 | NETXEN_ROMBUS_RESET); |
782 | 762 | ||
@@ -860,10 +840,10 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
860 | netxen_nic_pci_change_crbwindow(adapter, 1); | 840 | netxen_nic_pci_change_crbwindow(adapter, 1); |
861 | } | 841 | } |
862 | if (init_delay == 1) { | 842 | if (init_delay == 1) { |
863 | msleep(2000); | 843 | msleep(1000); |
864 | init_delay = 0; | 844 | init_delay = 0; |
865 | } | 845 | } |
866 | msleep(20); | 846 | msleep(1); |
867 | } | 847 | } |
868 | kfree(buf); | 848 | kfree(buf); |
869 | 849 | ||
@@ -938,12 +918,28 @@ int netxen_initialize_adapter_offload(struct netxen_adapter *adapter) | |||
938 | 918 | ||
939 | void netxen_free_adapter_offload(struct netxen_adapter *adapter) | 919 | void netxen_free_adapter_offload(struct netxen_adapter *adapter) |
940 | { | 920 | { |
921 | int i; | ||
922 | |||
941 | if (adapter->dummy_dma.addr) { | 923 | if (adapter->dummy_dma.addr) { |
942 | pci_free_consistent(adapter->ahw.pdev, | 924 | i = 100; |
925 | do { | ||
926 | if (dma_watchdog_shutdown_request(adapter) == 1) | ||
927 | break; | ||
928 | msleep(50); | ||
929 | if (dma_watchdog_shutdown_poll_result(adapter) == 1) | ||
930 | break; | ||
931 | } while (--i); | ||
932 | |||
933 | if (i) { | ||
934 | pci_free_consistent(adapter->ahw.pdev, | ||
943 | NETXEN_HOST_DUMMY_DMA_SIZE, | 935 | NETXEN_HOST_DUMMY_DMA_SIZE, |
944 | adapter->dummy_dma.addr, | 936 | adapter->dummy_dma.addr, |
945 | adapter->dummy_dma.phys_addr); | 937 | adapter->dummy_dma.phys_addr); |
946 | adapter->dummy_dma.addr = NULL; | 938 | adapter->dummy_dma.addr = NULL; |
939 | } else { | ||
940 | printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n", | ||
941 | adapter->netdev->name); | ||
942 | } | ||
947 | } | 943 | } |
948 | } | 944 | } |
949 | 945 | ||
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c index f487615f4063..96cec41f9019 100644 --- a/drivers/net/netxen/netxen_nic_isr.c +++ b/drivers/net/netxen/netxen_nic_isr.c | |||
@@ -145,7 +145,7 @@ static void netxen_nic_isr_other(struct netxen_adapter *adapter) | |||
145 | 145 | ||
146 | /* verify the offset */ | 146 | /* verify the offset */ |
147 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); | 147 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); |
148 | val = val >> physical_port[adapter->portnum]; | 148 | val = val >> adapter->physical_port; |
149 | if (val == adapter->ahw.qg_linksup) | 149 | if (val == adapter->ahw.qg_linksup) |
150 | return; | 150 | return; |
151 | 151 | ||
@@ -199,7 +199,7 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter) | |||
199 | 199 | ||
200 | /* WINDOW = 1 */ | 200 | /* WINDOW = 1 */ |
201 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); | 201 | val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); |
202 | val >>= (physical_port[adapter->portnum] * 8); | 202 | val >>= (adapter->physical_port * 8); |
203 | val &= 0xff; | 203 | val &= 0xff; |
204 | 204 | ||
205 | if (adapter->ahw.xg_linkup == 1 && val != XG_LINK_UP) { | 205 | if (adapter->ahw.xg_linkup == 1 && val != XG_LINK_UP) { |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 7144c255ce54..6797ed069f1f 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -70,17 +70,15 @@ static void netxen_nic_poll_controller(struct net_device *netdev); | |||
70 | static irqreturn_t netxen_intr(int irq, void *data); | 70 | static irqreturn_t netxen_intr(int irq, void *data); |
71 | static irqreturn_t netxen_msi_intr(int irq, void *data); | 71 | static irqreturn_t netxen_msi_intr(int irq, void *data); |
72 | 72 | ||
73 | int physical_port[] = {0, 1, 2, 3}; | ||
74 | |||
75 | /* PCI Device ID Table */ | 73 | /* PCI Device ID Table */ |
76 | static struct pci_device_id netxen_pci_tbl[] __devinitdata = { | 74 | static struct pci_device_id netxen_pci_tbl[] __devinitdata = { |
77 | {PCI_DEVICE(0x4040, 0x0001)}, | 75 | {PCI_DEVICE(0x4040, 0x0001), PCI_DEVICE_CLASS(0x020000, ~0)}, |
78 | {PCI_DEVICE(0x4040, 0x0002)}, | 76 | {PCI_DEVICE(0x4040, 0x0002), PCI_DEVICE_CLASS(0x020000, ~0)}, |
79 | {PCI_DEVICE(0x4040, 0x0003)}, | 77 | {PCI_DEVICE(0x4040, 0x0003), PCI_DEVICE_CLASS(0x020000, ~0)}, |
80 | {PCI_DEVICE(0x4040, 0x0004)}, | 78 | {PCI_DEVICE(0x4040, 0x0004), PCI_DEVICE_CLASS(0x020000, ~0)}, |
81 | {PCI_DEVICE(0x4040, 0x0005)}, | 79 | {PCI_DEVICE(0x4040, 0x0005), PCI_DEVICE_CLASS(0x020000, ~0)}, |
82 | {PCI_DEVICE(0x4040, 0x0024)}, | 80 | {PCI_DEVICE(0x4040, 0x0024), PCI_DEVICE_CLASS(0x020000, ~0)}, |
83 | {PCI_DEVICE(0x4040, 0x0025)}, | 81 | {PCI_DEVICE(0x4040, 0x0025), PCI_DEVICE_CLASS(0x020000, ~0)}, |
84 | {0,} | 82 | {0,} |
85 | }; | 83 | }; |
86 | 84 | ||
@@ -288,10 +286,11 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
288 | int pci_func_id = PCI_FUNC(pdev->devfn); | 286 | int pci_func_id = PCI_FUNC(pdev->devfn); |
289 | DECLARE_MAC_BUF(mac); | 287 | DECLARE_MAC_BUF(mac); |
290 | 288 | ||
291 | printk(KERN_INFO "%s \n", netxen_nic_driver_string); | 289 | if (pci_func_id == 0) |
290 | printk(KERN_INFO "%s \n", netxen_nic_driver_string); | ||
292 | 291 | ||
293 | if (pdev->class != 0x020000) { | 292 | if (pdev->class != 0x020000) { |
294 | printk(KERN_ERR"NetXen function %d, class %x will not " | 293 | printk(KERN_DEBUG "NetXen function %d, class %x will not " |
295 | "be enabled.\n",pci_func_id, pdev->class); | 294 | "be enabled.\n",pci_func_id, pdev->class); |
296 | return -ENODEV; | 295 | return -ENODEV; |
297 | } | 296 | } |
@@ -450,8 +449,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
450 | */ | 449 | */ |
451 | adapter->curr_window = 255; | 450 | adapter->curr_window = 255; |
452 | 451 | ||
453 | /* initialize the adapter */ | 452 | if (netxen_nic_get_board_info(adapter) != 0) { |
454 | netxen_initialize_adapter_hw(adapter); | 453 | printk("%s: Error getting board config info.\n", |
454 | netxen_nic_driver_name); | ||
455 | err = -EIO; | ||
456 | goto err_out_iounmap; | ||
457 | } | ||
455 | 458 | ||
456 | /* | 459 | /* |
457 | * Adapter in our case is quad port so initialize it before | 460 | * Adapter in our case is quad port so initialize it before |
@@ -530,17 +533,15 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
530 | netxen_initialize_adapter_sw(adapter); /* initialize the buffers in adapter */ | 533 | netxen_initialize_adapter_sw(adapter); /* initialize the buffers in adapter */ |
531 | 534 | ||
532 | /* Mezz cards have PCI function 0,2,3 enabled */ | 535 | /* Mezz cards have PCI function 0,2,3 enabled */ |
533 | if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) | 536 | switch (adapter->ahw.boardcfg.board_type) { |
534 | && (pci_func_id >= 2)) | 537 | case NETXEN_BRDTYPE_P2_SB31_10G_IMEZ: |
538 | case NETXEN_BRDTYPE_P2_SB31_10G_HMEZ: | ||
539 | if (pci_func_id >= 2) | ||
535 | adapter->portnum = pci_func_id - 2; | 540 | adapter->portnum = pci_func_id - 2; |
536 | 541 | break; | |
537 | #ifdef CONFIG_IA64 | 542 | default: |
538 | if(adapter->portnum == 0) { | 543 | break; |
539 | netxen_pinit_from_rom(adapter, 0); | ||
540 | udelay(500); | ||
541 | netxen_load_firmware(adapter); | ||
542 | } | 544 | } |
543 | #endif | ||
544 | 545 | ||
545 | init_timer(&adapter->watchdog_timer); | 546 | init_timer(&adapter->watchdog_timer); |
546 | adapter->ahw.xg_linkup = 0; | 547 | adapter->ahw.xg_linkup = 0; |
@@ -613,11 +614,18 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
613 | err = -ENODEV; | 614 | err = -ENODEV; |
614 | goto err_out_free_dev; | 615 | goto err_out_free_dev; |
615 | } | 616 | } |
617 | } else { | ||
618 | writel(0, NETXEN_CRB_NORMALIZE(adapter, | ||
619 | CRB_CMDPEG_STATE)); | ||
620 | netxen_pinit_from_rom(adapter, 0); | ||
621 | msleep(1); | ||
622 | netxen_load_firmware(adapter); | ||
623 | netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); | ||
616 | } | 624 | } |
617 | 625 | ||
618 | /* clear the register for future unloads/loads */ | 626 | /* clear the register for future unloads/loads */ |
619 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); | 627 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); |
620 | printk(KERN_INFO "State: 0x%0x\n", | 628 | dev_info(&pdev->dev, "cmdpeg state: 0x%0x\n", |
621 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); | 629 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); |
622 | 630 | ||
623 | /* | 631 | /* |
@@ -639,9 +647,10 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
639 | /* | 647 | /* |
640 | * See if the firmware gave us a virtual-physical port mapping. | 648 | * See if the firmware gave us a virtual-physical port mapping. |
641 | */ | 649 | */ |
650 | adapter->physical_port = adapter->portnum; | ||
642 | i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum))); | 651 | i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum))); |
643 | if (i != 0x55555555) | 652 | if (i != 0x55555555) |
644 | physical_port[adapter->portnum] = i; | 653 | adapter->physical_port = i; |
645 | 654 | ||
646 | netif_carrier_off(netdev); | 655 | netif_carrier_off(netdev); |
647 | netif_stop_queue(netdev); | 656 | netif_stop_queue(netdev); |
@@ -654,22 +663,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
654 | goto err_out_free_dev; | 663 | goto err_out_free_dev; |
655 | } | 664 | } |
656 | 665 | ||
666 | netxen_nic_flash_print(adapter); | ||
657 | pci_set_drvdata(pdev, adapter); | 667 | pci_set_drvdata(pdev, adapter); |
658 | 668 | ||
659 | switch (adapter->ahw.board_type) { | ||
660 | case NETXEN_NIC_GBE: | ||
661 | printk(KERN_INFO "%s: QUAD GbE board initialized\n", | ||
662 | netxen_nic_driver_name); | ||
663 | break; | ||
664 | |||
665 | case NETXEN_NIC_XGBE: | ||
666 | printk(KERN_INFO "%s: XGbE board initialized\n", | ||
667 | netxen_nic_driver_name); | ||
668 | break; | ||
669 | } | ||
670 | |||
671 | adapter->driver_mismatch = 0; | ||
672 | |||
673 | return 0; | 669 | return 0; |
674 | 670 | ||
675 | err_out_free_dev: | 671 | err_out_free_dev: |
@@ -760,55 +756,8 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
760 | 756 | ||
761 | vfree(adapter->cmd_buf_arr); | 757 | vfree(adapter->cmd_buf_arr); |
762 | 758 | ||
763 | if (adapter->portnum == 0) { | 759 | if (adapter->portnum == 0) |
764 | if (init_firmware_done) { | 760 | netxen_free_adapter_offload(adapter); |
765 | i = 100; | ||
766 | do { | ||
767 | if (dma_watchdog_shutdown_request(adapter) == 1) | ||
768 | break; | ||
769 | msleep(100); | ||
770 | if (dma_watchdog_shutdown_poll_result(adapter) == 1) | ||
771 | break; | ||
772 | } while (--i); | ||
773 | |||
774 | if (i == 0) | ||
775 | printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n", | ||
776 | netdev->name); | ||
777 | |||
778 | /* clear the register for future unloads/loads */ | ||
779 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); | ||
780 | printk(KERN_INFO "State: 0x%0x\n", | ||
781 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); | ||
782 | |||
783 | /* leave the hw in the same state as reboot */ | ||
784 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); | ||
785 | netxen_pinit_from_rom(adapter, 0); | ||
786 | msleep(1); | ||
787 | netxen_load_firmware(adapter); | ||
788 | netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); | ||
789 | } | ||
790 | |||
791 | /* clear the register for future unloads/loads */ | ||
792 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); | ||
793 | printk(KERN_INFO "State: 0x%0x\n", | ||
794 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); | ||
795 | |||
796 | i = 100; | ||
797 | do { | ||
798 | if (dma_watchdog_shutdown_request(adapter) == 1) | ||
799 | break; | ||
800 | msleep(100); | ||
801 | if (dma_watchdog_shutdown_poll_result(adapter) == 1) | ||
802 | break; | ||
803 | } while (--i); | ||
804 | |||
805 | if (i) { | ||
806 | netxen_free_adapter_offload(adapter); | ||
807 | } else { | ||
808 | printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n", | ||
809 | netdev->name); | ||
810 | } | ||
811 | } | ||
812 | 761 | ||
813 | if (adapter->irq) | 762 | if (adapter->irq) |
814 | free_irq(adapter->irq, adapter); | 763 | free_irq(adapter->irq, adapter); |
@@ -840,13 +789,15 @@ static int netxen_nic_open(struct net_device *netdev) | |||
840 | irq_handler_t handler; | 789 | irq_handler_t handler; |
841 | unsigned long flags = IRQF_SAMPLE_RANDOM; | 790 | unsigned long flags = IRQF_SAMPLE_RANDOM; |
842 | 791 | ||
792 | if (adapter->driver_mismatch) | ||
793 | return -EIO; | ||
794 | |||
843 | if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { | 795 | if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { |
844 | err = netxen_init_firmware(adapter); | 796 | err = netxen_init_firmware(adapter); |
845 | if (err != 0) { | 797 | if (err != 0) { |
846 | printk(KERN_ERR "Failed to init firmware\n"); | 798 | printk(KERN_ERR "Failed to init firmware\n"); |
847 | return -EIO; | 799 | return -EIO; |
848 | } | 800 | } |
849 | netxen_nic_flash_print(adapter); | ||
850 | 801 | ||
851 | /* setup all the resources for the Phantom... */ | 802 | /* setup all the resources for the Phantom... */ |
852 | /* this include the descriptors for rcv, tx, and status */ | 803 | /* this include the descriptors for rcv, tx, and status */ |
@@ -895,14 +846,12 @@ static int netxen_nic_open(struct net_device *netdev) | |||
895 | if (adapter->set_mtu) | 846 | if (adapter->set_mtu) |
896 | adapter->set_mtu(adapter, netdev->mtu); | 847 | adapter->set_mtu(adapter, netdev->mtu); |
897 | 848 | ||
898 | if (!adapter->driver_mismatch) | 849 | mod_timer(&adapter->watchdog_timer, jiffies); |
899 | mod_timer(&adapter->watchdog_timer, jiffies); | ||
900 | 850 | ||
901 | napi_enable(&adapter->napi); | 851 | napi_enable(&adapter->napi); |
902 | netxen_nic_enable_int(adapter); | 852 | netxen_nic_enable_int(adapter); |
903 | 853 | ||
904 | if (!adapter->driver_mismatch) | 854 | netif_start_queue(netdev); |
905 | netif_start_queue(netdev); | ||
906 | 855 | ||
907 | return 0; | 856 | return 0; |
908 | } | 857 | } |
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index 1c852a76c80d..a3bc7cc67a6f 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -94,7 +94,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg, | |||
94 | long timeout = 0; | 94 | long timeout = 0; |
95 | long result = 0; | 95 | long result = 0; |
96 | long restore = 0; | 96 | long restore = 0; |
97 | long phy = physical_port[adapter->portnum]; | 97 | long phy = adapter->physical_port; |
98 | __u32 address; | 98 | __u32 address; |
99 | __u32 command; | 99 | __u32 command; |
100 | __u32 status; | 100 | __u32 status; |
@@ -190,7 +190,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg, | |||
190 | long timeout = 0; | 190 | long timeout = 0; |
191 | long result = 0; | 191 | long result = 0; |
192 | long restore = 0; | 192 | long restore = 0; |
193 | long phy = physical_port[adapter->portnum]; | 193 | long phy = adapter->physical_port; |
194 | __u32 address; | 194 | __u32 address; |
195 | __u32 command; | 195 | __u32 command; |
196 | __u32 status; | 196 | __u32 status; |
@@ -456,7 +456,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) | |||
456 | 456 | ||
457 | int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) | 457 | int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) |
458 | { | 458 | { |
459 | u32 portnum = physical_port[adapter->portnum]; | 459 | u32 portnum = adapter->physical_port; |
460 | 460 | ||
461 | netxen_crb_writelit_adapter(adapter, | 461 | netxen_crb_writelit_adapter(adapter, |
462 | NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), 0x1447); | 462 | NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), 0x1447); |
@@ -573,7 +573,7 @@ static int netxen_niu_macaddr_get(struct netxen_adapter *adapter, | |||
573 | { | 573 | { |
574 | u32 stationhigh; | 574 | u32 stationhigh; |
575 | u32 stationlow; | 575 | u32 stationlow; |
576 | int phy = physical_port[adapter->portnum]; | 576 | int phy = adapter->physical_port; |
577 | u8 val[8]; | 577 | u8 val[8]; |
578 | 578 | ||
579 | if (addr == NULL) | 579 | if (addr == NULL) |
@@ -604,7 +604,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter, | |||
604 | { | 604 | { |
605 | u8 temp[4]; | 605 | u8 temp[4]; |
606 | u32 val; | 606 | u32 val; |
607 | int phy = physical_port[adapter->portnum]; | 607 | int phy = adapter->physical_port; |
608 | unsigned char mac_addr[6]; | 608 | unsigned char mac_addr[6]; |
609 | int i; | 609 | int i; |
610 | DECLARE_MAC_BUF(mac); | 610 | DECLARE_MAC_BUF(mac); |
@@ -724,7 +724,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, | |||
724 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) | 724 | int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) |
725 | { | 725 | { |
726 | __u32 mac_cfg0; | 726 | __u32 mac_cfg0; |
727 | u32 port = physical_port[adapter->portnum]; | 727 | u32 port = adapter->physical_port; |
728 | 728 | ||
729 | if (port > NETXEN_NIU_MAX_GBE_PORTS) | 729 | if (port > NETXEN_NIU_MAX_GBE_PORTS) |
730 | return -EINVAL; | 730 | return -EINVAL; |
@@ -740,7 +740,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) | |||
740 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) | 740 | int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) |
741 | { | 741 | { |
742 | __u32 mac_cfg; | 742 | __u32 mac_cfg; |
743 | u32 port = physical_port[adapter->portnum]; | 743 | u32 port = adapter->physical_port; |
744 | 744 | ||
745 | if (port > NETXEN_NIU_MAX_XG_PORTS) | 745 | if (port > NETXEN_NIU_MAX_XG_PORTS) |
746 | return -EINVAL; | 746 | return -EINVAL; |
@@ -757,7 +757,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
757 | netxen_niu_prom_mode_t mode) | 757 | netxen_niu_prom_mode_t mode) |
758 | { | 758 | { |
759 | __u32 reg; | 759 | __u32 reg; |
760 | u32 port = physical_port[adapter->portnum]; | 760 | u32 port = adapter->physical_port; |
761 | 761 | ||
762 | if (port > NETXEN_NIU_MAX_GBE_PORTS) | 762 | if (port > NETXEN_NIU_MAX_GBE_PORTS) |
763 | return -EINVAL; | 763 | return -EINVAL; |
@@ -814,7 +814,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
814 | int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | 814 | int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, |
815 | netxen_ethernet_macaddr_t addr) | 815 | netxen_ethernet_macaddr_t addr) |
816 | { | 816 | { |
817 | int phy = physical_port[adapter->portnum]; | 817 | int phy = adapter->physical_port; |
818 | u8 temp[4]; | 818 | u8 temp[4]; |
819 | u32 val; | 819 | u32 val; |
820 | 820 | ||
@@ -867,7 +867,7 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, | |||
867 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, | 867 | int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, |
868 | netxen_ethernet_macaddr_t * addr) | 868 | netxen_ethernet_macaddr_t * addr) |
869 | { | 869 | { |
870 | int phy = physical_port[adapter->portnum]; | 870 | int phy = adapter->physical_port; |
871 | u32 stationhigh; | 871 | u32 stationhigh; |
872 | u32 stationlow; | 872 | u32 stationlow; |
873 | u8 val[8]; | 873 | u8 val[8]; |
@@ -896,7 +896,7 @@ int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, | |||
896 | netxen_niu_prom_mode_t mode) | 896 | netxen_niu_prom_mode_t mode) |
897 | { | 897 | { |
898 | __u32 reg; | 898 | __u32 reg; |
899 | u32 port = physical_port[adapter->portnum]; | 899 | u32 port = adapter->physical_port; |
900 | 900 | ||
901 | if (port > NETXEN_NIU_MAX_XG_PORTS) | 901 | if (port > NETXEN_NIU_MAX_XG_PORTS) |
902 | return -EINVAL; | 902 | return -EINVAL; |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 62436b3a18c6..c8a5ef2d75f4 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -118,6 +118,7 @@ static const struct pci_device_id sky2_id_table[] = { | |||
118 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, /* 88E8038 */ | 118 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, /* 88E8038 */ |
119 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ | 119 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ |
120 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ | 120 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ |
121 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4355) }, /* 88E8040T */ | ||
121 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ | 122 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ |
122 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */ | 123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */ |
123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ | 124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 0ce07a339c7e..7ab94c825b57 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -313,6 +313,21 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, | |||
313 | 313 | ||
314 | switch (tun->flags & TUN_TYPE_MASK) { | 314 | switch (tun->flags & TUN_TYPE_MASK) { |
315 | case TUN_TUN_DEV: | 315 | case TUN_TUN_DEV: |
316 | if (tun->flags & TUN_NO_PI) { | ||
317 | switch (skb->data[0] & 0xf0) { | ||
318 | case 0x40: | ||
319 | pi.proto = htons(ETH_P_IP); | ||
320 | break; | ||
321 | case 0x60: | ||
322 | pi.proto = htons(ETH_P_IPV6); | ||
323 | break; | ||
324 | default: | ||
325 | tun->dev->stats.rx_dropped++; | ||
326 | kfree_skb(skb); | ||
327 | return -EINVAL; | ||
328 | } | ||
329 | } | ||
330 | |||
316 | skb_reset_mac_header(skb); | 331 | skb_reset_mac_header(skb); |
317 | skb->protocol = pi.proto; | 332 | skb->protocol = pi.proto; |
318 | skb->dev = tun->dev; | 333 | skb->dev = tun->dev; |
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index dfa4bdd5597c..d3db298c05fc 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -630,7 +630,6 @@ struct b43_pio { | |||
630 | 630 | ||
631 | /* Context information for a noise calculation (Link Quality). */ | 631 | /* Context information for a noise calculation (Link Quality). */ |
632 | struct b43_noise_calculation { | 632 | struct b43_noise_calculation { |
633 | u8 channel_at_start; | ||
634 | bool calculation_running; | 633 | bool calculation_running; |
635 | u8 nr_samples; | 634 | u8 nr_samples; |
636 | s8 samples[8][4]; | 635 | s8 samples[8][4]; |
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 6dcbb3c87e72..e23f2f172bd7 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c | |||
@@ -795,24 +795,49 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, | |||
795 | { | 795 | { |
796 | struct b43_dmaring *ring; | 796 | struct b43_dmaring *ring; |
797 | int err; | 797 | int err; |
798 | int nr_slots; | ||
799 | dma_addr_t dma_test; | 798 | dma_addr_t dma_test; |
800 | 799 | ||
801 | ring = kzalloc(sizeof(*ring), GFP_KERNEL); | 800 | ring = kzalloc(sizeof(*ring), GFP_KERNEL); |
802 | if (!ring) | 801 | if (!ring) |
803 | goto out; | 802 | goto out; |
804 | ring->type = type; | ||
805 | 803 | ||
806 | nr_slots = B43_RXRING_SLOTS; | 804 | ring->nr_slots = B43_RXRING_SLOTS; |
807 | if (for_tx) | 805 | if (for_tx) |
808 | nr_slots = B43_TXRING_SLOTS; | 806 | ring->nr_slots = B43_TXRING_SLOTS; |
809 | 807 | ||
810 | ring->meta = kcalloc(nr_slots, sizeof(struct b43_dmadesc_meta), | 808 | ring->meta = kcalloc(ring->nr_slots, sizeof(struct b43_dmadesc_meta), |
811 | GFP_KERNEL); | 809 | GFP_KERNEL); |
812 | if (!ring->meta) | 810 | if (!ring->meta) |
813 | goto err_kfree_ring; | 811 | goto err_kfree_ring; |
812 | |||
813 | ring->type = type; | ||
814 | ring->dev = dev; | ||
815 | ring->mmio_base = b43_dmacontroller_base(type, controller_index); | ||
816 | ring->index = controller_index; | ||
817 | if (type == B43_DMA_64BIT) | ||
818 | ring->ops = &dma64_ops; | ||
819 | else | ||
820 | ring->ops = &dma32_ops; | ||
814 | if (for_tx) { | 821 | if (for_tx) { |
815 | ring->txhdr_cache = kcalloc(nr_slots, | 822 | ring->tx = 1; |
823 | ring->current_slot = -1; | ||
824 | } else { | ||
825 | if (ring->index == 0) { | ||
826 | ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE; | ||
827 | ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET; | ||
828 | } else if (ring->index == 3) { | ||
829 | ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE; | ||
830 | ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET; | ||
831 | } else | ||
832 | B43_WARN_ON(1); | ||
833 | } | ||
834 | spin_lock_init(&ring->lock); | ||
835 | #ifdef CONFIG_B43_DEBUG | ||
836 | ring->last_injected_overflow = jiffies; | ||
837 | #endif | ||
838 | |||
839 | if (for_tx) { | ||
840 | ring->txhdr_cache = kcalloc(ring->nr_slots, | ||
816 | b43_txhdr_size(dev), | 841 | b43_txhdr_size(dev), |
817 | GFP_KERNEL); | 842 | GFP_KERNEL); |
818 | if (!ring->txhdr_cache) | 843 | if (!ring->txhdr_cache) |
@@ -828,7 +853,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, | |||
828 | b43_txhdr_size(dev), 1)) { | 853 | b43_txhdr_size(dev), 1)) { |
829 | /* ugh realloc */ | 854 | /* ugh realloc */ |
830 | kfree(ring->txhdr_cache); | 855 | kfree(ring->txhdr_cache); |
831 | ring->txhdr_cache = kcalloc(nr_slots, | 856 | ring->txhdr_cache = kcalloc(ring->nr_slots, |
832 | b43_txhdr_size(dev), | 857 | b43_txhdr_size(dev), |
833 | GFP_KERNEL | GFP_DMA); | 858 | GFP_KERNEL | GFP_DMA); |
834 | if (!ring->txhdr_cache) | 859 | if (!ring->txhdr_cache) |
@@ -853,32 +878,6 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, | |||
853 | DMA_TO_DEVICE); | 878 | DMA_TO_DEVICE); |
854 | } | 879 | } |
855 | 880 | ||
856 | ring->dev = dev; | ||
857 | ring->nr_slots = nr_slots; | ||
858 | ring->mmio_base = b43_dmacontroller_base(type, controller_index); | ||
859 | ring->index = controller_index; | ||
860 | if (type == B43_DMA_64BIT) | ||
861 | ring->ops = &dma64_ops; | ||
862 | else | ||
863 | ring->ops = &dma32_ops; | ||
864 | if (for_tx) { | ||
865 | ring->tx = 1; | ||
866 | ring->current_slot = -1; | ||
867 | } else { | ||
868 | if (ring->index == 0) { | ||
869 | ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE; | ||
870 | ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET; | ||
871 | } else if (ring->index == 3) { | ||
872 | ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE; | ||
873 | ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET; | ||
874 | } else | ||
875 | B43_WARN_ON(1); | ||
876 | } | ||
877 | spin_lock_init(&ring->lock); | ||
878 | #ifdef CONFIG_B43_DEBUG | ||
879 | ring->last_injected_overflow = jiffies; | ||
880 | #endif | ||
881 | |||
882 | err = alloc_ringmemory(ring); | 881 | err = alloc_ringmemory(ring); |
883 | if (err) | 882 | if (err) |
884 | goto err_kfree_txhdr_cache; | 883 | goto err_kfree_txhdr_cache; |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 6c3d9ea0a9f8..fa4b0d8b74a2 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1145,7 +1145,6 @@ static void b43_generate_noise_sample(struct b43_wldev *dev) | |||
1145 | b43_jssi_write(dev, 0x7F7F7F7F); | 1145 | b43_jssi_write(dev, 0x7F7F7F7F); |
1146 | b43_write32(dev, B43_MMIO_MACCMD, | 1146 | b43_write32(dev, B43_MMIO_MACCMD, |
1147 | b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE); | 1147 | b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE); |
1148 | B43_WARN_ON(dev->noisecalc.channel_at_start != dev->phy.channel); | ||
1149 | } | 1148 | } |
1150 | 1149 | ||
1151 | static void b43_calculate_link_quality(struct b43_wldev *dev) | 1150 | static void b43_calculate_link_quality(struct b43_wldev *dev) |
@@ -1154,7 +1153,6 @@ static void b43_calculate_link_quality(struct b43_wldev *dev) | |||
1154 | 1153 | ||
1155 | if (dev->noisecalc.calculation_running) | 1154 | if (dev->noisecalc.calculation_running) |
1156 | return; | 1155 | return; |
1157 | dev->noisecalc.channel_at_start = dev->phy.channel; | ||
1158 | dev->noisecalc.calculation_running = 1; | 1156 | dev->noisecalc.calculation_running = 1; |
1159 | dev->noisecalc.nr_samples = 0; | 1157 | dev->noisecalc.nr_samples = 0; |
1160 | 1158 | ||
@@ -1171,9 +1169,16 @@ static void handle_irq_noise(struct b43_wldev *dev) | |||
1171 | 1169 | ||
1172 | /* Bottom half of Link Quality calculation. */ | 1170 | /* Bottom half of Link Quality calculation. */ |
1173 | 1171 | ||
1172 | /* Possible race condition: It might be possible that the user | ||
1173 | * changed to a different channel in the meantime since we | ||
1174 | * started the calculation. We ignore that fact, since it's | ||
1175 | * not really that much of a problem. The background noise is | ||
1176 | * an estimation only anyway. Slightly wrong results will get damped | ||
1177 | * by the averaging of the 8 sample rounds. Additionally the | ||
1178 | * value is shortlived. So it will be replaced by the next noise | ||
1179 | * calculation round soon. */ | ||
1180 | |||
1174 | B43_WARN_ON(!dev->noisecalc.calculation_running); | 1181 | B43_WARN_ON(!dev->noisecalc.calculation_running); |
1175 | if (dev->noisecalc.channel_at_start != phy->channel) | ||
1176 | goto drop_calculation; | ||
1177 | *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev)); | 1182 | *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev)); |
1178 | if (noise[0] == 0x7F || noise[1] == 0x7F || | 1183 | if (noise[0] == 0x7F || noise[1] == 0x7F || |
1179 | noise[2] == 0x7F || noise[3] == 0x7F) | 1184 | noise[2] == 0x7F || noise[3] == 0x7F) |
@@ -1214,11 +1219,10 @@ static void handle_irq_noise(struct b43_wldev *dev) | |||
1214 | average -= 48; | 1219 | average -= 48; |
1215 | 1220 | ||
1216 | dev->stats.link_noise = average; | 1221 | dev->stats.link_noise = average; |
1217 | drop_calculation: | ||
1218 | dev->noisecalc.calculation_running = 0; | 1222 | dev->noisecalc.calculation_running = 0; |
1219 | return; | 1223 | return; |
1220 | } | 1224 | } |
1221 | generate_new: | 1225 | generate_new: |
1222 | b43_generate_noise_sample(dev); | 1226 | b43_generate_noise_sample(dev); |
1223 | } | 1227 | } |
1224 | 1228 | ||
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index ab1029e79884..2d611876bbe0 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -32,12 +32,13 @@ config RT2X00_LIB_FIRMWARE | |||
32 | config RT2X00_LIB_RFKILL | 32 | config RT2X00_LIB_RFKILL |
33 | boolean | 33 | boolean |
34 | depends on RT2X00_LIB | 34 | depends on RT2X00_LIB |
35 | depends on INPUT | ||
35 | select RFKILL | 36 | select RFKILL |
36 | select INPUT_POLLDEV | 37 | select INPUT_POLLDEV |
37 | 38 | ||
38 | config RT2X00_LIB_LEDS | 39 | config RT2X00_LIB_LEDS |
39 | boolean | 40 | boolean |
40 | depends on RT2X00_LIB | 41 | depends on RT2X00_LIB && NEW_LEDS |
41 | 42 | ||
42 | config RT2400PCI | 43 | config RT2400PCI |
43 | tristate "Ralink rt2400 pci/pcmcia support" | 44 | tristate "Ralink rt2400 pci/pcmcia support" |
@@ -51,7 +52,7 @@ config RT2400PCI | |||
51 | 52 | ||
52 | config RT2400PCI_RFKILL | 53 | config RT2400PCI_RFKILL |
53 | bool "RT2400 rfkill support" | 54 | bool "RT2400 rfkill support" |
54 | depends on RT2400PCI | 55 | depends on RT2400PCI && INPUT |
55 | select RT2X00_LIB_RFKILL | 56 | select RT2X00_LIB_RFKILL |
56 | ---help--- | 57 | ---help--- |
57 | This adds support for integrated rt2400 devices that feature a | 58 | This adds support for integrated rt2400 devices that feature a |
@@ -60,7 +61,7 @@ config RT2400PCI_RFKILL | |||
60 | 61 | ||
61 | config RT2400PCI_LEDS | 62 | config RT2400PCI_LEDS |
62 | bool "RT2400 leds support" | 63 | bool "RT2400 leds support" |
63 | depends on RT2400PCI | 64 | depends on RT2400PCI && NEW_LEDS |
64 | select LEDS_CLASS | 65 | select LEDS_CLASS |
65 | select RT2X00_LIB_LEDS | 66 | select RT2X00_LIB_LEDS |
66 | ---help--- | 67 | ---help--- |
@@ -78,7 +79,7 @@ config RT2500PCI | |||
78 | 79 | ||
79 | config RT2500PCI_RFKILL | 80 | config RT2500PCI_RFKILL |
80 | bool "RT2500 rfkill support" | 81 | bool "RT2500 rfkill support" |
81 | depends on RT2500PCI | 82 | depends on RT2500PCI && INPUT |
82 | select RT2X00_LIB_RFKILL | 83 | select RT2X00_LIB_RFKILL |
83 | ---help--- | 84 | ---help--- |
84 | This adds support for integrated rt2500 devices that feature a | 85 | This adds support for integrated rt2500 devices that feature a |
@@ -87,7 +88,7 @@ config RT2500PCI_RFKILL | |||
87 | 88 | ||
88 | config RT2500PCI_LEDS | 89 | config RT2500PCI_LEDS |
89 | bool "RT2500 leds support" | 90 | bool "RT2500 leds support" |
90 | depends on RT2500PCI | 91 | depends on RT2500PCI && NEW_LEDS |
91 | select LEDS_CLASS | 92 | select LEDS_CLASS |
92 | select RT2X00_LIB_LEDS | 93 | select RT2X00_LIB_LEDS |
93 | ---help--- | 94 | ---help--- |
@@ -107,7 +108,7 @@ config RT61PCI | |||
107 | 108 | ||
108 | config RT61PCI_RFKILL | 109 | config RT61PCI_RFKILL |
109 | bool "RT61 rfkill support" | 110 | bool "RT61 rfkill support" |
110 | depends on RT61PCI | 111 | depends on RT61PCI && INPUT |
111 | select RT2X00_LIB_RFKILL | 112 | select RT2X00_LIB_RFKILL |
112 | ---help--- | 113 | ---help--- |
113 | This adds support for integrated rt61 devices that feature a | 114 | This adds support for integrated rt61 devices that feature a |
@@ -116,7 +117,7 @@ config RT61PCI_RFKILL | |||
116 | 117 | ||
117 | config RT61PCI_LEDS | 118 | config RT61PCI_LEDS |
118 | bool "RT61 leds support" | 119 | bool "RT61 leds support" |
119 | depends on RT61PCI | 120 | depends on RT61PCI && NEW_LEDS |
120 | select LEDS_CLASS | 121 | select LEDS_CLASS |
121 | select RT2X00_LIB_LEDS | 122 | select RT2X00_LIB_LEDS |
122 | ---help--- | 123 | ---help--- |
@@ -133,7 +134,7 @@ config RT2500USB | |||
133 | 134 | ||
134 | config RT2500USB_LEDS | 135 | config RT2500USB_LEDS |
135 | bool "RT2500 leds support" | 136 | bool "RT2500 leds support" |
136 | depends on RT2500USB | 137 | depends on RT2500USB && NEW_LEDS |
137 | select LEDS_CLASS | 138 | select LEDS_CLASS |
138 | select RT2X00_LIB_LEDS | 139 | select RT2X00_LIB_LEDS |
139 | ---help--- | 140 | ---help--- |
@@ -152,7 +153,7 @@ config RT73USB | |||
152 | 153 | ||
153 | config RT73USB_LEDS | 154 | config RT73USB_LEDS |
154 | bool "RT73 leds support" | 155 | bool "RT73 leds support" |
155 | depends on RT73USB | 156 | depends on RT73USB && NEW_LEDS |
156 | select LEDS_CLASS | 157 | select LEDS_CLASS |
157 | select RT2X00_LIB_LEDS | 158 | select RT2X00_LIB_LEDS |
158 | ---help--- | 159 | ---help--- |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 971af2546b59..60893de3bf8f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -412,8 +412,7 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) | |||
412 | if (pci_set_mwi(pci_dev)) | 412 | if (pci_set_mwi(pci_dev)) |
413 | ERROR_PROBE("MWI not available.\n"); | 413 | ERROR_PROBE("MWI not available.\n"); |
414 | 414 | ||
415 | if (pci_set_dma_mask(pci_dev, DMA_64BIT_MASK) && | 415 | if (pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) { |
416 | pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) { | ||
417 | ERROR_PROBE("PCI DMA not supported.\n"); | 416 | ERROR_PROBE("PCI DMA not supported.\n"); |
418 | retval = -EIO; | 417 | retval = -EIO; |
419 | goto exit_disable_device; | 418 | goto exit_disable_device; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 5a331674dcb2..e5ceae805b57 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -362,6 +362,12 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev) | |||
362 | } | 362 | } |
363 | } | 363 | } |
364 | 364 | ||
365 | /* | ||
366 | * Kill guardian urb (if required by driver). | ||
367 | */ | ||
368 | if (!test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags)) | ||
369 | return; | ||
370 | |||
365 | for (i = 0; i < rt2x00dev->bcn->limit; i++) { | 371 | for (i = 0; i < rt2x00dev->bcn->limit; i++) { |
366 | priv_bcn = rt2x00dev->bcn->entries[i].priv_data; | 372 | priv_bcn = rt2x00dev->bcn->entries[i].priv_data; |
367 | usb_kill_urb(priv_bcn->urb); | 373 | usb_kill_urb(priv_bcn->urb); |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index da19a3a91f4d..fff8386e816b 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2131,6 +2131,7 @@ static struct usb_device_id rt73usb_device_table[] = { | |||
2131 | /* D-Link */ | 2131 | /* D-Link */ |
2132 | { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, | 2132 | { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, |
2133 | { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, | 2133 | { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, |
2134 | { USB_DEVICE(0x07d1, 0x3c06), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2134 | { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) }, | 2135 | { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) }, |
2135 | /* Gemtek */ | 2136 | /* Gemtek */ |
2136 | { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) }, | 2137 | { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) }, |
diff --git a/drivers/scsi/dpt/dptsig.h b/drivers/scsi/dpt/dptsig.h index 72c8992fdf21..a6644b332b53 100644 --- a/drivers/scsi/dpt/dptsig.h +++ b/drivers/scsi/dpt/dptsig.h | |||
@@ -85,7 +85,7 @@ typedef unsigned int sigINT; | |||
85 | /* ------------------------------------------------------------------ */ | 85 | /* ------------------------------------------------------------------ */ |
86 | /* What type of processor the file is meant to run on. */ | 86 | /* What type of processor the file is meant to run on. */ |
87 | /* This will let us know whether to read sigWORDs as high/low or low/high. */ | 87 | /* This will let us know whether to read sigWORDs as high/low or low/high. */ |
88 | #define PROC_INTEL 0x00 /* Intel 80x86 */ | 88 | #define PROC_INTEL 0x00 /* Intel 80x86/ia64 */ |
89 | #define PROC_MOTOROLA 0x01 /* Motorola 68K */ | 89 | #define PROC_MOTOROLA 0x01 /* Motorola 68K */ |
90 | #define PROC_MIPS4000 0x02 /* MIPS RISC 4000 */ | 90 | #define PROC_MIPS4000 0x02 /* MIPS RISC 4000 */ |
91 | #define PROC_ALPHA 0x03 /* DEC Alpha */ | 91 | #define PROC_ALPHA 0x03 /* DEC Alpha */ |
@@ -104,6 +104,7 @@ typedef unsigned int sigINT; | |||
104 | #define PROC_486 0x08 /* Intel 80486 */ | 104 | #define PROC_486 0x08 /* Intel 80486 */ |
105 | #define PROC_PENTIUM 0x10 /* Intel 586 aka P5 aka Pentium */ | 105 | #define PROC_PENTIUM 0x10 /* Intel 586 aka P5 aka Pentium */ |
106 | #define PROC_SEXIUM 0x20 /* Intel 686 aka P6 aka Pentium Pro or MMX */ | 106 | #define PROC_SEXIUM 0x20 /* Intel 686 aka P6 aka Pentium Pro or MMX */ |
107 | #define PROC_IA64 0x40 /* Intel IA64 processor */ | ||
107 | 108 | ||
108 | /* PROC_i960: */ | 109 | /* PROC_i960: */ |
109 | #define PROC_960RX 0x01 /* Intel 80960RC/RD */ | 110 | #define PROC_960RX 0x01 /* Intel 80960RC/RD */ |
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 3690360d7a79..c6457bfc8a49 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -456,6 +456,10 @@ static int __scsi_host_match(struct device *dev, void *data) | |||
456 | * | 456 | * |
457 | * Return value: | 457 | * Return value: |
458 | * A pointer to located Scsi_Host or NULL. | 458 | * A pointer to located Scsi_Host or NULL. |
459 | * | ||
460 | * The caller must do a scsi_host_put() to drop the reference | ||
461 | * that scsi_host_get() took. The put_device() below dropped | ||
462 | * the reference from class_find_device(). | ||
459 | **/ | 463 | **/ |
460 | struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) | 464 | struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) |
461 | { | 465 | { |
@@ -463,9 +467,10 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) | |||
463 | struct Scsi_Host *shost = ERR_PTR(-ENXIO); | 467 | struct Scsi_Host *shost = ERR_PTR(-ENXIO); |
464 | 468 | ||
465 | cdev = class_find_device(&shost_class, &hostnum, __scsi_host_match); | 469 | cdev = class_find_device(&shost_class, &hostnum, __scsi_host_match); |
466 | if (cdev) | 470 | if (cdev) { |
467 | shost = scsi_host_get(class_to_shost(cdev)); | 471 | shost = scsi_host_get(class_to_shost(cdev)); |
468 | 472 | put_device(cdev); | |
473 | } | ||
469 | return shost; | 474 | return shost; |
470 | } | 475 | } |
471 | EXPORT_SYMBOL(scsi_host_lookup); | 476 | EXPORT_SYMBOL(scsi_host_lookup); |
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 7ee86d4a7618..c82df8bd4d89 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -178,6 +178,9 @@ int sr_test_unit_ready(struct scsi_device *sdev, struct scsi_sense_hdr *sshdr) | |||
178 | the_result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, | 178 | the_result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, |
179 | 0, sshdr, SR_TIMEOUT, | 179 | 0, sshdr, SR_TIMEOUT, |
180 | retries--); | 180 | retries--); |
181 | if (scsi_sense_valid(sshdr) && | ||
182 | sshdr->sense_key == UNIT_ATTENTION) | ||
183 | sdev->changed = 1; | ||
181 | 184 | ||
182 | } while (retries > 0 && | 185 | } while (retries > 0 && |
183 | (!scsi_status_is_good(the_result) || | 186 | (!scsi_status_is_good(the_result) || |
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index 7cf8851286b5..d184f2aea78d 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -1168,15 +1168,21 @@ EXPORT_SYMBOL(ssb_dma_translation); | |||
1168 | int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask) | 1168 | int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask) |
1169 | { | 1169 | { |
1170 | struct device *dma_dev = ssb_dev->dma_dev; | 1170 | struct device *dma_dev = ssb_dev->dma_dev; |
1171 | int err = 0; | ||
1171 | 1172 | ||
1172 | #ifdef CONFIG_SSB_PCIHOST | 1173 | #ifdef CONFIG_SSB_PCIHOST |
1173 | if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI) | 1174 | if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI) { |
1174 | return dma_set_mask(dma_dev, mask); | 1175 | err = pci_set_dma_mask(ssb_dev->bus->host_pci, mask); |
1176 | if (err) | ||
1177 | return err; | ||
1178 | err = pci_set_consistent_dma_mask(ssb_dev->bus->host_pci, mask); | ||
1179 | return err; | ||
1180 | } | ||
1175 | #endif | 1181 | #endif |
1176 | dma_dev->coherent_dma_mask = mask; | 1182 | dma_dev->coherent_dma_mask = mask; |
1177 | dma_dev->dma_mask = &dma_dev->coherent_dma_mask; | 1183 | dma_dev->dma_mask = &dma_dev->coherent_dma_mask; |
1178 | 1184 | ||
1179 | return 0; | 1185 | return err; |
1180 | } | 1186 | } |
1181 | EXPORT_SYMBOL(ssb_dma_set_mask); | 1187 | EXPORT_SYMBOL(ssb_dma_set_mask); |
1182 | 1188 | ||
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 3da1ab4b389d..c070b34b669d 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
@@ -47,6 +47,9 @@ static const struct usb_device_id usb_quirk_list[] = { | |||
47 | /* Edirol SD-20 */ | 47 | /* Edirol SD-20 */ |
48 | { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME }, | 48 | { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME }, |
49 | 49 | ||
50 | /* appletouch */ | ||
51 | { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME }, | ||
52 | |||
50 | /* Avision AV600U */ | 53 | /* Avision AV600U */ |
51 | { USB_DEVICE(0x0638, 0x0a13), .driver_info = | 54 | { USB_DEVICE(0x0638, 0x0a13), .driver_info = |
52 | USB_QUIRK_STRING_FETCH_255 }, | 55 | USB_QUIRK_STRING_FETCH_255 }, |
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 25b352b664d9..8662a6b7a30b 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile | |||
@@ -68,6 +68,7 @@ obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o | |||
68 | obj-$(CONFIG_I6300ESB_WDT) += i6300esb.o | 68 | obj-$(CONFIG_I6300ESB_WDT) += i6300esb.o |
69 | obj-$(CONFIG_ITCO_WDT) += iTCO_wdt.o iTCO_vendor_support.o | 69 | obj-$(CONFIG_ITCO_WDT) += iTCO_wdt.o iTCO_vendor_support.o |
70 | obj-$(CONFIG_IT8712F_WDT) += it8712f_wdt.o | 70 | obj-$(CONFIG_IT8712F_WDT) += it8712f_wdt.o |
71 | CFLAGS_hpwdt.o += -O | ||
71 | obj-$(CONFIG_HP_WATCHDOG) += hpwdt.o | 72 | obj-$(CONFIG_HP_WATCHDOG) += hpwdt.o |
72 | obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o | 73 | obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o |
73 | obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o | 74 | obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o |
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 6a63535fc04d..2686f3eaeedf 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -145,8 +145,8 @@ MODULE_DEVICE_TABLE(pci, hpwdt_devices); | |||
145 | 145 | ||
146 | #define HPWDT_ARCH 32 | 146 | #define HPWDT_ARCH 32 |
147 | 147 | ||
148 | static void asminline_call(struct cmn_registers *pi86Regs, | 148 | asmlinkage void asminline_call(struct cmn_registers *pi86Regs, |
149 | unsigned long *pRomEntry) | 149 | unsigned long *pRomEntry) |
150 | { | 150 | { |
151 | asm("pushl %ebp \n\t" | 151 | asm("pushl %ebp \n\t" |
152 | "movl %esp, %ebp \n\t" | 152 | "movl %esp, %ebp \n\t" |
@@ -333,8 +333,8 @@ static int __devinit detect_cru_service(void) | |||
333 | 333 | ||
334 | #define HPWDT_ARCH 64 | 334 | #define HPWDT_ARCH 64 |
335 | 335 | ||
336 | static void asminline_call(struct cmn_registers *pi86Regs, | 336 | asmlinkage void asminline_call(struct cmn_registers *pi86Regs, |
337 | unsigned long *pRomEntry) | 337 | unsigned long *pRomEntry) |
338 | { | 338 | { |
339 | asm("pushq %rbp \n\t" | 339 | asm("pushq %rbp \n\t" |
340 | "movq %rsp, %rbp \n\t" | 340 | "movq %rsp, %rbp \n\t" |
@@ -418,20 +418,23 @@ static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason, | |||
418 | static unsigned long rom_pl; | 418 | static unsigned long rom_pl; |
419 | static int die_nmi_called; | 419 | static int die_nmi_called; |
420 | 420 | ||
421 | if (ulReason == DIE_NMI || ulReason == DIE_NMI_IPI) { | 421 | if (ulReason != DIE_NMI && ulReason != DIE_NMI_IPI) |
422 | spin_lock_irqsave(&rom_lock, rom_pl); | 422 | return NOTIFY_OK; |
423 | if (!die_nmi_called) | 423 | |
424 | asminline_call(&cmn_regs, cru_rom_addr); | 424 | spin_lock_irqsave(&rom_lock, rom_pl); |
425 | die_nmi_called = 1; | 425 | if (!die_nmi_called) |
426 | spin_unlock_irqrestore(&rom_lock, rom_pl); | 426 | asminline_call(&cmn_regs, cru_rom_addr); |
427 | if (cmn_regs.u1.ral != 0) { | 427 | die_nmi_called = 1; |
428 | panic("An NMI occurred, please see the Integrated " | 428 | spin_unlock_irqrestore(&rom_lock, rom_pl); |
429 | "Management Log for details.\n"); | 429 | if (cmn_regs.u1.ral == 0) { |
430 | } | 430 | printk(KERN_WARNING "hpwdt: An NMI occurred, " |
431 | "but unable to determine source.\n"); | ||
432 | } else { | ||
433 | panic("An NMI occurred, please see the Integrated " | ||
434 | "Management Log for details.\n"); | ||
431 | } | 435 | } |
432 | 436 | ||
433 | die_nmi_called = 0; | 437 | return NOTIFY_STOP; |
434 | return NOTIFY_DONE; | ||
435 | } | 438 | } |
436 | 439 | ||
437 | /* | 440 | /* |