diff options
Diffstat (limited to 'drivers')
31 files changed, 451 insertions, 299 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index f08cca21702c..328ce8a08426 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -960,6 +960,13 @@ static int piix_broken_suspend(void) | |||
960 | }, | 960 | }, |
961 | }, | 961 | }, |
962 | { | 962 | { |
963 | .ident = "Satellite Pro U200", | ||
964 | .matches = { | ||
965 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
966 | DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE PRO U200"), | ||
967 | }, | ||
968 | }, | ||
969 | { | ||
963 | .ident = "Satellite U205", | 970 | .ident = "Satellite U205", |
964 | .matches = { | 971 | .matches = { |
965 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 972 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 08a52dd45fb6..545ea865ceb5 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
@@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm); | |||
312 | * | 312 | * |
313 | * RETURNS: | 313 | * RETURNS: |
314 | * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't | 314 | * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't |
315 | * contain valid data. -errno on other errors. | 315 | * contain valid data. |
316 | */ | 316 | */ |
317 | static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | 317 | static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, |
318 | void **ptr_to_free) | 318 | void **ptr_to_free) |
@@ -339,7 +339,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | |||
339 | ata_dev_printk(dev, KERN_WARNING, | 339 | ata_dev_printk(dev, KERN_WARNING, |
340 | "_GTF evaluation failed (AE 0x%x)\n", | 340 | "_GTF evaluation failed (AE 0x%x)\n", |
341 | status); | 341 | status); |
342 | rc = -EIO; | ||
343 | } | 342 | } |
344 | goto out_free; | 343 | goto out_free; |
345 | } | 344 | } |
@@ -359,7 +358,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | |||
359 | ata_dev_printk(dev, KERN_WARNING, | 358 | ata_dev_printk(dev, KERN_WARNING, |
360 | "_GTF unexpected object type 0x%x\n", | 359 | "_GTF unexpected object type 0x%x\n", |
361 | out_obj->type); | 360 | out_obj->type); |
362 | rc = -EINVAL; | ||
363 | goto out_free; | 361 | goto out_free; |
364 | } | 362 | } |
365 | 363 | ||
@@ -367,7 +365,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | |||
367 | ata_dev_printk(dev, KERN_WARNING, | 365 | ata_dev_printk(dev, KERN_WARNING, |
368 | "unexpected _GTF length (%d)\n", | 366 | "unexpected _GTF length (%d)\n", |
369 | out_obj->buffer.length); | 367 | out_obj->buffer.length); |
370 | rc = -EINVAL; | ||
371 | goto out_free; | 368 | goto out_free; |
372 | } | 369 | } |
373 | 370 | ||
@@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev) | |||
511 | int gtf_count, i, rc; | 508 | int gtf_count, i, rc; |
512 | 509 | ||
513 | /* get taskfiles */ | 510 | /* get taskfiles */ |
514 | rc = ata_dev_get_GTF(dev, >f, &ptr_to_free); | 511 | gtf_count = ata_dev_get_GTF(dev, >f, &ptr_to_free); |
515 | if (rc < 0) | ||
516 | return rc; | ||
517 | gtf_count = rc; | ||
518 | 512 | ||
519 | /* execute them */ | 513 | /* execute them */ |
520 | for (i = 0, rc = 0; i < gtf_count; i++) { | 514 | for (i = 0, rc = 0; i < gtf_count; i++) { |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index ec3ce120a517..81898036dbca 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -3373,14 +3373,20 @@ void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline) | |||
3373 | * to clear 0xff after reset. For example, HHD424020F7SV00 | 3373 | * to clear 0xff after reset. For example, HHD424020F7SV00 |
3374 | * iVDR needs >= 800ms while. Quantum GoVault needs even more | 3374 | * iVDR needs >= 800ms while. Quantum GoVault needs even more |
3375 | * than that. | 3375 | * than that. |
3376 | * | ||
3377 | * Note that some PATA controllers (pata_ali) explode if | ||
3378 | * status register is read more than once when there's no | ||
3379 | * device attached. | ||
3376 | */ | 3380 | */ |
3377 | while (1) { | 3381 | if (ap->flags & ATA_FLAG_SATA) { |
3378 | u8 status = ata_chk_status(ap); | 3382 | while (1) { |
3383 | u8 status = ata_chk_status(ap); | ||
3379 | 3384 | ||
3380 | if (status != 0xff || time_after(jiffies, deadline)) | 3385 | if (status != 0xff || time_after(jiffies, deadline)) |
3381 | return; | 3386 | return; |
3382 | 3387 | ||
3383 | msleep(50); | 3388 | msleep(50); |
3389 | } | ||
3384 | } | 3390 | } |
3385 | } | 3391 | } |
3386 | 3392 | ||
@@ -6821,19 +6827,6 @@ static void ata_host_release(struct device *gendev, void *res) | |||
6821 | if (!ap) | 6827 | if (!ap) |
6822 | continue; | 6828 | continue; |
6823 | 6829 | ||
6824 | if ((host->flags & ATA_HOST_STARTED) && ap->ops->port_stop) | ||
6825 | ap->ops->port_stop(ap); | ||
6826 | } | ||
6827 | |||
6828 | if ((host->flags & ATA_HOST_STARTED) && host->ops->host_stop) | ||
6829 | host->ops->host_stop(host); | ||
6830 | |||
6831 | for (i = 0; i < host->n_ports; i++) { | ||
6832 | struct ata_port *ap = host->ports[i]; | ||
6833 | |||
6834 | if (!ap) | ||
6835 | continue; | ||
6836 | |||
6837 | if (ap->scsi_host) | 6830 | if (ap->scsi_host) |
6838 | scsi_host_put(ap->scsi_host); | 6831 | scsi_host_put(ap->scsi_host); |
6839 | 6832 | ||
@@ -6960,6 +6953,24 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev, | |||
6960 | return host; | 6953 | return host; |
6961 | } | 6954 | } |
6962 | 6955 | ||
6956 | static void ata_host_stop(struct device *gendev, void *res) | ||
6957 | { | ||
6958 | struct ata_host *host = dev_get_drvdata(gendev); | ||
6959 | int i; | ||
6960 | |||
6961 | WARN_ON(!(host->flags & ATA_HOST_STARTED)); | ||
6962 | |||
6963 | for (i = 0; i < host->n_ports; i++) { | ||
6964 | struct ata_port *ap = host->ports[i]; | ||
6965 | |||
6966 | if (ap->ops->port_stop) | ||
6967 | ap->ops->port_stop(ap); | ||
6968 | } | ||
6969 | |||
6970 | if (host->ops->host_stop) | ||
6971 | host->ops->host_stop(host); | ||
6972 | } | ||
6973 | |||
6963 | /** | 6974 | /** |
6964 | * ata_host_start - start and freeze ports of an ATA host | 6975 | * ata_host_start - start and freeze ports of an ATA host |
6965 | * @host: ATA host to start ports for | 6976 | * @host: ATA host to start ports for |
@@ -6978,6 +6989,8 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev, | |||
6978 | */ | 6989 | */ |
6979 | int ata_host_start(struct ata_host *host) | 6990 | int ata_host_start(struct ata_host *host) |
6980 | { | 6991 | { |
6992 | int have_stop = 0; | ||
6993 | void *start_dr = NULL; | ||
6981 | int i, rc; | 6994 | int i, rc; |
6982 | 6995 | ||
6983 | if (host->flags & ATA_HOST_STARTED) | 6996 | if (host->flags & ATA_HOST_STARTED) |
@@ -6989,6 +7002,22 @@ int ata_host_start(struct ata_host *host) | |||
6989 | if (!host->ops && !ata_port_is_dummy(ap)) | 7002 | if (!host->ops && !ata_port_is_dummy(ap)) |
6990 | host->ops = ap->ops; | 7003 | host->ops = ap->ops; |
6991 | 7004 | ||
7005 | if (ap->ops->port_stop) | ||
7006 | have_stop = 1; | ||
7007 | } | ||
7008 | |||
7009 | if (host->ops->host_stop) | ||
7010 | have_stop = 1; | ||
7011 | |||
7012 | if (have_stop) { | ||
7013 | start_dr = devres_alloc(ata_host_stop, 0, GFP_KERNEL); | ||
7014 | if (!start_dr) | ||
7015 | return -ENOMEM; | ||
7016 | } | ||
7017 | |||
7018 | for (i = 0; i < host->n_ports; i++) { | ||
7019 | struct ata_port *ap = host->ports[i]; | ||
7020 | |||
6992 | if (ap->ops->port_start) { | 7021 | if (ap->ops->port_start) { |
6993 | rc = ap->ops->port_start(ap); | 7022 | rc = ap->ops->port_start(ap); |
6994 | if (rc) { | 7023 | if (rc) { |
@@ -7001,6 +7030,8 @@ int ata_host_start(struct ata_host *host) | |||
7001 | ata_eh_freeze_port(ap); | 7030 | ata_eh_freeze_port(ap); |
7002 | } | 7031 | } |
7003 | 7032 | ||
7033 | if (start_dr) | ||
7034 | devres_add(host->dev, start_dr); | ||
7004 | host->flags |= ATA_HOST_STARTED; | 7035 | host->flags |= ATA_HOST_STARTED; |
7005 | return 0; | 7036 | return 0; |
7006 | 7037 | ||
@@ -7011,6 +7042,7 @@ int ata_host_start(struct ata_host *host) | |||
7011 | if (ap->ops->port_stop) | 7042 | if (ap->ops->port_stop) |
7012 | ap->ops->port_stop(ap); | 7043 | ap->ops->port_stop(ap); |
7013 | } | 7044 | } |
7045 | devres_free(start_dr); | ||
7014 | return rc; | 7046 | return rc; |
7015 | } | 7047 | } |
7016 | 7048 | ||
@@ -7178,6 +7210,10 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) | |||
7178 | * request IRQ and register it. This helper takes necessasry | 7210 | * request IRQ and register it. This helper takes necessasry |
7179 | * arguments and performs the three steps in one go. | 7211 | * arguments and performs the three steps in one go. |
7180 | * | 7212 | * |
7213 | * An invalid IRQ skips the IRQ registration and expects the host to | ||
7214 | * have set polling mode on the port. In this case, @irq_handler | ||
7215 | * should be NULL. | ||
7216 | * | ||
7181 | * LOCKING: | 7217 | * LOCKING: |
7182 | * Inherited from calling layer (may sleep). | 7218 | * Inherited from calling layer (may sleep). |
7183 | * | 7219 | * |
@@ -7194,6 +7230,12 @@ int ata_host_activate(struct ata_host *host, int irq, | |||
7194 | if (rc) | 7230 | if (rc) |
7195 | return rc; | 7231 | return rc; |
7196 | 7232 | ||
7233 | /* Special case for polling mode */ | ||
7234 | if (!irq) { | ||
7235 | WARN_ON(irq_handler); | ||
7236 | return ata_host_register(host, sht); | ||
7237 | } | ||
7238 | |||
7197 | rc = devm_request_irq(host->dev, irq, irq_handler, irq_flags, | 7239 | rc = devm_request_irq(host->dev, irq, irq_handler, irq_flags, |
7198 | dev_driver_string(host->dev), host); | 7240 | dev_driver_string(host->dev), host); |
7199 | if (rc) | 7241 | if (rc) |
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index fc72a965643d..ac03a90a6168 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Generic platform device PATA driver | 2 | * Generic platform device PATA driver |
3 | * | 3 | * |
4 | * Copyright (C) 2006 Paul Mundt | 4 | * Copyright (C) 2006 - 2007 Paul Mundt |
5 | * | 5 | * |
6 | * Based on pata_pcmcia: | 6 | * Based on pata_pcmcia: |
7 | * | 7 | * |
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/pata_platform.h> | 22 | #include <linux/pata_platform.h> |
23 | 23 | ||
24 | #define DRV_NAME "pata_platform" | 24 | #define DRV_NAME "pata_platform" |
25 | #define DRV_VERSION "1.1" | 25 | #define DRV_VERSION "1.2" |
26 | 26 | ||
27 | static int pio_mask = 1; | 27 | static int pio_mask = 1; |
28 | 28 | ||
@@ -120,15 +120,20 @@ static void pata_platform_setup_port(struct ata_ioports *ioaddr, | |||
120 | * Register a platform bus IDE interface. Such interfaces are PIO and we | 120 | * Register a platform bus IDE interface. Such interfaces are PIO and we |
121 | * assume do not support IRQ sharing. | 121 | * assume do not support IRQ sharing. |
122 | * | 122 | * |
123 | * Platform devices are expected to contain 3 resources per port: | 123 | * Platform devices are expected to contain at least 2 resources per port: |
124 | * | 124 | * |
125 | * - I/O Base (IORESOURCE_IO or IORESOURCE_MEM) | 125 | * - I/O Base (IORESOURCE_IO or IORESOURCE_MEM) |
126 | * - CTL Base (IORESOURCE_IO or IORESOURCE_MEM) | 126 | * - CTL Base (IORESOURCE_IO or IORESOURCE_MEM) |
127 | * | ||
128 | * and optionally: | ||
129 | * | ||
127 | * - IRQ (IORESOURCE_IRQ) | 130 | * - IRQ (IORESOURCE_IRQ) |
128 | * | 131 | * |
129 | * If the base resources are both mem types, the ioremap() is handled | 132 | * If the base resources are both mem types, the ioremap() is handled |
130 | * here. For IORESOURCE_IO, it's assumed that there's no remapping | 133 | * here. For IORESOURCE_IO, it's assumed that there's no remapping |
131 | * necessary. | 134 | * necessary. |
135 | * | ||
136 | * If no IRQ resource is present, PIO polling mode is used instead. | ||
132 | */ | 137 | */ |
133 | static int __devinit pata_platform_probe(struct platform_device *pdev) | 138 | static int __devinit pata_platform_probe(struct platform_device *pdev) |
134 | { | 139 | { |
@@ -137,11 +142,12 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
137 | struct ata_port *ap; | 142 | struct ata_port *ap; |
138 | struct pata_platform_info *pp_info; | 143 | struct pata_platform_info *pp_info; |
139 | unsigned int mmio; | 144 | unsigned int mmio; |
145 | int irq; | ||
140 | 146 | ||
141 | /* | 147 | /* |
142 | * Simple resource validation .. | 148 | * Simple resource validation .. |
143 | */ | 149 | */ |
144 | if (unlikely(pdev->num_resources != 3)) { | 150 | if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) { |
145 | dev_err(&pdev->dev, "invalid number of resources\n"); | 151 | dev_err(&pdev->dev, "invalid number of resources\n"); |
146 | return -EINVAL; | 152 | return -EINVAL; |
147 | } | 153 | } |
@@ -173,6 +179,13 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
173 | (ctl_res->flags == IORESOURCE_MEM)); | 179 | (ctl_res->flags == IORESOURCE_MEM)); |
174 | 180 | ||
175 | /* | 181 | /* |
182 | * And the IRQ | ||
183 | */ | ||
184 | irq = platform_get_irq(pdev, 0); | ||
185 | if (irq < 0) | ||
186 | irq = 0; /* no irq */ | ||
187 | |||
188 | /* | ||
176 | * Now that that's out of the way, wire up the port.. | 189 | * Now that that's out of the way, wire up the port.. |
177 | */ | 190 | */ |
178 | host = ata_host_alloc(&pdev->dev, 1); | 191 | host = ata_host_alloc(&pdev->dev, 1); |
@@ -185,6 +198,14 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
185 | ap->flags |= ATA_FLAG_SLAVE_POSS; | 198 | ap->flags |= ATA_FLAG_SLAVE_POSS; |
186 | 199 | ||
187 | /* | 200 | /* |
201 | * Use polling mode if there's no IRQ | ||
202 | */ | ||
203 | if (!irq) { | ||
204 | ap->flags |= ATA_FLAG_PIO_POLLING; | ||
205 | ata_port_desc(ap, "no IRQ, using PIO polling"); | ||
206 | } | ||
207 | |||
208 | /* | ||
188 | * Handle the MMIO case | 209 | * Handle the MMIO case |
189 | */ | 210 | */ |
190 | if (mmio) { | 211 | if (mmio) { |
@@ -213,9 +234,9 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
213 | (unsigned long long)ctl_res->start); | 234 | (unsigned long long)ctl_res->start); |
214 | 235 | ||
215 | /* activate */ | 236 | /* activate */ |
216 | return ata_host_activate(host, platform_get_irq(pdev, 0), | 237 | return ata_host_activate(host, irq, irq ? ata_interrupt : NULL, |
217 | ata_interrupt, pp_info ? pp_info->irq_flags | 238 | pp_info ? pp_info->irq_flags : 0, |
218 | : 0, &pata_platform_sht); | 239 | &pata_platform_sht); |
219 | } | 240 | } |
220 | 241 | ||
221 | /** | 242 | /** |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 35b2df297527..44f9e5d9e362 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -1629,7 +1629,7 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class, | |||
1629 | 1629 | ||
1630 | /* SATA hardreset fails to retrieve proper device signature on | 1630 | /* SATA hardreset fails to retrieve proper device signature on |
1631 | * some controllers. Don't classify on hardreset. For more | 1631 | * some controllers. Don't classify on hardreset. For more |
1632 | * info, see http://bugme.osdl.org/show_bug.cgi?id=3352 | 1632 | * info, see http://bugzilla.kernel.org/show_bug.cgi?id=3352 |
1633 | */ | 1633 | */ |
1634 | return sata_std_hardreset(link, &dummy, deadline); | 1634 | return sata_std_hardreset(link, &dummy, deadline); |
1635 | } | 1635 | } |
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c index 6d43ba79e154..2f1de6ec044c 100644 --- a/drivers/ata/sata_qstor.c +++ b/drivers/ata/sata_qstor.c | |||
@@ -103,7 +103,7 @@ enum { | |||
103 | QS_DMA_BOUNDARY = ~0UL | 103 | QS_DMA_BOUNDARY = ~0UL |
104 | }; | 104 | }; |
105 | 105 | ||
106 | typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t; | 106 | typedef enum { qs_state_mmio, qs_state_pkt } qs_state_t; |
107 | 107 | ||
108 | struct qs_port_priv { | 108 | struct qs_port_priv { |
109 | u8 *pkt; | 109 | u8 *pkt; |
@@ -116,14 +116,15 @@ static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val); | |||
116 | static int qs_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); | 116 | static int qs_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
117 | static int qs_port_start(struct ata_port *ap); | 117 | static int qs_port_start(struct ata_port *ap); |
118 | static void qs_host_stop(struct ata_host *host); | 118 | static void qs_host_stop(struct ata_host *host); |
119 | static void qs_phy_reset(struct ata_port *ap); | ||
120 | static void qs_qc_prep(struct ata_queued_cmd *qc); | 119 | static void qs_qc_prep(struct ata_queued_cmd *qc); |
121 | static unsigned int qs_qc_issue(struct ata_queued_cmd *qc); | 120 | static unsigned int qs_qc_issue(struct ata_queued_cmd *qc); |
122 | static int qs_check_atapi_dma(struct ata_queued_cmd *qc); | 121 | static int qs_check_atapi_dma(struct ata_queued_cmd *qc); |
123 | static void qs_bmdma_stop(struct ata_queued_cmd *qc); | 122 | static void qs_bmdma_stop(struct ata_queued_cmd *qc); |
124 | static u8 qs_bmdma_status(struct ata_port *ap); | 123 | static u8 qs_bmdma_status(struct ata_port *ap); |
125 | static void qs_irq_clear(struct ata_port *ap); | 124 | static void qs_irq_clear(struct ata_port *ap); |
126 | static void qs_eng_timeout(struct ata_port *ap); | 125 | static void qs_freeze(struct ata_port *ap); |
126 | static void qs_thaw(struct ata_port *ap); | ||
127 | static void qs_error_handler(struct ata_port *ap); | ||
127 | 128 | ||
128 | static struct scsi_host_template qs_ata_sht = { | 129 | static struct scsi_host_template qs_ata_sht = { |
129 | .module = THIS_MODULE, | 130 | .module = THIS_MODULE, |
@@ -150,11 +151,12 @@ static const struct ata_port_operations qs_ata_ops = { | |||
150 | .check_atapi_dma = qs_check_atapi_dma, | 151 | .check_atapi_dma = qs_check_atapi_dma, |
151 | .exec_command = ata_exec_command, | 152 | .exec_command = ata_exec_command, |
152 | .dev_select = ata_std_dev_select, | 153 | .dev_select = ata_std_dev_select, |
153 | .phy_reset = qs_phy_reset, | ||
154 | .qc_prep = qs_qc_prep, | 154 | .qc_prep = qs_qc_prep, |
155 | .qc_issue = qs_qc_issue, | 155 | .qc_issue = qs_qc_issue, |
156 | .data_xfer = ata_data_xfer, | 156 | .data_xfer = ata_data_xfer, |
157 | .eng_timeout = qs_eng_timeout, | 157 | .freeze = qs_freeze, |
158 | .thaw = qs_thaw, | ||
159 | .error_handler = qs_error_handler, | ||
158 | .irq_clear = qs_irq_clear, | 160 | .irq_clear = qs_irq_clear, |
159 | .irq_on = ata_irq_on, | 161 | .irq_on = ata_irq_on, |
160 | .scr_read = qs_scr_read, | 162 | .scr_read = qs_scr_read, |
@@ -169,8 +171,6 @@ static const struct ata_port_info qs_port_info[] = { | |||
169 | /* board_2068_idx */ | 171 | /* board_2068_idx */ |
170 | { | 172 | { |
171 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 173 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
172 | ATA_FLAG_SATA_RESET | | ||
173 | //FIXME ATA_FLAG_SRST | | ||
174 | ATA_FLAG_MMIO | ATA_FLAG_PIO_POLLING, | 174 | ATA_FLAG_MMIO | ATA_FLAG_PIO_POLLING, |
175 | .pio_mask = 0x10, /* pio4 */ | 175 | .pio_mask = 0x10, /* pio4 */ |
176 | .udma_mask = ATA_UDMA6, | 176 | .udma_mask = ATA_UDMA6, |
@@ -219,7 +219,9 @@ static void qs_irq_clear(struct ata_port *ap) | |||
219 | static inline void qs_enter_reg_mode(struct ata_port *ap) | 219 | static inline void qs_enter_reg_mode(struct ata_port *ap) |
220 | { | 220 | { |
221 | u8 __iomem *chan = qs_mmio_base(ap->host) + (ap->port_no * 0x4000); | 221 | u8 __iomem *chan = qs_mmio_base(ap->host) + (ap->port_no * 0x4000); |
222 | struct qs_port_priv *pp = ap->private_data; | ||
222 | 223 | ||
224 | pp->state = qs_state_mmio; | ||
223 | writeb(QS_CTR0_REG, chan + QS_CCT_CTR0); | 225 | writeb(QS_CTR0_REG, chan + QS_CCT_CTR0); |
224 | readb(chan + QS_CCT_CTR0); /* flush */ | 226 | readb(chan + QS_CCT_CTR0); /* flush */ |
225 | } | 227 | } |
@@ -233,23 +235,28 @@ static inline void qs_reset_channel_logic(struct ata_port *ap) | |||
233 | qs_enter_reg_mode(ap); | 235 | qs_enter_reg_mode(ap); |
234 | } | 236 | } |
235 | 237 | ||
236 | static void qs_phy_reset(struct ata_port *ap) | 238 | static void qs_freeze(struct ata_port *ap) |
237 | { | 239 | { |
238 | struct qs_port_priv *pp = ap->private_data; | 240 | u8 __iomem *mmio_base = qs_mmio_base(ap->host); |
239 | 241 | ||
240 | pp->state = qs_state_idle; | 242 | writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */ |
241 | qs_reset_channel_logic(ap); | 243 | qs_enter_reg_mode(ap); |
242 | sata_phy_reset(ap); | ||
243 | } | 244 | } |
244 | 245 | ||
245 | static void qs_eng_timeout(struct ata_port *ap) | 246 | static void qs_thaw(struct ata_port *ap) |
246 | { | 247 | { |
247 | struct qs_port_priv *pp = ap->private_data; | 248 | u8 __iomem *mmio_base = qs_mmio_base(ap->host); |
249 | |||
250 | qs_enter_reg_mode(ap); | ||
251 | writeb(1, mmio_base + QS_HCT_CTRL); /* enable host interrupts */ | ||
252 | } | ||
253 | |||
254 | static int qs_prereset(struct ata_link *link, unsigned long deadline) | ||
255 | { | ||
256 | struct ata_port *ap = link->ap; | ||
248 | 257 | ||
249 | if (pp->state != qs_state_idle) /* healthy paranoia */ | ||
250 | pp->state = qs_state_mmio; | ||
251 | qs_reset_channel_logic(ap); | 258 | qs_reset_channel_logic(ap); |
252 | ata_eng_timeout(ap); | 259 | return ata_std_prereset(link, deadline); |
253 | } | 260 | } |
254 | 261 | ||
255 | static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | 262 | static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) |
@@ -260,6 +267,13 @@ static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | |||
260 | return 0; | 267 | return 0; |
261 | } | 268 | } |
262 | 269 | ||
270 | static void qs_error_handler(struct ata_port *ap) | ||
271 | { | ||
272 | qs_enter_reg_mode(ap); | ||
273 | ata_do_eh(ap, qs_prereset, ata_std_softreset, NULL, | ||
274 | ata_std_postreset); | ||
275 | } | ||
276 | |||
263 | static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val) | 277 | static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val) |
264 | { | 278 | { |
265 | if (sc_reg > SCR_CONTROL) | 279 | if (sc_reg > SCR_CONTROL) |
@@ -358,7 +372,6 @@ static unsigned int qs_qc_issue(struct ata_queued_cmd *qc) | |||
358 | 372 | ||
359 | switch (qc->tf.protocol) { | 373 | switch (qc->tf.protocol) { |
360 | case ATA_PROT_DMA: | 374 | case ATA_PROT_DMA: |
361 | |||
362 | pp->state = qs_state_pkt; | 375 | pp->state = qs_state_pkt; |
363 | qs_packet_start(qc); | 376 | qs_packet_start(qc); |
364 | return 0; | 377 | return 0; |
@@ -375,6 +388,26 @@ static unsigned int qs_qc_issue(struct ata_queued_cmd *qc) | |||
375 | return ata_qc_issue_prot(qc); | 388 | return ata_qc_issue_prot(qc); |
376 | } | 389 | } |
377 | 390 | ||
391 | static void qs_do_or_die(struct ata_queued_cmd *qc, u8 status) | ||
392 | { | ||
393 | qc->err_mask |= ac_err_mask(status); | ||
394 | |||
395 | if (!qc->err_mask) { | ||
396 | ata_qc_complete(qc); | ||
397 | } else { | ||
398 | struct ata_port *ap = qc->ap; | ||
399 | struct ata_eh_info *ehi = &ap->link.eh_info; | ||
400 | |||
401 | ata_ehi_clear_desc(ehi); | ||
402 | ata_ehi_push_desc(ehi, "status 0x%02X", status); | ||
403 | |||
404 | if (qc->err_mask == AC_ERR_DEV) | ||
405 | ata_port_abort(ap); | ||
406 | else | ||
407 | ata_port_freeze(ap); | ||
408 | } | ||
409 | } | ||
410 | |||
378 | static inline unsigned int qs_intr_pkt(struct ata_host *host) | 411 | static inline unsigned int qs_intr_pkt(struct ata_host *host) |
379 | { | 412 | { |
380 | unsigned int handled = 0; | 413 | unsigned int handled = 0; |
@@ -406,10 +439,8 @@ static inline unsigned int qs_intr_pkt(struct ata_host *host) | |||
406 | switch (sHST) { | 439 | switch (sHST) { |
407 | case 0: /* successful CPB */ | 440 | case 0: /* successful CPB */ |
408 | case 3: /* device error */ | 441 | case 3: /* device error */ |
409 | pp->state = qs_state_idle; | ||
410 | qs_enter_reg_mode(qc->ap); | 442 | qs_enter_reg_mode(qc->ap); |
411 | qc->err_mask |= ac_err_mask(sDST); | 443 | qs_do_or_die(qc, sDST); |
412 | ata_qc_complete(qc); | ||
413 | break; | 444 | break; |
414 | default: | 445 | default: |
415 | break; | 446 | break; |
@@ -431,25 +462,27 @@ static inline unsigned int qs_intr_mmio(struct ata_host *host) | |||
431 | if (ap && | 462 | if (ap && |
432 | !(ap->flags & ATA_FLAG_DISABLED)) { | 463 | !(ap->flags & ATA_FLAG_DISABLED)) { |
433 | struct ata_queued_cmd *qc; | 464 | struct ata_queued_cmd *qc; |
434 | struct qs_port_priv *pp = ap->private_data; | 465 | struct qs_port_priv *pp; |
435 | if (!pp || pp->state != qs_state_mmio) | ||
436 | continue; | ||
437 | qc = ata_qc_from_tag(ap, ap->link.active_tag); | 466 | qc = ata_qc_from_tag(ap, ap->link.active_tag); |
438 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) { | 467 | if (!qc || !(qc->flags & ATA_QCFLAG_ACTIVE)) { |
439 | 468 | /* | |
440 | /* check main status, clearing INTRQ */ | 469 | * The qstor hardware generates spurious |
441 | u8 status = ata_check_status(ap); | 470 | * interrupts from time to time when switching |
442 | if ((status & ATA_BUSY)) | 471 | * in and out of packet mode. |
443 | continue; | 472 | * There's no obvious way to know if we're |
444 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", | 473 | * here now due to that, so just ack the irq |
445 | ap->print_id, qc->tf.protocol, status); | 474 | * and pretend we knew it was ours.. (ugh). |
446 | 475 | * This does not affect packet mode. | |
447 | /* complete taskfile transaction */ | 476 | */ |
448 | pp->state = qs_state_idle; | 477 | ata_check_status(ap); |
449 | qc->err_mask |= ac_err_mask(status); | ||
450 | ata_qc_complete(qc); | ||
451 | handled = 1; | 478 | handled = 1; |
479 | continue; | ||
452 | } | 480 | } |
481 | pp = ap->private_data; | ||
482 | if (!pp || pp->state != qs_state_mmio) | ||
483 | continue; | ||
484 | if (!(qc->tf.flags & ATA_TFLAG_POLLING)) | ||
485 | handled |= ata_host_intr(ap, qc); | ||
453 | } | 486 | } |
454 | } | 487 | } |
455 | return handled; | 488 | return handled; |
@@ -459,12 +492,13 @@ static irqreturn_t qs_intr(int irq, void *dev_instance) | |||
459 | { | 492 | { |
460 | struct ata_host *host = dev_instance; | 493 | struct ata_host *host = dev_instance; |
461 | unsigned int handled = 0; | 494 | unsigned int handled = 0; |
495 | unsigned long flags; | ||
462 | 496 | ||
463 | VPRINTK("ENTER\n"); | 497 | VPRINTK("ENTER\n"); |
464 | 498 | ||
465 | spin_lock(&host->lock); | 499 | spin_lock_irqsave(&host->lock, flags); |
466 | handled = qs_intr_pkt(host) | qs_intr_mmio(host); | 500 | handled = qs_intr_pkt(host) | qs_intr_mmio(host); |
467 | spin_unlock(&host->lock); | 501 | spin_unlock_irqrestore(&host->lock, flags); |
468 | 502 | ||
469 | VPRINTK("EXIT\n"); | 503 | VPRINTK("EXIT\n"); |
470 | 504 | ||
@@ -501,7 +535,6 @@ static int qs_port_start(struct ata_port *ap) | |||
501 | rc = ata_port_start(ap); | 535 | rc = ata_port_start(ap); |
502 | if (rc) | 536 | if (rc) |
503 | return rc; | 537 | return rc; |
504 | qs_enter_reg_mode(ap); | ||
505 | pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); | 538 | pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); |
506 | if (!pp) | 539 | if (!pp) |
507 | return -ENOMEM; | 540 | return -ENOMEM; |
@@ -512,6 +545,7 @@ static int qs_port_start(struct ata_port *ap) | |||
512 | memset(pp->pkt, 0, QS_PKT_BYTES); | 545 | memset(pp->pkt, 0, QS_PKT_BYTES); |
513 | ap->private_data = pp; | 546 | ap->private_data = pp; |
514 | 547 | ||
548 | qs_enter_reg_mode(ap); | ||
515 | addr = (u64)pp->pkt_dma; | 549 | addr = (u64)pp->pkt_dma; |
516 | writel((u32) addr, chan + QS_CCF_CPBA); | 550 | writel((u32) addr, chan + QS_CCF_CPBA); |
517 | writel((u32)(addr >> 32), chan + QS_CCF_CPBA + 4); | 551 | writel((u32)(addr >> 32), chan + QS_CCF_CPBA + 4); |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index cb581ebbe3c5..bf8890ebbc4c 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -235,7 +235,7 @@ source "drivers/net/arm/Kconfig" | |||
235 | 235 | ||
236 | config AX88796 | 236 | config AX88796 |
237 | tristate "ASIX AX88796 NE2000 clone support" | 237 | tristate "ASIX AX88796 NE2000 clone support" |
238 | depends on ARM || MIPS | 238 | depends on ARM || MIPS || SUPERH |
239 | select CRC32 | 239 | select CRC32 |
240 | select MII | 240 | select MII |
241 | help | 241 | help |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6937ef0e7275..a198404a3e36 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4405,6 +4405,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
4405 | bond_dev->set_multicast_list = bond_set_multicast_list; | 4405 | bond_dev->set_multicast_list = bond_set_multicast_list; |
4406 | bond_dev->change_mtu = bond_change_mtu; | 4406 | bond_dev->change_mtu = bond_change_mtu; |
4407 | bond_dev->set_mac_address = bond_set_mac_address; | 4407 | bond_dev->set_mac_address = bond_set_mac_address; |
4408 | bond_dev->validate_addr = NULL; | ||
4408 | 4409 | ||
4409 | bond_set_mode_ops(bond, bond->params.mode); | 4410 | bond_set_mode_ops(bond, bond->params.mode); |
4410 | 4411 | ||
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 7a06ade85b02..b29330d8e309 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -1193,8 +1193,6 @@ static ssize_t bonding_show_active_slave(struct device *d, | |||
1193 | struct bonding *bond = to_bond(d); | 1193 | struct bonding *bond = to_bond(d); |
1194 | int count; | 1194 | int count; |
1195 | 1195 | ||
1196 | rtnl_lock(); | ||
1197 | |||
1198 | read_lock(&bond->curr_slave_lock); | 1196 | read_lock(&bond->curr_slave_lock); |
1199 | curr = bond->curr_active_slave; | 1197 | curr = bond->curr_active_slave; |
1200 | read_unlock(&bond->curr_slave_lock); | 1198 | read_unlock(&bond->curr_slave_lock); |
@@ -1216,7 +1214,9 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1216 | struct slave *new_active = NULL; | 1214 | struct slave *new_active = NULL; |
1217 | struct bonding *bond = to_bond(d); | 1215 | struct bonding *bond = to_bond(d); |
1218 | 1216 | ||
1217 | rtnl_lock(); | ||
1219 | write_lock_bh(&bond->lock); | 1218 | write_lock_bh(&bond->lock); |
1219 | |||
1220 | if (!USES_PRIMARY(bond->params.mode)) { | 1220 | if (!USES_PRIMARY(bond->params.mode)) { |
1221 | printk(KERN_INFO DRV_NAME | 1221 | printk(KERN_INFO DRV_NAME |
1222 | ": %s: Unable to change active slave; %s is in mode %d\n", | 1222 | ": %s: Unable to change active slave; %s is in mode %d\n", |
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index ab4d309a858f..09b4fde8d924 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -580,6 +580,16 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
580 | 580 | ||
581 | len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S; | 581 | len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S; |
582 | 582 | ||
583 | pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE); | ||
584 | |||
585 | if (macrx & XCT_MACRX_CRC) { | ||
586 | /* CRC error flagged */ | ||
587 | mac->netdev->stats.rx_errors++; | ||
588 | mac->netdev->stats.rx_crc_errors++; | ||
589 | dev_kfree_skb_irq(skb); | ||
590 | goto next; | ||
591 | } | ||
592 | |||
583 | if (len < 256) { | 593 | if (len < 256) { |
584 | struct sk_buff *new_skb; | 594 | struct sk_buff *new_skb; |
585 | 595 | ||
@@ -595,11 +605,10 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
595 | } else | 605 | } else |
596 | info->skb = NULL; | 606 | info->skb = NULL; |
597 | 607 | ||
598 | pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE); | ||
599 | |||
600 | info->dma = 0; | 608 | info->dma = 0; |
601 | 609 | ||
602 | skb_put(skb, len); | 610 | /* Don't include CRC */ |
611 | skb_put(skb, len-4); | ||
603 | 612 | ||
604 | if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) { | 613 | if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) { |
605 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 614 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
@@ -614,6 +623,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
614 | skb->protocol = eth_type_trans(skb, mac->netdev); | 623 | skb->protocol = eth_type_trans(skb, mac->netdev); |
615 | netif_receive_skb(skb); | 624 | netif_receive_skb(skb); |
616 | 625 | ||
626 | next: | ||
617 | RX_RING(mac, n) = 0; | 627 | RX_RING(mac, n) = 0; |
618 | RX_RING(mac, n+1) = 0; | 628 | RX_RING(mac, n+1) = 0; |
619 | 629 | ||
@@ -1126,7 +1136,7 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1126 | unsigned long flags; | 1136 | unsigned long flags; |
1127 | int i, nfrags; | 1137 | int i, nfrags; |
1128 | 1138 | ||
1129 | dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_SS | XCT_MACTX_CRC_PAD; | 1139 | dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_CRC_PAD; |
1130 | 1140 | ||
1131 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1141 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1132 | const unsigned char *nh = skb_network_header(skb); | 1142 | const unsigned char *nh = skb_network_header(skb); |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 30adf726743c..a5791114b7bd 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -1456,16 +1456,11 @@ static void ql_phy_start_neg_ex(struct ql3_adapter *qdev) | |||
1456 | PHYAddr[qdev->mac_index]); | 1456 | PHYAddr[qdev->mac_index]); |
1457 | reg &= ~PHY_GIG_ALL_PARAMS; | 1457 | reg &= ~PHY_GIG_ALL_PARAMS; |
1458 | 1458 | ||
1459 | if(portConfiguration & | 1459 | if(portConfiguration & PORT_CONFIG_1000MB_SPEED) { |
1460 | PORT_CONFIG_FULL_DUPLEX_ENABLED & | 1460 | if(portConfiguration & PORT_CONFIG_FULL_DUPLEX_ENABLED) |
1461 | PORT_CONFIG_1000MB_SPEED) { | 1461 | reg |= PHY_GIG_ADV_1000F; |
1462 | reg |= PHY_GIG_ADV_1000F; | 1462 | else |
1463 | } | 1463 | reg |= PHY_GIG_ADV_1000H; |
1464 | |||
1465 | if(portConfiguration & | ||
1466 | PORT_CONFIG_HALF_DUPLEX_ENABLED & | ||
1467 | PORT_CONFIG_1000MB_SPEED) { | ||
1468 | reg |= PHY_GIG_ADV_1000H; | ||
1469 | } | 1464 | } |
1470 | 1465 | ||
1471 | ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg, | 1466 | ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg, |
@@ -1645,8 +1640,11 @@ static int ql_finish_auto_neg(struct ql3_adapter *qdev) | |||
1645 | return 0; | 1640 | return 0; |
1646 | } | 1641 | } |
1647 | 1642 | ||
1648 | static void ql_link_state_machine(struct ql3_adapter *qdev) | 1643 | static void ql_link_state_machine_work(struct work_struct *work) |
1649 | { | 1644 | { |
1645 | struct ql3_adapter *qdev = | ||
1646 | container_of(work, struct ql3_adapter, link_state_work.work); | ||
1647 | |||
1650 | u32 curr_link_state; | 1648 | u32 curr_link_state; |
1651 | unsigned long hw_flags; | 1649 | unsigned long hw_flags; |
1652 | 1650 | ||
@@ -1661,6 +1659,10 @@ static void ql_link_state_machine(struct ql3_adapter *qdev) | |||
1661 | "state.\n", qdev->ndev->name); | 1659 | "state.\n", qdev->ndev->name); |
1662 | 1660 | ||
1663 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1661 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
1662 | |||
1663 | /* Restart timer on 2 second interval. */ | ||
1664 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1);\ | ||
1665 | |||
1664 | return; | 1666 | return; |
1665 | } | 1667 | } |
1666 | 1668 | ||
@@ -1705,6 +1707,9 @@ static void ql_link_state_machine(struct ql3_adapter *qdev) | |||
1705 | break; | 1707 | break; |
1706 | } | 1708 | } |
1707 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1709 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
1710 | |||
1711 | /* Restart timer on 2 second interval. */ | ||
1712 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1); | ||
1708 | } | 1713 | } |
1709 | 1714 | ||
1710 | /* | 1715 | /* |
@@ -3941,19 +3946,7 @@ static void ql_get_board_info(struct ql3_adapter *qdev) | |||
3941 | static void ql3xxx_timer(unsigned long ptr) | 3946 | static void ql3xxx_timer(unsigned long ptr) |
3942 | { | 3947 | { |
3943 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; | 3948 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; |
3944 | 3949 | queue_delayed_work(qdev->workqueue, &qdev->link_state_work, 0); | |
3945 | if (test_bit(QL_RESET_ACTIVE,&qdev->flags)) { | ||
3946 | printk(KERN_DEBUG PFX | ||
3947 | "%s: Reset in progress.\n", | ||
3948 | qdev->ndev->name); | ||
3949 | goto end; | ||
3950 | } | ||
3951 | |||
3952 | ql_link_state_machine(qdev); | ||
3953 | |||
3954 | /* Restart timer on 2 second interval. */ | ||
3955 | end: | ||
3956 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1); | ||
3957 | } | 3950 | } |
3958 | 3951 | ||
3959 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, | 3952 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, |
@@ -4103,6 +4096,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev, | |||
4103 | qdev->workqueue = create_singlethread_workqueue(ndev->name); | 4096 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
4104 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); | 4097 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); |
4105 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); | 4098 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); |
4099 | INIT_DELAYED_WORK(&qdev->link_state_work, ql_link_state_machine_work); | ||
4106 | 4100 | ||
4107 | init_timer(&qdev->adapter_timer); | 4101 | init_timer(&qdev->adapter_timer); |
4108 | qdev->adapter_timer.function = ql3xxx_timer; | 4102 | qdev->adapter_timer.function = ql3xxx_timer; |
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index fbcb0b949639..d0ffb30ef371 100644 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h | |||
@@ -1286,6 +1286,7 @@ struct ql3_adapter { | |||
1286 | struct workqueue_struct *workqueue; | 1286 | struct workqueue_struct *workqueue; |
1287 | struct delayed_work reset_work; | 1287 | struct delayed_work reset_work; |
1288 | struct delayed_work tx_timeout_work; | 1288 | struct delayed_work tx_timeout_work; |
1289 | struct delayed_work link_state_work; | ||
1289 | u32 max_frame_size; | 1290 | u32 max_frame_size; |
1290 | u32 device_id; | 1291 | u32 device_id; |
1291 | u16 phyType; | 1292 | u16 phyType; |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index b94fa7ef1955..1f647b9ce352 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -171,6 +171,8 @@ static struct pci_device_id rtl8169_pci_tbl[] = { | |||
171 | { PCI_DEVICE(0x16ec, 0x0116), 0, 0, RTL_CFG_0 }, | 171 | { PCI_DEVICE(0x16ec, 0x0116), 0, 0, RTL_CFG_0 }, |
172 | { PCI_VENDOR_ID_LINKSYS, 0x1032, | 172 | { PCI_VENDOR_ID_LINKSYS, 0x1032, |
173 | PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 }, | 173 | PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 }, |
174 | { 0x0001, 0x8168, | ||
175 | PCI_ANY_ID, 0x2410, 0, 0, RTL_CFG_2 }, | ||
174 | {0,}, | 176 | {0,}, |
175 | }; | 177 | }; |
176 | 178 | ||
@@ -468,7 +470,7 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value) | |||
468 | { | 470 | { |
469 | int i; | 471 | int i; |
470 | 472 | ||
471 | RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0xFF) << 16 | value); | 473 | RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0x1f) << 16 | (value & 0xffff)); |
472 | 474 | ||
473 | for (i = 20; i > 0; i--) { | 475 | for (i = 20; i > 0; i--) { |
474 | /* | 476 | /* |
@@ -485,7 +487,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) | |||
485 | { | 487 | { |
486 | int i, value = -1; | 488 | int i, value = -1; |
487 | 489 | ||
488 | RTL_W32(PHYAR, 0x0 | (reg_addr & 0xFF) << 16); | 490 | RTL_W32(PHYAR, 0x0 | (reg_addr & 0x1f) << 16); |
489 | 491 | ||
490 | for (i = 20; i > 0; i--) { | 492 | for (i = 20; i > 0; i--) { |
491 | /* | 493 | /* |
@@ -493,7 +495,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) | |||
493 | * the specified MII register. | 495 | * the specified MII register. |
494 | */ | 496 | */ |
495 | if (RTL_R32(PHYAR) & 0x80000000) { | 497 | if (RTL_R32(PHYAR) & 0x80000000) { |
496 | value = (int) (RTL_R32(PHYAR) & 0xFFFF); | 498 | value = RTL_R32(PHYAR) & 0xffff; |
497 | break; | 499 | break; |
498 | } | 500 | } |
499 | udelay(25); | 501 | udelay(25); |
@@ -1245,16 +1247,6 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr) | |||
1245 | 1247 | ||
1246 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | 1248 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); |
1247 | } | 1249 | } |
1248 | static void rtl8168b_hw_phy_config(void __iomem *ioaddr) | ||
1249 | { | ||
1250 | struct phy_reg phy_reg_init[] = { | ||
1251 | { 0x1f, 0x0000 }, | ||
1252 | { 0x10, 0xf41b }, | ||
1253 | { 0x1f, 0x0000 } | ||
1254 | }; | ||
1255 | |||
1256 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | ||
1257 | } | ||
1258 | 1250 | ||
1259 | static void rtl8168cp_hw_phy_config(void __iomem *ioaddr) | 1251 | static void rtl8168cp_hw_phy_config(void __iomem *ioaddr) |
1260 | { | 1252 | { |
@@ -1324,11 +1316,6 @@ static void rtl_hw_phy_config(struct net_device *dev) | |||
1324 | case RTL_GIGA_MAC_VER_04: | 1316 | case RTL_GIGA_MAC_VER_04: |
1325 | rtl8169sb_hw_phy_config(ioaddr); | 1317 | rtl8169sb_hw_phy_config(ioaddr); |
1326 | break; | 1318 | break; |
1327 | case RTL_GIGA_MAC_VER_11: | ||
1328 | case RTL_GIGA_MAC_VER_12: | ||
1329 | case RTL_GIGA_MAC_VER_17: | ||
1330 | rtl8168b_hw_phy_config(ioaddr); | ||
1331 | break; | ||
1332 | case RTL_GIGA_MAC_VER_18: | 1319 | case RTL_GIGA_MAC_VER_18: |
1333 | rtl8168cp_hw_phy_config(ioaddr); | 1320 | rtl8168cp_hw_phy_config(ioaddr); |
1334 | break; | 1321 | break; |
@@ -1739,7 +1726,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1739 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); | 1726 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); |
1740 | RTL_W8(Cfg9346, Cfg9346_Lock); | 1727 | RTL_W8(Cfg9346, Cfg9346_Lock); |
1741 | 1728 | ||
1742 | if (RTL_R8(PHYstatus) & TBI_Enable) { | 1729 | if ((tp->mac_version <= RTL_GIGA_MAC_VER_06) && |
1730 | (RTL_R8(PHYstatus) & TBI_Enable)) { | ||
1743 | tp->set_speed = rtl8169_set_speed_tbi; | 1731 | tp->set_speed = rtl8169_set_speed_tbi; |
1744 | tp->get_settings = rtl8169_gset_tbi; | 1732 | tp->get_settings = rtl8169_gset_tbi; |
1745 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; | 1733 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index c27c7d63b6a5..a2070db725c9 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -52,7 +52,7 @@ | |||
52 | #include "sky2.h" | 52 | #include "sky2.h" |
53 | 53 | ||
54 | #define DRV_NAME "sky2" | 54 | #define DRV_NAME "sky2" |
55 | #define DRV_VERSION "1.19" | 55 | #define DRV_VERSION "1.20" |
56 | #define PFX DRV_NAME " " | 56 | #define PFX DRV_NAME " " |
57 | 57 | ||
58 | /* | 58 | /* |
@@ -121,6 +121,7 @@ static const struct pci_device_id sky2_id_table[] = { | |||
121 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ | 121 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ |
122 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ | 122 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ |
123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ | 123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ |
124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */ | ||
124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ | 125 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ |
125 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, /* 88E8052 */ | 126 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, /* 88E8052 */ |
126 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ | 127 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ |
@@ -134,6 +135,7 @@ static const struct pci_device_id sky2_id_table[] = { | |||
134 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */ | 135 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */ |
135 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */ | 136 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */ |
136 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */ | 137 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */ |
138 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */ | ||
137 | { 0 } | 139 | { 0 } |
138 | }; | 140 | }; |
139 | 141 | ||
@@ -156,7 +158,7 @@ static const char *yukon2_name[] = { | |||
156 | 158 | ||
157 | static void sky2_set_multicast(struct net_device *dev); | 159 | static void sky2_set_multicast(struct net_device *dev); |
158 | 160 | ||
159 | /* Access to external PHY */ | 161 | /* Access to PHY via serial interconnect */ |
160 | static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) | 162 | static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) |
161 | { | 163 | { |
162 | int i; | 164 | int i; |
@@ -166,13 +168,22 @@ static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) | |||
166 | GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg)); | 168 | GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg)); |
167 | 169 | ||
168 | for (i = 0; i < PHY_RETRIES; i++) { | 170 | for (i = 0; i < PHY_RETRIES; i++) { |
169 | if (!(gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) | 171 | u16 ctrl = gma_read16(hw, port, GM_SMI_CTRL); |
172 | if (ctrl == 0xffff) | ||
173 | goto io_error; | ||
174 | |||
175 | if (!(ctrl & GM_SMI_CT_BUSY)) | ||
170 | return 0; | 176 | return 0; |
171 | udelay(1); | 177 | |
178 | udelay(10); | ||
172 | } | 179 | } |
173 | 180 | ||
174 | printk(KERN_WARNING PFX "%s: phy write timeout\n", hw->dev[port]->name); | 181 | dev_warn(&hw->pdev->dev,"%s: phy write timeout\n", hw->dev[port]->name); |
175 | return -ETIMEDOUT; | 182 | return -ETIMEDOUT; |
183 | |||
184 | io_error: | ||
185 | dev_err(&hw->pdev->dev, "%s: phy I/O error\n", hw->dev[port]->name); | ||
186 | return -EIO; | ||
176 | } | 187 | } |
177 | 188 | ||
178 | static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) | 189 | static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) |
@@ -183,23 +194,29 @@ static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) | |||
183 | | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); | 194 | | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); |
184 | 195 | ||
185 | for (i = 0; i < PHY_RETRIES; i++) { | 196 | for (i = 0; i < PHY_RETRIES; i++) { |
186 | if (gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) { | 197 | u16 ctrl = gma_read16(hw, port, GM_SMI_CTRL); |
198 | if (ctrl == 0xffff) | ||
199 | goto io_error; | ||
200 | |||
201 | if (ctrl & GM_SMI_CT_RD_VAL) { | ||
187 | *val = gma_read16(hw, port, GM_SMI_DATA); | 202 | *val = gma_read16(hw, port, GM_SMI_DATA); |
188 | return 0; | 203 | return 0; |
189 | } | 204 | } |
190 | 205 | ||
191 | udelay(1); | 206 | udelay(10); |
192 | } | 207 | } |
193 | 208 | ||
209 | dev_warn(&hw->pdev->dev, "%s: phy read timeout\n", hw->dev[port]->name); | ||
194 | return -ETIMEDOUT; | 210 | return -ETIMEDOUT; |
211 | io_error: | ||
212 | dev_err(&hw->pdev->dev, "%s: phy I/O error\n", hw->dev[port]->name); | ||
213 | return -EIO; | ||
195 | } | 214 | } |
196 | 215 | ||
197 | static u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg) | 216 | static inline u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg) |
198 | { | 217 | { |
199 | u16 v; | 218 | u16 v; |
200 | 219 | __gm_phy_read(hw, port, reg, &v); | |
201 | if (__gm_phy_read(hw, port, reg, &v) != 0) | ||
202 | printk(KERN_WARNING PFX "%s: phy read timeout\n", hw->dev[port]->name); | ||
203 | return v; | 220 | return v; |
204 | } | 221 | } |
205 | 222 | ||
@@ -273,8 +290,6 @@ static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port) | |||
273 | 290 | ||
274 | /* disable all GMAC IRQ's */ | 291 | /* disable all GMAC IRQ's */ |
275 | sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); | 292 | sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); |
276 | /* disable PHY IRQs */ | ||
277 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); | ||
278 | 293 | ||
279 | gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ | 294 | gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ |
280 | gma_write16(hw, port, GM_MC_ADDR_H2, 0); | 295 | gma_write16(hw, port, GM_MC_ADDR_H2, 0); |
@@ -1805,29 +1820,6 @@ static void sky2_link_up(struct sky2_port *sky2) | |||
1805 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), | 1820 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), |
1806 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); | 1821 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); |
1807 | 1822 | ||
1808 | if (hw->flags & SKY2_HW_NEWER_PHY) { | ||
1809 | u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); | ||
1810 | u16 led = PHY_M_LEDC_LOS_CTRL(1); /* link active */ | ||
1811 | |||
1812 | switch(sky2->speed) { | ||
1813 | case SPEED_10: | ||
1814 | led |= PHY_M_LEDC_INIT_CTRL(7); | ||
1815 | break; | ||
1816 | |||
1817 | case SPEED_100: | ||
1818 | led |= PHY_M_LEDC_STA1_CTRL(7); | ||
1819 | break; | ||
1820 | |||
1821 | case SPEED_1000: | ||
1822 | led |= PHY_M_LEDC_STA0_CTRL(7); | ||
1823 | break; | ||
1824 | } | ||
1825 | |||
1826 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); | ||
1827 | gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, led); | ||
1828 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); | ||
1829 | } | ||
1830 | |||
1831 | if (netif_msg_link(sky2)) | 1823 | if (netif_msg_link(sky2)) |
1832 | printk(KERN_INFO PFX | 1824 | printk(KERN_INFO PFX |
1833 | "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", | 1825 | "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", |
@@ -2247,20 +2239,26 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2247 | do { | 2239 | do { |
2248 | struct sky2_port *sky2; | 2240 | struct sky2_port *sky2; |
2249 | struct sky2_status_le *le = hw->st_le + hw->st_idx; | 2241 | struct sky2_status_le *le = hw->st_le + hw->st_idx; |
2250 | unsigned port = le->css & CSS_LINK_BIT; | 2242 | unsigned port; |
2251 | struct net_device *dev; | 2243 | struct net_device *dev; |
2252 | struct sk_buff *skb; | 2244 | struct sk_buff *skb; |
2253 | u32 status; | 2245 | u32 status; |
2254 | u16 length; | 2246 | u16 length; |
2247 | u8 opcode = le->opcode; | ||
2248 | |||
2249 | if (!(opcode & HW_OWNER)) | ||
2250 | break; | ||
2255 | 2251 | ||
2256 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); | 2252 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); |
2257 | 2253 | ||
2254 | port = le->css & CSS_LINK_BIT; | ||
2258 | dev = hw->dev[port]; | 2255 | dev = hw->dev[port]; |
2259 | sky2 = netdev_priv(dev); | 2256 | sky2 = netdev_priv(dev); |
2260 | length = le16_to_cpu(le->length); | 2257 | length = le16_to_cpu(le->length); |
2261 | status = le32_to_cpu(le->status); | 2258 | status = le32_to_cpu(le->status); |
2262 | 2259 | ||
2263 | switch (le->opcode & ~HW_OWNER) { | 2260 | le->opcode = 0; |
2261 | switch (opcode & ~HW_OWNER) { | ||
2264 | case OP_RXSTAT: | 2262 | case OP_RXSTAT: |
2265 | ++rx[port]; | 2263 | ++rx[port]; |
2266 | skb = sky2_receive(dev, length, status); | 2264 | skb = sky2_receive(dev, length, status); |
@@ -2353,7 +2351,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
2353 | default: | 2351 | default: |
2354 | if (net_ratelimit()) | 2352 | if (net_ratelimit()) |
2355 | printk(KERN_WARNING PFX | 2353 | printk(KERN_WARNING PFX |
2356 | "unknown status opcode 0x%x\n", le->opcode); | 2354 | "unknown status opcode 0x%x\n", opcode); |
2357 | } | 2355 | } |
2358 | } while (hw->st_idx != idx); | 2356 | } while (hw->st_idx != idx); |
2359 | 2357 | ||
@@ -2439,13 +2437,26 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
2439 | 2437 | ||
2440 | if (status & Y2_IS_PCI_EXP) { | 2438 | if (status & Y2_IS_PCI_EXP) { |
2441 | /* PCI-Express uncorrectable Error occurred */ | 2439 | /* PCI-Express uncorrectable Error occurred */ |
2442 | int pos = pci_find_aer_capability(hw->pdev); | 2440 | int aer = pci_find_aer_capability(hw->pdev); |
2443 | u32 err; | 2441 | u32 err; |
2444 | 2442 | ||
2445 | pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_STATUS, &err); | 2443 | if (aer) { |
2444 | pci_read_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS, | ||
2445 | &err); | ||
2446 | pci_cleanup_aer_uncorrect_error_status(pdev); | ||
2447 | } else { | ||
2448 | /* Either AER not configured, or not working | ||
2449 | * because of bad MMCONFIG, so just do recover | ||
2450 | * manually. | ||
2451 | */ | ||
2452 | err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); | ||
2453 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, | ||
2454 | 0xfffffffful); | ||
2455 | } | ||
2456 | |||
2446 | if (net_ratelimit()) | 2457 | if (net_ratelimit()) |
2447 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); | 2458 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); |
2448 | pci_cleanup_aer_uncorrect_error_status(pdev); | 2459 | |
2449 | } | 2460 | } |
2450 | 2461 | ||
2451 | if (status & Y2_HWE_L1_MASK) | 2462 | if (status & Y2_HWE_L1_MASK) |
@@ -2791,6 +2802,9 @@ static void sky2_reset(struct sky2_hw *hw) | |||
2791 | sky2_write8(hw, B0_CTST, CS_RST_SET); | 2802 | sky2_write8(hw, B0_CTST, CS_RST_SET); |
2792 | sky2_write8(hw, B0_CTST, CS_RST_CLR); | 2803 | sky2_write8(hw, B0_CTST, CS_RST_CLR); |
2793 | 2804 | ||
2805 | /* allow writes to PCI config */ | ||
2806 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
2807 | |||
2794 | /* clear PCI errors, if any */ | 2808 | /* clear PCI errors, if any */ |
2795 | pci_read_config_word(pdev, PCI_STATUS, &status); | 2809 | pci_read_config_word(pdev, PCI_STATUS, &status); |
2796 | status |= PCI_STATUS_ERROR_BITS; | 2810 | status |= PCI_STATUS_ERROR_BITS; |
@@ -2800,9 +2814,18 @@ static void sky2_reset(struct sky2_hw *hw) | |||
2800 | 2814 | ||
2801 | cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 2815 | cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); |
2802 | if (cap) { | 2816 | if (cap) { |
2803 | /* Check for advanced error reporting */ | 2817 | if (pci_find_aer_capability(pdev)) { |
2804 | pci_cleanup_aer_uncorrect_error_status(pdev); | 2818 | /* Check for advanced error reporting */ |
2805 | pci_cleanup_aer_correct_error_status(pdev); | 2819 | pci_cleanup_aer_uncorrect_error_status(pdev); |
2820 | pci_cleanup_aer_correct_error_status(pdev); | ||
2821 | } else { | ||
2822 | dev_warn(&pdev->dev, | ||
2823 | "PCI Express Advanced Error Reporting" | ||
2824 | " not configured or MMCONFIG problem?\n"); | ||
2825 | |||
2826 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, | ||
2827 | 0xfffffffful); | ||
2828 | } | ||
2806 | 2829 | ||
2807 | /* If error bit is stuck on ignore it */ | 2830 | /* If error bit is stuck on ignore it */ |
2808 | if (sky2_read32(hw, B0_HWE_ISRC) & Y2_IS_PCI_EXP) | 2831 | if (sky2_read32(hw, B0_HWE_ISRC) & Y2_IS_PCI_EXP) |
@@ -3974,7 +3997,8 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, | |||
3974 | dev->tx_timeout = sky2_tx_timeout; | 3997 | dev->tx_timeout = sky2_tx_timeout; |
3975 | dev->watchdog_timeo = TX_WATCHDOG; | 3998 | dev->watchdog_timeo = TX_WATCHDOG; |
3976 | #ifdef CONFIG_NET_POLL_CONTROLLER | 3999 | #ifdef CONFIG_NET_POLL_CONTROLLER |
3977 | dev->poll_controller = sky2_netpoll; | 4000 | if (port == 0) |
4001 | dev->poll_controller = sky2_netpoll; | ||
3978 | #endif | 4002 | #endif |
3979 | 4003 | ||
3980 | sky2 = netdev_priv(dev); | 4004 | sky2 = netdev_priv(dev); |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 49ee264064ab..69525fd7908d 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -247,7 +247,8 @@ enum csr_regs { | |||
247 | B3_PA_CTRL = 0x01f0, | 247 | B3_PA_CTRL = 0x01f0, |
248 | B3_PA_TEST = 0x01f2, | 248 | B3_PA_TEST = 0x01f2, |
249 | 249 | ||
250 | Y2_CFG_SPC = 0x1c00, | 250 | Y2_CFG_SPC = 0x1c00, /* PCI config space region */ |
251 | Y2_CFG_AER = 0x1d00, /* PCI Advanced Error Report region */ | ||
251 | }; | 252 | }; |
252 | 253 | ||
253 | /* B0_CTST 16 bit Control/Status register */ | 254 | /* B0_CTST 16 bit Control/Status register */ |
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 729fd28c08b5..db34e1eb67e9 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
@@ -224,6 +224,21 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | #elif defined(CONFIG_MACH_ZYLONITE) | ||
228 | |||
229 | #define SMC_CAN_USE_8BIT 1 | ||
230 | #define SMC_CAN_USE_16BIT 1 | ||
231 | #define SMC_CAN_USE_32BIT 0 | ||
232 | #define SMC_IO_SHIFT 0 | ||
233 | #define SMC_NOWAIT 1 | ||
234 | #define SMC_USE_PXA_DMA 1 | ||
235 | #define SMC_inb(a, r) readb((a) + (r)) | ||
236 | #define SMC_inw(a, r) readw((a) + (r)) | ||
237 | #define SMC_insw(a, r, p, l) insw((a) + (r), p, l) | ||
238 | #define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) | ||
239 | #define SMC_outb(v, a, r) writeb(v, (a) + (r)) | ||
240 | #define SMC_outw(v, a, r) writew(v, (a) + (r)) | ||
241 | |||
227 | #elif defined(CONFIG_ARCH_OMAP) | 242 | #elif defined(CONFIG_ARCH_OMAP) |
228 | 243 | ||
229 | /* We can only do 16-bit reads and writes in the static memory space. */ | 244 | /* We can only do 16-bit reads and writes in the static memory space. */ |
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index dae5c8d5a318..2b733c582915 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -325,7 +325,7 @@ config HERMES | |||
325 | Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya, | 325 | Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya, |
326 | IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear | 326 | IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear |
327 | MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel | 327 | MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel |
328 | PRO/Wireless, and Symbol Spectrum24 High Rate amongst others. | 328 | IPW2011, and Symbol Spectrum24 High Rate amongst others. |
329 | 329 | ||
330 | This option includes the guts of the driver, but in order to | 330 | This option includes the guts of the driver, but in order to |
331 | actually use a card you will also need to enable support for PCMCIA | 331 | actually use a card you will also need to enable support for PCMCIA |
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig index e3c573e56b63..fdbc351ac333 100644 --- a/drivers/net/wireless/b43/Kconfig +++ b/drivers/net/wireless/b43/Kconfig | |||
@@ -61,16 +61,18 @@ config B43_PCMCIA | |||
61 | 61 | ||
62 | If unsure, say N. | 62 | If unsure, say N. |
63 | 63 | ||
64 | # LED support | 64 | # This config option automatically enables b43 LEDS support, |
65 | # if it's possible. | ||
65 | config B43_LEDS | 66 | config B43_LEDS |
66 | bool | 67 | bool |
67 | depends on B43 && MAC80211_LEDS | 68 | depends on B43 && MAC80211_LEDS && (LEDS_CLASS = y || LEDS_CLASS = B43) |
68 | default y | 69 | default y |
69 | 70 | ||
70 | # RFKILL support | 71 | # This config option automatically enables b43 RFKILL support, |
72 | # if it's possible. | ||
71 | config B43_RFKILL | 73 | config B43_RFKILL |
72 | bool | 74 | bool |
73 | depends on B43 && RFKILL && RFKILL_INPUT && INPUT_POLLDEV | 75 | depends on B43 && (RFKILL = y || RFKILL = B43) && RFKILL_INPUT && (INPUT_POLLDEV = y || INPUT_POLLDEV = B43) |
74 | default y | 76 | default y |
75 | 77 | ||
76 | config B43_DEBUG | 78 | config B43_DEBUG |
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c index 734e70e1a06d..ef0075d9f9cb 100644 --- a/drivers/net/wireless/b43/debugfs.c +++ b/drivers/net/wireless/b43/debugfs.c | |||
@@ -128,7 +128,7 @@ static ssize_t shm_read_file(struct b43_wldev *dev, | |||
128 | __le16 *le16buf = (__le16 *)buf; | 128 | __le16 *le16buf = (__le16 *)buf; |
129 | 129 | ||
130 | for (i = 0; i < 0x1000; i++) { | 130 | for (i = 0; i < 0x1000; i++) { |
131 | if (bufsize <= 0) | 131 | if (bufsize < sizeof(tmp)) |
132 | break; | 132 | break; |
133 | tmp = b43_shm_read16(dev, B43_SHM_SHARED, 2 * i); | 133 | tmp = b43_shm_read16(dev, B43_SHM_SHARED, 2 * i); |
134 | le16buf[i] = cpu_to_le16(tmp); | 134 | le16buf[i] = cpu_to_le16(tmp); |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 5058e60e5703..2b17c1dc46f1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -2985,6 +2985,16 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) | |||
2985 | 2985 | ||
2986 | if (b43_status(dev) < B43_STAT_STARTED) | 2986 | if (b43_status(dev) < B43_STAT_STARTED) |
2987 | return; | 2987 | return; |
2988 | |||
2989 | /* Disable and sync interrupts. We must do this before than | ||
2990 | * setting the status to INITIALIZED, as the interrupt handler | ||
2991 | * won't care about IRQs then. */ | ||
2992 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
2993 | dev->irq_savedstate = b43_interrupt_disable(dev, B43_IRQ_ALL); | ||
2994 | b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* flush */ | ||
2995 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
2996 | b43_synchronize_irq(dev); | ||
2997 | |||
2988 | b43_set_status(dev, B43_STAT_INITIALIZED); | 2998 | b43_set_status(dev, B43_STAT_INITIALIZED); |
2989 | 2999 | ||
2990 | mutex_unlock(&wl->mutex); | 3000 | mutex_unlock(&wl->mutex); |
@@ -2995,13 +3005,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) | |||
2995 | 3005 | ||
2996 | ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy. | 3006 | ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy. |
2997 | 3007 | ||
2998 | /* Disable and sync interrupts. */ | ||
2999 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
3000 | dev->irq_savedstate = b43_interrupt_disable(dev, B43_IRQ_ALL); | ||
3001 | b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* flush */ | ||
3002 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
3003 | b43_synchronize_irq(dev); | ||
3004 | |||
3005 | b43_mac_suspend(dev); | 3008 | b43_mac_suspend(dev); |
3006 | free_irq(dev->dev->irq, dev); | 3009 | free_irq(dev->dev->irq, dev); |
3007 | b43dbg(wl, "Wireless interface stopped\n"); | 3010 | b43dbg(wl, "Wireless interface stopped\n"); |
@@ -3661,7 +3664,6 @@ static int b43_setup_modes(struct b43_wldev *dev, | |||
3661 | 3664 | ||
3662 | static void b43_wireless_core_detach(struct b43_wldev *dev) | 3665 | static void b43_wireless_core_detach(struct b43_wldev *dev) |
3663 | { | 3666 | { |
3664 | b43_rfkill_free(dev); | ||
3665 | /* We release firmware that late to not be required to re-request | 3667 | /* We release firmware that late to not be required to re-request |
3666 | * is all the time when we reinit the core. */ | 3668 | * is all the time when we reinit the core. */ |
3667 | b43_release_firmware(dev); | 3669 | b43_release_firmware(dev); |
@@ -3747,7 +3749,6 @@ static int b43_wireless_core_attach(struct b43_wldev *dev) | |||
3747 | if (!wl->current_dev) | 3749 | if (!wl->current_dev) |
3748 | wl->current_dev = dev; | 3750 | wl->current_dev = dev; |
3749 | INIT_WORK(&dev->restart_work, b43_chip_reset); | 3751 | INIT_WORK(&dev->restart_work, b43_chip_reset); |
3750 | b43_rfkill_alloc(dev); | ||
3751 | 3752 | ||
3752 | b43_radio_turn_off(dev, 1); | 3753 | b43_radio_turn_off(dev, 1); |
3753 | b43_switch_analog(dev, 0); | 3754 | b43_switch_analog(dev, 0); |
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index b242a9a90dd2..b79a6bd5396d 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
@@ -65,12 +65,12 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
65 | tuple_t tuple; | 65 | tuple_t tuple; |
66 | cisparse_t parse; | 66 | cisparse_t parse; |
67 | int err = -ENOMEM; | 67 | int err = -ENOMEM; |
68 | int res; | 68 | int res = 0; |
69 | unsigned char buf[64]; | 69 | unsigned char buf[64]; |
70 | 70 | ||
71 | ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); | 71 | ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); |
72 | if (!ssb) | 72 | if (!ssb) |
73 | goto out; | 73 | goto out_error; |
74 | 74 | ||
75 | err = -ENODEV; | 75 | err = -ENODEV; |
76 | tuple.DesiredTuple = CISTPL_CONFIG; | 76 | tuple.DesiredTuple = CISTPL_CONFIG; |
@@ -96,10 +96,12 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
96 | dev->io.NumPorts2 = 0; | 96 | dev->io.NumPorts2 = 0; |
97 | dev->io.Attributes2 = 0; | 97 | dev->io.Attributes2 = 0; |
98 | 98 | ||
99 | win.Attributes = WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; | 99 | win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM | |
100 | WIN_ENABLE | WIN_DATA_WIDTH_16 | | ||
101 | WIN_USE_WAIT; | ||
100 | win.Base = 0; | 102 | win.Base = 0; |
101 | win.Size = SSB_CORE_SIZE; | 103 | win.Size = SSB_CORE_SIZE; |
102 | win.AccessSpeed = 1000; | 104 | win.AccessSpeed = 250; |
103 | res = pcmcia_request_window(&dev, &win, &dev->win); | 105 | res = pcmcia_request_window(&dev, &win, &dev->win); |
104 | if (res != CS_SUCCESS) | 106 | if (res != CS_SUCCESS) |
105 | goto err_kfree_ssb; | 107 | goto err_kfree_ssb; |
@@ -108,21 +110,34 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
108 | mem.Page = 0; | 110 | mem.Page = 0; |
109 | res = pcmcia_map_mem_page(dev->win, &mem); | 111 | res = pcmcia_map_mem_page(dev->win, &mem); |
110 | if (res != CS_SUCCESS) | 112 | if (res != CS_SUCCESS) |
111 | goto err_kfree_ssb; | 113 | goto err_disable; |
114 | |||
115 | dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FIRST_SHARED; | ||
116 | dev->irq.IRQInfo1 = IRQ_LEVEL_ID | IRQ_SHARE_ID; | ||
117 | dev->irq.Handler = NULL; /* The handler is registered later. */ | ||
118 | dev->irq.Instance = NULL; | ||
119 | res = pcmcia_request_irq(dev, &dev->irq); | ||
120 | if (res != CS_SUCCESS) | ||
121 | goto err_disable; | ||
112 | 122 | ||
113 | res = pcmcia_request_configuration(dev, &dev->conf); | 123 | res = pcmcia_request_configuration(dev, &dev->conf); |
114 | if (res != CS_SUCCESS) | 124 | if (res != CS_SUCCESS) |
115 | goto err_disable; | 125 | goto err_disable; |
116 | 126 | ||
117 | err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); | 127 | err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); |
128 | if (err) | ||
129 | goto err_disable; | ||
118 | dev->priv = ssb; | 130 | dev->priv = ssb; |
119 | 131 | ||
120 | out: | 132 | return 0; |
121 | return err; | 133 | |
122 | err_disable: | 134 | err_disable: |
123 | pcmcia_disable_device(dev); | 135 | pcmcia_disable_device(dev); |
124 | err_kfree_ssb: | 136 | err_kfree_ssb: |
125 | kfree(ssb); | 137 | kfree(ssb); |
138 | out_error: | ||
139 | printk(KERN_ERR "b43-pcmcia: Initialization failed (%d, %d)\n", | ||
140 | res, err); | ||
126 | return err; | 141 | return err; |
127 | } | 142 | } |
128 | 143 | ||
@@ -131,22 +146,21 @@ static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev) | |||
131 | struct ssb_bus *ssb = dev->priv; | 146 | struct ssb_bus *ssb = dev->priv; |
132 | 147 | ||
133 | ssb_bus_unregister(ssb); | 148 | ssb_bus_unregister(ssb); |
134 | pcmcia_release_window(dev->win); | ||
135 | pcmcia_disable_device(dev); | 149 | pcmcia_disable_device(dev); |
136 | kfree(ssb); | 150 | kfree(ssb); |
137 | dev->priv = NULL; | 151 | dev->priv = NULL; |
138 | } | 152 | } |
139 | 153 | ||
140 | static struct pcmcia_driver b43_pcmcia_driver = { | 154 | static struct pcmcia_driver b43_pcmcia_driver = { |
141 | .owner = THIS_MODULE, | 155 | .owner = THIS_MODULE, |
142 | .drv = { | 156 | .drv = { |
143 | .name = "b43-pcmcia", | 157 | .name = "b43-pcmcia", |
144 | }, | 158 | }, |
145 | .id_table = b43_pcmcia_tbl, | 159 | .id_table = b43_pcmcia_tbl, |
146 | .probe = b43_pcmcia_probe, | 160 | .probe = b43_pcmcia_probe, |
147 | .remove = b43_pcmcia_remove, | 161 | .remove = __devexit_p(b43_pcmcia_remove), |
148 | .suspend = b43_pcmcia_suspend, | 162 | .suspend = b43_pcmcia_suspend, |
149 | .resume = b43_pcmcia_resume, | 163 | .resume = b43_pcmcia_resume, |
150 | }; | 164 | }; |
151 | 165 | ||
152 | int b43_pcmcia_init(void) | 166 | int b43_pcmcia_init(void) |
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c index 800e0a61a7f5..9b1f905ffbf4 100644 --- a/drivers/net/wireless/b43/rfkill.c +++ b/drivers/net/wireless/b43/rfkill.c | |||
@@ -47,32 +47,35 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev) | |||
47 | struct b43_wldev *dev = poll_dev->private; | 47 | struct b43_wldev *dev = poll_dev->private; |
48 | struct b43_wl *wl = dev->wl; | 48 | struct b43_wl *wl = dev->wl; |
49 | bool enabled; | 49 | bool enabled; |
50 | bool report_change = 0; | ||
50 | 51 | ||
51 | mutex_lock(&wl->mutex); | 52 | mutex_lock(&wl->mutex); |
52 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); | 53 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); |
53 | enabled = b43_is_hw_radio_enabled(dev); | 54 | enabled = b43_is_hw_radio_enabled(dev); |
54 | if (unlikely(enabled != dev->radio_hw_enable)) { | 55 | if (unlikely(enabled != dev->radio_hw_enable)) { |
55 | dev->radio_hw_enable = enabled; | 56 | dev->radio_hw_enable = enabled; |
57 | report_change = 1; | ||
56 | b43info(wl, "Radio hardware status changed to %s\n", | 58 | b43info(wl, "Radio hardware status changed to %s\n", |
57 | enabled ? "ENABLED" : "DISABLED"); | 59 | enabled ? "ENABLED" : "DISABLED"); |
58 | mutex_unlock(&wl->mutex); | 60 | } |
61 | mutex_unlock(&wl->mutex); | ||
62 | |||
63 | if (unlikely(report_change)) | ||
59 | input_report_key(poll_dev->input, KEY_WLAN, enabled); | 64 | input_report_key(poll_dev->input, KEY_WLAN, enabled); |
60 | } else | ||
61 | mutex_unlock(&wl->mutex); | ||
62 | } | 65 | } |
63 | 66 | ||
64 | /* Called when the RFKILL toggled in software. | 67 | /* Called when the RFKILL toggled in software. */ |
65 | * This is called without locking. */ | ||
66 | static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) | 68 | static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) |
67 | { | 69 | { |
68 | struct b43_wldev *dev = data; | 70 | struct b43_wldev *dev = data; |
69 | struct b43_wl *wl = dev->wl; | 71 | struct b43_wl *wl = dev->wl; |
70 | int err = 0; | 72 | int err = 0; |
71 | 73 | ||
72 | mutex_lock(&wl->mutex); | 74 | if (!wl->rfkill.registered) |
73 | if (b43_status(dev) < B43_STAT_INITIALIZED) | 75 | return 0; |
74 | goto out_unlock; | ||
75 | 76 | ||
77 | mutex_lock(&wl->mutex); | ||
78 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); | ||
76 | switch (state) { | 79 | switch (state) { |
77 | case RFKILL_STATE_ON: | 80 | case RFKILL_STATE_ON: |
78 | if (!dev->radio_hw_enable) { | 81 | if (!dev->radio_hw_enable) { |
@@ -89,7 +92,6 @@ static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) | |||
89 | b43_radio_turn_off(dev, 0); | 92 | b43_radio_turn_off(dev, 0); |
90 | break; | 93 | break; |
91 | } | 94 | } |
92 | |||
93 | out_unlock: | 95 | out_unlock: |
94 | mutex_unlock(&wl->mutex); | 96 | mutex_unlock(&wl->mutex); |
95 | 97 | ||
@@ -98,11 +100,11 @@ out_unlock: | |||
98 | 100 | ||
99 | char * b43_rfkill_led_name(struct b43_wldev *dev) | 101 | char * b43_rfkill_led_name(struct b43_wldev *dev) |
100 | { | 102 | { |
101 | struct b43_wl *wl = dev->wl; | 103 | struct b43_rfkill *rfk = &(dev->wl->rfkill); |
102 | 104 | ||
103 | if (!wl->rfkill.rfkill) | 105 | if (!rfk->registered) |
104 | return NULL; | 106 | return NULL; |
105 | return rfkill_get_led_name(wl->rfkill.rfkill); | 107 | return rfkill_get_led_name(rfk->rfkill); |
106 | } | 108 | } |
107 | 109 | ||
108 | void b43_rfkill_init(struct b43_wldev *dev) | 110 | void b43_rfkill_init(struct b43_wldev *dev) |
@@ -111,53 +113,13 @@ void b43_rfkill_init(struct b43_wldev *dev) | |||
111 | struct b43_rfkill *rfk = &(wl->rfkill); | 113 | struct b43_rfkill *rfk = &(wl->rfkill); |
112 | int err; | 114 | int err; |
113 | 115 | ||
114 | if (rfk->rfkill) { | 116 | rfk->registered = 0; |
115 | err = rfkill_register(rfk->rfkill); | ||
116 | if (err) { | ||
117 | b43warn(wl, "Failed to register RF-kill button\n"); | ||
118 | goto err_free_rfk; | ||
119 | } | ||
120 | } | ||
121 | if (rfk->poll_dev) { | ||
122 | err = input_register_polled_device(rfk->poll_dev); | ||
123 | if (err) { | ||
124 | b43warn(wl, "Failed to register RF-kill polldev\n"); | ||
125 | goto err_free_polldev; | ||
126 | } | ||
127 | } | ||
128 | |||
129 | return; | ||
130 | err_free_rfk: | ||
131 | rfkill_free(rfk->rfkill); | ||
132 | rfk->rfkill = NULL; | ||
133 | err_free_polldev: | ||
134 | input_free_polled_device(rfk->poll_dev); | ||
135 | rfk->poll_dev = NULL; | ||
136 | } | ||
137 | |||
138 | void b43_rfkill_exit(struct b43_wldev *dev) | ||
139 | { | ||
140 | struct b43_rfkill *rfk = &(dev->wl->rfkill); | ||
141 | |||
142 | if (rfk->poll_dev) | ||
143 | input_unregister_polled_device(rfk->poll_dev); | ||
144 | if (rfk->rfkill) | ||
145 | rfkill_unregister(rfk->rfkill); | ||
146 | } | ||
147 | |||
148 | void b43_rfkill_alloc(struct b43_wldev *dev) | ||
149 | { | ||
150 | struct b43_wl *wl = dev->wl; | ||
151 | struct b43_rfkill *rfk = &(wl->rfkill); | ||
152 | 117 | ||
118 | rfk->rfkill = rfkill_allocate(dev->dev->dev, RFKILL_TYPE_WLAN); | ||
119 | if (!rfk->rfkill) | ||
120 | goto out_error; | ||
153 | snprintf(rfk->name, sizeof(rfk->name), | 121 | snprintf(rfk->name, sizeof(rfk->name), |
154 | "b43-%s", wiphy_name(wl->hw->wiphy)); | 122 | "b43-%s", wiphy_name(wl->hw->wiphy)); |
155 | |||
156 | rfk->rfkill = rfkill_allocate(dev->dev->dev, RFKILL_TYPE_WLAN); | ||
157 | if (!rfk->rfkill) { | ||
158 | b43warn(wl, "Failed to allocate RF-kill button\n"); | ||
159 | return; | ||
160 | } | ||
161 | rfk->rfkill->name = rfk->name; | 123 | rfk->rfkill->name = rfk->name; |
162 | rfk->rfkill->state = RFKILL_STATE_ON; | 124 | rfk->rfkill->state = RFKILL_STATE_ON; |
163 | rfk->rfkill->data = dev; | 125 | rfk->rfkill->data = dev; |
@@ -165,18 +127,45 @@ void b43_rfkill_alloc(struct b43_wldev *dev) | |||
165 | rfk->rfkill->user_claim_unsupported = 1; | 127 | rfk->rfkill->user_claim_unsupported = 1; |
166 | 128 | ||
167 | rfk->poll_dev = input_allocate_polled_device(); | 129 | rfk->poll_dev = input_allocate_polled_device(); |
168 | if (rfk->poll_dev) { | 130 | if (!rfk->poll_dev) |
169 | rfk->poll_dev->private = dev; | 131 | goto err_free_rfk; |
170 | rfk->poll_dev->poll = b43_rfkill_poll; | 132 | rfk->poll_dev->private = dev; |
171 | rfk->poll_dev->poll_interval = 1000; /* msecs */ | 133 | rfk->poll_dev->poll = b43_rfkill_poll; |
172 | } else | 134 | rfk->poll_dev->poll_interval = 1000; /* msecs */ |
173 | b43warn(wl, "Failed to allocate RF-kill polldev\n"); | 135 | |
136 | err = rfkill_register(rfk->rfkill); | ||
137 | if (err) | ||
138 | goto err_free_polldev; | ||
139 | err = input_register_polled_device(rfk->poll_dev); | ||
140 | if (err) | ||
141 | goto err_unreg_rfk; | ||
142 | |||
143 | rfk->registered = 1; | ||
144 | |||
145 | return; | ||
146 | err_unreg_rfk: | ||
147 | rfkill_unregister(rfk->rfkill); | ||
148 | err_free_polldev: | ||
149 | input_free_polled_device(rfk->poll_dev); | ||
150 | rfk->poll_dev = NULL; | ||
151 | err_free_rfk: | ||
152 | rfkill_free(rfk->rfkill); | ||
153 | rfk->rfkill = NULL; | ||
154 | out_error: | ||
155 | rfk->registered = 0; | ||
156 | b43warn(wl, "RF-kill button init failed\n"); | ||
174 | } | 157 | } |
175 | 158 | ||
176 | void b43_rfkill_free(struct b43_wldev *dev) | 159 | void b43_rfkill_exit(struct b43_wldev *dev) |
177 | { | 160 | { |
178 | struct b43_rfkill *rfk = &(dev->wl->rfkill); | 161 | struct b43_rfkill *rfk = &(dev->wl->rfkill); |
179 | 162 | ||
163 | if (!rfk->registered) | ||
164 | return; | ||
165 | rfk->registered = 0; | ||
166 | |||
167 | input_unregister_polled_device(rfk->poll_dev); | ||
168 | rfkill_unregister(rfk->rfkill); | ||
180 | input_free_polled_device(rfk->poll_dev); | 169 | input_free_polled_device(rfk->poll_dev); |
181 | rfk->poll_dev = NULL; | 170 | rfk->poll_dev = NULL; |
182 | rfkill_free(rfk->rfkill); | 171 | rfkill_free(rfk->rfkill); |
diff --git a/drivers/net/wireless/b43/rfkill.h b/drivers/net/wireless/b43/rfkill.h index 29544e8c9e5f..adacf936d815 100644 --- a/drivers/net/wireless/b43/rfkill.h +++ b/drivers/net/wireless/b43/rfkill.h | |||
@@ -15,14 +15,14 @@ struct b43_rfkill { | |||
15 | struct rfkill *rfkill; | 15 | struct rfkill *rfkill; |
16 | /* The poll device for the RFKILL input button */ | 16 | /* The poll device for the RFKILL input button */ |
17 | struct input_polled_dev *poll_dev; | 17 | struct input_polled_dev *poll_dev; |
18 | /* Did initialization succeed? Used for freeing. */ | ||
19 | bool registered; | ||
18 | /* The unique name of this rfkill switch */ | 20 | /* The unique name of this rfkill switch */ |
19 | char name[32]; | 21 | char name[sizeof("b43-phy4294967295")]; |
20 | }; | 22 | }; |
21 | 23 | ||
22 | /* All the init functions return void, because we are not interested | 24 | /* The init function returns void, because we are not interested |
23 | * in failing the b43 init process when rfkill init failed. */ | 25 | * in failing the b43 init process when rfkill init failed. */ |
24 | void b43_rfkill_alloc(struct b43_wldev *dev); | ||
25 | void b43_rfkill_free(struct b43_wldev *dev); | ||
26 | void b43_rfkill_init(struct b43_wldev *dev); | 26 | void b43_rfkill_init(struct b43_wldev *dev); |
27 | void b43_rfkill_exit(struct b43_wldev *dev); | 27 | void b43_rfkill_exit(struct b43_wldev *dev); |
28 | 28 | ||
@@ -36,12 +36,6 @@ struct b43_rfkill { | |||
36 | /* empty */ | 36 | /* empty */ |
37 | }; | 37 | }; |
38 | 38 | ||
39 | static inline void b43_rfkill_alloc(struct b43_wldev *dev) | ||
40 | { | ||
41 | } | ||
42 | static inline void b43_rfkill_free(struct b43_wldev *dev) | ||
43 | { | ||
44 | } | ||
45 | static inline void b43_rfkill_init(struct b43_wldev *dev) | 39 | static inline void b43_rfkill_init(struct b43_wldev *dev) |
46 | { | 40 | { |
47 | } | 41 | } |
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c index eefa6fb79685..619b4534ef09 100644 --- a/drivers/net/wireless/b43legacy/debugfs.c +++ b/drivers/net/wireless/b43legacy/debugfs.c | |||
@@ -124,7 +124,7 @@ static ssize_t shm_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufs | |||
124 | __le16 *le16buf = (__le16 *)buf; | 124 | __le16 *le16buf = (__le16 *)buf; |
125 | 125 | ||
126 | for (i = 0; i < 0x1000; i++) { | 126 | for (i = 0; i < 0x1000; i++) { |
127 | if (bufsize <= 0) | 127 | if (bufsize < sizeof(tmp)) |
128 | break; | 128 | break; |
129 | tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i); | 129 | tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i); |
130 | le16buf[i] = cpu_to_le16(tmp); | 130 | le16buf[i] = cpu_to_le16(tmp); |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index f0e56dfc9ecf..3bde1e9ab428 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2781,6 +2781,17 @@ static void b43legacy_wireless_core_stop(struct b43legacy_wldev *dev) | |||
2781 | 2781 | ||
2782 | if (b43legacy_status(dev) < B43legacy_STAT_STARTED) | 2782 | if (b43legacy_status(dev) < B43legacy_STAT_STARTED) |
2783 | return; | 2783 | return; |
2784 | |||
2785 | /* Disable and sync interrupts. We must do this before than | ||
2786 | * setting the status to INITIALIZED, as the interrupt handler | ||
2787 | * won't care about IRQs then. */ | ||
2788 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
2789 | dev->irq_savedstate = b43legacy_interrupt_disable(dev, | ||
2790 | B43legacy_IRQ_ALL); | ||
2791 | b43legacy_read32(dev, B43legacy_MMIO_GEN_IRQ_MASK); /* flush */ | ||
2792 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
2793 | b43legacy_synchronize_irq(dev); | ||
2794 | |||
2784 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); | 2795 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); |
2785 | 2796 | ||
2786 | mutex_unlock(&wl->mutex); | 2797 | mutex_unlock(&wl->mutex); |
@@ -2791,14 +2802,6 @@ static void b43legacy_wireless_core_stop(struct b43legacy_wldev *dev) | |||
2791 | 2802 | ||
2792 | ieee80211_stop_queues(wl->hw); /* FIXME this could cause a deadlock */ | 2803 | ieee80211_stop_queues(wl->hw); /* FIXME this could cause a deadlock */ |
2793 | 2804 | ||
2794 | /* Disable and sync interrupts. */ | ||
2795 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
2796 | dev->irq_savedstate = b43legacy_interrupt_disable(dev, | ||
2797 | B43legacy_IRQ_ALL); | ||
2798 | b43legacy_read32(dev, B43legacy_MMIO_GEN_IRQ_MASK); /* flush */ | ||
2799 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
2800 | b43legacy_synchronize_irq(dev); | ||
2801 | |||
2802 | b43legacy_mac_suspend(dev); | 2805 | b43legacy_mac_suspend(dev); |
2803 | free_irq(dev->dev->irq, dev); | 2806 | free_irq(dev->dev->irq, dev); |
2804 | b43legacydbg(wl, "Wireless interface stopped\n"); | 2807 | b43legacydbg(wl, "Wireless interface stopped\n"); |
@@ -3332,7 +3335,7 @@ out_mutex_unlock: | |||
3332 | return err; | 3335 | return err; |
3333 | } | 3336 | } |
3334 | 3337 | ||
3335 | void b43legacy_stop(struct ieee80211_hw *hw) | 3338 | static void b43legacy_stop(struct ieee80211_hw *hw) |
3336 | { | 3339 | { |
3337 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3340 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3338 | struct b43legacy_wldev *dev = wl->current_dev; | 3341 | struct b43legacy_wldev *dev = wl->current_dev; |
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index 7da3664b8515..fc876ba18572 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c | |||
@@ -444,7 +444,7 @@ static int prism2_pci_resume(struct pci_dev *pdev) | |||
444 | 444 | ||
445 | MODULE_DEVICE_TABLE(pci, prism2_pci_id_table); | 445 | MODULE_DEVICE_TABLE(pci, prism2_pci_id_table); |
446 | 446 | ||
447 | static struct pci_driver prism2_pci_drv_id = { | 447 | static struct pci_driver prism2_pci_driver = { |
448 | .name = "hostap_pci", | 448 | .name = "hostap_pci", |
449 | .id_table = prism2_pci_id_table, | 449 | .id_table = prism2_pci_id_table, |
450 | .probe = prism2_pci_probe, | 450 | .probe = prism2_pci_probe, |
@@ -458,13 +458,13 @@ static struct pci_driver prism2_pci_drv_id = { | |||
458 | 458 | ||
459 | static int __init init_prism2_pci(void) | 459 | static int __init init_prism2_pci(void) |
460 | { | 460 | { |
461 | return pci_register_driver(&prism2_pci_drv_id); | 461 | return pci_register_driver(&prism2_pci_driver); |
462 | } | 462 | } |
463 | 463 | ||
464 | 464 | ||
465 | static void __exit exit_prism2_pci(void) | 465 | static void __exit exit_prism2_pci(void) |
466 | { | 466 | { |
467 | pci_unregister_driver(&prism2_pci_drv_id); | 467 | pci_unregister_driver(&prism2_pci_driver); |
468 | } | 468 | } |
469 | 469 | ||
470 | 470 | ||
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 8d53d08b9691..fc6cdd8086c1 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -1267,7 +1267,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv) | |||
1267 | IPW2100_INTA_FATAL_ERROR | | 1267 | IPW2100_INTA_FATAL_ERROR | |
1268 | IPW2100_INTA_PARITY_ERROR); | 1268 | IPW2100_INTA_PARITY_ERROR); |
1269 | } | 1269 | } |
1270 | } while (i--); | 1270 | } while (--i); |
1271 | 1271 | ||
1272 | /* Clear out any pending INTAs since we aren't supposed to have | 1272 | /* Clear out any pending INTAs since we aren't supposed to have |
1273 | * interrupts enabled at this point... */ | 1273 | * interrupts enabled at this point... */ |
@@ -1339,7 +1339,7 @@ static int ipw2100_power_cycle_adapter(struct ipw2100_priv *priv) | |||
1339 | 1339 | ||
1340 | if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED) | 1340 | if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED) |
1341 | break; | 1341 | break; |
1342 | } while (i--); | 1342 | } while (--i); |
1343 | 1343 | ||
1344 | priv->status &= ~STATUS_RESET_PENDING; | 1344 | priv->status &= ~STATUS_RESET_PENDING; |
1345 | 1345 | ||
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 1cbbd96fdbde..be5cfd8402c7 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -912,6 +912,10 @@ static int wlan_cmd_set_boot2_ver(wlan_private * priv, | |||
912 | return 0; | 912 | return 0; |
913 | } | 913 | } |
914 | 914 | ||
915 | /* | ||
916 | * Note: NEVER use libertas_queue_cmd() with addtail==0 other than for | ||
917 | * the command timer, because it does not account for queued commands. | ||
918 | */ | ||
915 | void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) | 919 | void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) |
916 | { | 920 | { |
917 | unsigned long flags; | 921 | unsigned long flags; |
@@ -941,10 +945,11 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u | |||
941 | 945 | ||
942 | spin_lock_irqsave(&adapter->driver_lock, flags); | 946 | spin_lock_irqsave(&adapter->driver_lock, flags); |
943 | 947 | ||
944 | if (addtail) | 948 | if (addtail) { |
945 | list_add_tail((struct list_head *)cmdnode, | 949 | list_add_tail((struct list_head *)cmdnode, |
946 | &adapter->cmdpendingq); | 950 | &adapter->cmdpendingq); |
947 | else | 951 | adapter->nr_cmd_pending++; |
952 | } else | ||
948 | list_add((struct list_head *)cmdnode, &adapter->cmdpendingq); | 953 | list_add((struct list_head *)cmdnode, &adapter->cmdpendingq); |
949 | 954 | ||
950 | spin_unlock_irqrestore(&adapter->driver_lock, flags); | 955 | spin_unlock_irqrestore(&adapter->driver_lock, flags); |
@@ -1412,7 +1417,6 @@ int libertas_prepare_and_send_command(wlan_private * priv, | |||
1412 | cmdnode->cmdwaitqwoken = 0; | 1417 | cmdnode->cmdwaitqwoken = 0; |
1413 | 1418 | ||
1414 | libertas_queue_cmd(adapter, cmdnode, 1); | 1419 | libertas_queue_cmd(adapter, cmdnode, 1); |
1415 | adapter->nr_cmd_pending++; | ||
1416 | wake_up_interruptible(&priv->waitq); | 1420 | wake_up_interruptible(&priv->waitq); |
1417 | 1421 | ||
1418 | if (wait_option & CMD_OPTION_WAITFORRSP) { | 1422 | if (wait_option & CMD_OPTION_WAITFORRSP) { |
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 0360cad363a8..ec89dabc412c 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -148,11 +148,11 @@ static int if_cs_poll_while_fw_download(struct if_cs_card *card, uint addr, u8 r | |||
148 | { | 148 | { |
149 | int i; | 149 | int i; |
150 | 150 | ||
151 | for (i = 0; i < 500; i++) { | 151 | for (i = 0; i < 1000; i++) { |
152 | u8 val = if_cs_read8(card, addr); | 152 | u8 val = if_cs_read8(card, addr); |
153 | if (val == reg) | 153 | if (val == reg) |
154 | return i; | 154 | return i; |
155 | udelay(100); | 155 | udelay(500); |
156 | } | 156 | } |
157 | return -ETIME; | 157 | return -ETIME; |
158 | } | 158 | } |
@@ -878,6 +878,9 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
878 | goto out3; | 878 | goto out3; |
879 | } | 879 | } |
880 | 880 | ||
881 | /* Clear any interrupt cause that happend while sending | ||
882 | * firmware/initializing card */ | ||
883 | if_cs_write16(card, IF_CS_C_INT_CAUSE, IF_CS_C_IC_MASK); | ||
881 | if_cs_enable_ints(card); | 884 | if_cs_enable_ints(card); |
882 | 885 | ||
883 | /* And finally bring the card up */ | 886 | /* And finally bring the card up */ |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index a8e17076e7de..b24425f74883 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
@@ -182,12 +182,14 @@ static int if_sdio_handle_data(struct if_sdio_card *card, | |||
182 | goto out; | 182 | goto out; |
183 | } | 183 | } |
184 | 184 | ||
185 | skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE); | 185 | skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + NET_IP_ALIGN); |
186 | if (!skb) { | 186 | if (!skb) { |
187 | ret = -ENOMEM; | 187 | ret = -ENOMEM; |
188 | goto out; | 188 | goto out; |
189 | } | 189 | } |
190 | 190 | ||
191 | skb_reserve(skb, NET_IP_ALIGN); | ||
192 | |||
191 | data = skb_put(skb, size); | 193 | data = skb_put(skb, size); |
192 | 194 | ||
193 | memcpy(data, buffer, size); | 195 | memcpy(data, buffer, size); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 4a6a0bd01ff1..85ea8a8e658e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -196,6 +196,14 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, | |||
196 | struct rt2x00_dev *rt2x00dev = hw->priv; | 196 | struct rt2x00_dev *rt2x00dev = hw->priv; |
197 | struct interface *intf = &rt2x00dev->interface; | 197 | struct interface *intf = &rt2x00dev->interface; |
198 | 198 | ||
199 | /* FIXME: Beaconing is broken in rt2x00. */ | ||
200 | if (conf->type == IEEE80211_IF_TYPE_IBSS || | ||
201 | conf->type == IEEE80211_IF_TYPE_AP) { | ||
202 | ERROR(rt2x00dev, | ||
203 | "rt2x00 does not support Adhoc or Master mode"); | ||
204 | return -EOPNOTSUPP; | ||
205 | } | ||
206 | |||
199 | /* | 207 | /* |
200 | * Don't allow interfaces to be added while | 208 | * Don't allow interfaces to be added while |
201 | * either the device has disappeared or when | 209 | * either the device has disappeared or when |