diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 38 | ||||
-rw-r--r-- | drivers/ata/libata-eh.c | 22 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 2 | ||||
-rw-r--r-- | drivers/net/b44.c | 2 | ||||
-rw-r--r-- | drivers/net/cxgb3/common.h | 9 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 35 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 4 | ||||
-rw-r--r-- | drivers/net/cxgb3/mc5.c | 3 | ||||
-rw-r--r-- | drivers/net/cxgb3/regs.h | 4 | ||||
-rw-r--r-- | drivers/net/cxgb3/sge.c | 2 | ||||
-rw-r--r-- | drivers/net/cxgb3/t3_hw.c | 24 | ||||
-rw-r--r-- | drivers/net/cxgb3/version.h | 5 | ||||
-rw-r--r-- | drivers/net/cxgb3/xgmac.c | 1 | ||||
-rw-r--r-- | drivers/net/r8169.c | 46 |
14 files changed, 138 insertions, 59 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index ddb3909d7288..0abd72d0dec2 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1784,6 +1784,13 @@ int ata_dev_configure(struct ata_device *dev) | |||
1784 | dev->max_sectors = ATA_MAX_SECTORS; | 1784 | dev->max_sectors = ATA_MAX_SECTORS; |
1785 | } | 1785 | } |
1786 | 1786 | ||
1787 | if (ata_device_blacklisted(dev) & ATA_HORKAGE_MAX_SEC_128) | ||
1788 | dev->max_sectors = min(ATA_MAX_SECTORS_128, dev->max_sectors); | ||
1789 | |||
1790 | /* limit ATAPI DMA to R/W commands only */ | ||
1791 | if (ata_device_blacklisted(dev) & ATA_HORKAGE_DMA_RW_ONLY) | ||
1792 | dev->horkage |= ATA_HORKAGE_DMA_RW_ONLY; | ||
1793 | |||
1787 | if (ap->ops->dev_config) | 1794 | if (ap->ops->dev_config) |
1788 | ap->ops->dev_config(ap, dev); | 1795 | ap->ops->dev_config(ap, dev); |
1789 | 1796 | ||
@@ -3352,6 +3359,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
3352 | { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA }, | 3359 | { "_NEC DV5800A", NULL, ATA_HORKAGE_NODMA }, |
3353 | { "SAMSUNG CD-ROM SN-124","N001", ATA_HORKAGE_NODMA }, | 3360 | { "SAMSUNG CD-ROM SN-124","N001", ATA_HORKAGE_NODMA }, |
3354 | 3361 | ||
3362 | /* Weird ATAPI devices */ | ||
3363 | { "TORiSAN DVD-ROM DRD-N216", NULL, ATA_HORKAGE_MAX_SEC_128 | | ||
3364 | ATA_HORKAGE_DMA_RW_ONLY }, | ||
3365 | |||
3355 | /* Devices we expect to fail diagnostics */ | 3366 | /* Devices we expect to fail diagnostics */ |
3356 | 3367 | ||
3357 | /* Devices where NCQ should be avoided */ | 3368 | /* Devices where NCQ should be avoided */ |
@@ -3363,6 +3374,11 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
3363 | { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ }, | 3374 | { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ }, |
3364 | /* NCQ hard hangs device under heavier load, needs hard power cycle */ | 3375 | /* NCQ hard hangs device under heavier load, needs hard power cycle */ |
3365 | { "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ }, | 3376 | { "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ }, |
3377 | /* Blacklist entries taken from Silicon Image 3124/3132 | ||
3378 | Windows driver .inf file - also several Linux problem reports */ | ||
3379 | { "HTS541060G9SA00", "MB3OC60D", ATA_HORKAGE_NONCQ, }, | ||
3380 | { "HTS541080G9SA00", "MB4OC60D", ATA_HORKAGE_NONCQ, }, | ||
3381 | { "HTS541010G9SA00", "MBZOC60D", ATA_HORKAGE_NONCQ, }, | ||
3366 | 3382 | ||
3367 | /* Devices with NCQ limits */ | 3383 | /* Devices with NCQ limits */ |
3368 | 3384 | ||
@@ -3674,6 +3690,26 @@ int ata_check_atapi_dma(struct ata_queued_cmd *qc) | |||
3674 | struct ata_port *ap = qc->ap; | 3690 | struct ata_port *ap = qc->ap; |
3675 | int rc = 0; /* Assume ATAPI DMA is OK by default */ | 3691 | int rc = 0; /* Assume ATAPI DMA is OK by default */ |
3676 | 3692 | ||
3693 | /* some drives can only do ATAPI DMA on read/write */ | ||
3694 | if (unlikely(qc->dev->horkage & ATA_HORKAGE_DMA_RW_ONLY)) { | ||
3695 | struct scsi_cmnd *cmd = qc->scsicmd; | ||
3696 | u8 *scsicmd = cmd->cmnd; | ||
3697 | |||
3698 | switch (scsicmd[0]) { | ||
3699 | case READ_10: | ||
3700 | case WRITE_10: | ||
3701 | case READ_12: | ||
3702 | case WRITE_12: | ||
3703 | case READ_6: | ||
3704 | case WRITE_6: | ||
3705 | /* atapi dma maybe ok */ | ||
3706 | break; | ||
3707 | default: | ||
3708 | /* turn off atapi dma */ | ||
3709 | return 1; | ||
3710 | } | ||
3711 | } | ||
3712 | |||
3677 | if (ap->ops->check_atapi_dma) | 3713 | if (ap->ops->check_atapi_dma) |
3678 | rc = ap->ops->check_atapi_dma(qc); | 3714 | rc = ap->ops->check_atapi_dma(qc); |
3679 | 3715 | ||
@@ -4717,8 +4753,8 @@ static void fill_result_tf(struct ata_queued_cmd *qc) | |||
4717 | { | 4753 | { |
4718 | struct ata_port *ap = qc->ap; | 4754 | struct ata_port *ap = qc->ap; |
4719 | 4755 | ||
4720 | ap->ops->tf_read(ap, &qc->result_tf); | ||
4721 | qc->result_tf.flags = qc->tf.flags; | 4756 | qc->result_tf.flags = qc->tf.flags; |
4757 | ap->ops->tf_read(ap, &qc->result_tf); | ||
4722 | } | 4758 | } |
4723 | 4759 | ||
4724 | /** | 4760 | /** |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c89664a77a9c..39f556c02992 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -982,26 +982,27 @@ static int ata_eh_read_log_10h(struct ata_device *dev, | |||
982 | * RETURNS: | 982 | * RETURNS: |
983 | * 0 on success, AC_ERR_* mask on failure | 983 | * 0 on success, AC_ERR_* mask on failure |
984 | */ | 984 | */ |
985 | static unsigned int atapi_eh_request_sense(struct ata_device *dev, | 985 | static unsigned int atapi_eh_request_sense(struct ata_queued_cmd *qc) |
986 | unsigned char *sense_buf) | ||
987 | { | 986 | { |
987 | struct ata_device *dev = qc->dev; | ||
988 | unsigned char *sense_buf = qc->scsicmd->sense_buffer; | ||
988 | struct ata_port *ap = dev->ap; | 989 | struct ata_port *ap = dev->ap; |
989 | struct ata_taskfile tf; | 990 | struct ata_taskfile tf; |
990 | u8 cdb[ATAPI_CDB_LEN]; | 991 | u8 cdb[ATAPI_CDB_LEN]; |
991 | 992 | ||
992 | DPRINTK("ATAPI request sense\n"); | 993 | DPRINTK("ATAPI request sense\n"); |
993 | 994 | ||
994 | ata_tf_init(dev, &tf); | ||
995 | |||
996 | /* FIXME: is this needed? */ | 995 | /* FIXME: is this needed? */ |
997 | memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); | 996 | memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); |
998 | 997 | ||
999 | /* XXX: why tf_read here? */ | 998 | /* initialize sense_buf with the error register, |
1000 | ap->ops->tf_read(ap, &tf); | 999 | * for the case where they are -not- overwritten |
1001 | 1000 | */ | |
1002 | /* fill these in, for the case where they are -not- overwritten */ | ||
1003 | sense_buf[0] = 0x70; | 1001 | sense_buf[0] = 0x70; |
1004 | sense_buf[2] = tf.feature >> 4; | 1002 | sense_buf[2] = qc->result_tf.feature >> 4; |
1003 | |||
1004 | /* some devices time out if garbage left in tf */ | ||
1005 | ata_tf_init(dev, &tf); | ||
1005 | 1006 | ||
1006 | memset(cdb, 0, ATAPI_CDB_LEN); | 1007 | memset(cdb, 0, ATAPI_CDB_LEN); |
1007 | cdb[0] = REQUEST_SENSE; | 1008 | cdb[0] = REQUEST_SENSE; |
@@ -1165,8 +1166,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc, | |||
1165 | 1166 | ||
1166 | case ATA_DEV_ATAPI: | 1167 | case ATA_DEV_ATAPI: |
1167 | if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) { | 1168 | if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) { |
1168 | tmp = atapi_eh_request_sense(qc->dev, | 1169 | tmp = atapi_eh_request_sense(qc); |
1169 | qc->scsicmd->sense_buffer); | ||
1170 | if (!tmp) { | 1170 | if (!tmp) { |
1171 | /* ATA_QCFLAG_SENSE_VALID is used to | 1171 | /* ATA_QCFLAG_SENSE_VALID is used to |
1172 | * tell atapi_qc_complete() that sense | 1172 | * tell atapi_qc_complete() that sense |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 6cc817a10204..e9364434182c 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -333,7 +333,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) | |||
333 | scsi_cmd[8] = args[3]; | 333 | scsi_cmd[8] = args[3]; |
334 | scsi_cmd[10] = args[4]; | 334 | scsi_cmd[10] = args[4]; |
335 | scsi_cmd[12] = args[5]; | 335 | scsi_cmd[12] = args[5]; |
336 | scsi_cmd[13] = args[6] & 0x0f; | 336 | scsi_cmd[13] = args[6] & 0x4f; |
337 | scsi_cmd[14] = args[0]; | 337 | scsi_cmd[14] = args[0]; |
338 | 338 | ||
339 | /* Good values for timeout and retries? Values below | 339 | /* Good values for timeout and retries? Values below |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index aaada572732a..d742bfe24471 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -1709,7 +1709,7 @@ static void __b44_set_rx_mode(struct net_device *dev) | |||
1709 | bw32(bp, B44_RXCONFIG, val); | 1709 | bw32(bp, B44_RXCONFIG, val); |
1710 | } else { | 1710 | } else { |
1711 | unsigned char zero[6] = {0, 0, 0, 0, 0, 0}; | 1711 | unsigned char zero[6] = {0, 0, 0, 0, 0, 0}; |
1712 | int i = 0; | 1712 | int i = 1; |
1713 | 1713 | ||
1714 | __b44_set_mac_addr(bp); | 1714 | __b44_set_mac_addr(bp); |
1715 | 1715 | ||
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h index 85e5543cfb57..97128d88eaef 100644 --- a/drivers/net/cxgb3/common.h +++ b/drivers/net/cxgb3/common.h | |||
@@ -112,8 +112,7 @@ enum { | |||
112 | }; | 112 | }; |
113 | 113 | ||
114 | enum { | 114 | enum { |
115 | SUPPORTED_OFFLOAD = 1 << 24, | 115 | SUPPORTED_IRQ = 1 << 24 |
116 | SUPPORTED_IRQ = 1 << 25 | ||
117 | }; | 116 | }; |
118 | 117 | ||
119 | enum { /* adapter interrupt-maintained statistics */ | 118 | enum { /* adapter interrupt-maintained statistics */ |
@@ -358,6 +357,9 @@ enum { | |||
358 | MC5_MODE_72_BIT = 2 | 357 | MC5_MODE_72_BIT = 2 |
359 | }; | 358 | }; |
360 | 359 | ||
360 | /* MC5 min active region size */ | ||
361 | enum { MC5_MIN_TIDS = 16 }; | ||
362 | |||
361 | struct vpd_params { | 363 | struct vpd_params { |
362 | unsigned int cclk; | 364 | unsigned int cclk; |
363 | unsigned int mclk; | 365 | unsigned int mclk; |
@@ -402,6 +404,7 @@ struct adapter_params { | |||
402 | unsigned int stats_update_period; /* MAC stats accumulation period */ | 404 | unsigned int stats_update_period; /* MAC stats accumulation period */ |
403 | unsigned int linkpoll_period; /* link poll period in 0.1s */ | 405 | unsigned int linkpoll_period; /* link poll period in 0.1s */ |
404 | unsigned int rev; /* chip revision */ | 406 | unsigned int rev; /* chip revision */ |
407 | unsigned int offload; | ||
405 | }; | 408 | }; |
406 | 409 | ||
407 | enum { /* chip revisions */ | 410 | enum { /* chip revisions */ |
@@ -602,7 +605,7 @@ static inline int is_10G(const struct adapter *adap) | |||
602 | 605 | ||
603 | static inline int is_offload(const struct adapter *adap) | 606 | static inline int is_offload(const struct adapter *adap) |
604 | { | 607 | { |
605 | return adapter_info(adap)->caps & SUPPORTED_OFFLOAD; | 608 | return adap->params.offload; |
606 | } | 609 | } |
607 | 610 | ||
608 | static inline unsigned int core_ticks_per_usec(const struct adapter *adap) | 611 | static inline unsigned int core_ticks_per_usec(const struct adapter *adap) |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index d55383610559..26240fd5e768 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -185,16 +185,26 @@ void t3_os_link_changed(struct adapter *adapter, int port_id, int link_stat, | |||
185 | int speed, int duplex, int pause) | 185 | int speed, int duplex, int pause) |
186 | { | 186 | { |
187 | struct net_device *dev = adapter->port[port_id]; | 187 | struct net_device *dev = adapter->port[port_id]; |
188 | struct port_info *pi = netdev_priv(dev); | ||
189 | struct cmac *mac = &pi->mac; | ||
188 | 190 | ||
189 | /* Skip changes from disabled ports. */ | 191 | /* Skip changes from disabled ports. */ |
190 | if (!netif_running(dev)) | 192 | if (!netif_running(dev)) |
191 | return; | 193 | return; |
192 | 194 | ||
193 | if (link_stat != netif_carrier_ok(dev)) { | 195 | if (link_stat != netif_carrier_ok(dev)) { |
194 | if (link_stat) | 196 | if (link_stat) { |
197 | t3_set_reg_field(adapter, | ||
198 | A_XGM_TXFIFO_CFG + mac->offset, | ||
199 | F_ENDROPPKT, 0); | ||
195 | netif_carrier_on(dev); | 200 | netif_carrier_on(dev); |
196 | else | 201 | } else { |
197 | netif_carrier_off(dev); | 202 | netif_carrier_off(dev); |
203 | t3_set_reg_field(adapter, | ||
204 | A_XGM_TXFIFO_CFG + mac->offset, | ||
205 | F_ENDROPPKT, F_ENDROPPKT); | ||
206 | } | ||
207 | |||
198 | link_report(dev); | 208 | link_report(dev); |
199 | } | 209 | } |
200 | } | 210 | } |
@@ -407,7 +417,7 @@ static void quiesce_rx(struct adapter *adap) | |||
407 | static int setup_sge_qsets(struct adapter *adap) | 417 | static int setup_sge_qsets(struct adapter *adap) |
408 | { | 418 | { |
409 | int i, j, err, irq_idx = 0, qset_idx = 0, dummy_dev_idx = 0; | 419 | int i, j, err, irq_idx = 0, qset_idx = 0, dummy_dev_idx = 0; |
410 | unsigned int ntxq = is_offload(adap) ? SGE_TXQ_PER_SET : 1; | 420 | unsigned int ntxq = SGE_TXQ_PER_SET; |
411 | 421 | ||
412 | if (adap->params.rev > 0 && !(adap->flags & USING_MSI)) | 422 | if (adap->params.rev > 0 && !(adap->flags & USING_MSI)) |
413 | irq_idx = -1; | 423 | irq_idx = -1; |
@@ -485,12 +495,14 @@ static ssize_t show_##name(struct device *d, struct device_attribute *attr, \ | |||
485 | static ssize_t set_nfilters(struct net_device *dev, unsigned int val) | 495 | static ssize_t set_nfilters(struct net_device *dev, unsigned int val) |
486 | { | 496 | { |
487 | struct adapter *adap = dev->priv; | 497 | struct adapter *adap = dev->priv; |
498 | int min_tids = is_offload(adap) ? MC5_MIN_TIDS : 0; | ||
488 | 499 | ||
489 | if (adap->flags & FULL_INIT_DONE) | 500 | if (adap->flags & FULL_INIT_DONE) |
490 | return -EBUSY; | 501 | return -EBUSY; |
491 | if (val && adap->params.rev == 0) | 502 | if (val && adap->params.rev == 0) |
492 | return -EINVAL; | 503 | return -EINVAL; |
493 | if (val > t3_mc5_size(&adap->mc5) - adap->params.mc5.nservers) | 504 | if (val > t3_mc5_size(&adap->mc5) - adap->params.mc5.nservers - |
505 | min_tids) | ||
494 | return -EINVAL; | 506 | return -EINVAL; |
495 | adap->params.mc5.nfilters = val; | 507 | adap->params.mc5.nfilters = val; |
496 | return 0; | 508 | return 0; |
@@ -508,7 +520,8 @@ static ssize_t set_nservers(struct net_device *dev, unsigned int val) | |||
508 | 520 | ||
509 | if (adap->flags & FULL_INIT_DONE) | 521 | if (adap->flags & FULL_INIT_DONE) |
510 | return -EBUSY; | 522 | return -EBUSY; |
511 | if (val > t3_mc5_size(&adap->mc5) - adap->params.mc5.nfilters) | 523 | if (val > t3_mc5_size(&adap->mc5) - adap->params.mc5.nfilters - |
524 | MC5_MIN_TIDS) | ||
512 | return -EINVAL; | 525 | return -EINVAL; |
513 | adap->params.mc5.nservers = val; | 526 | adap->params.mc5.nservers = val; |
514 | return 0; | 527 | return 0; |
@@ -708,7 +721,7 @@ static void bind_qsets(struct adapter *adap) | |||
708 | } | 721 | } |
709 | } | 722 | } |
710 | 723 | ||
711 | #define FW_FNAME "t3fw-%d.%d.bin" | 724 | #define FW_FNAME "t3fw-%d.%d.%d.bin" |
712 | 725 | ||
713 | static int upgrade_fw(struct adapter *adap) | 726 | static int upgrade_fw(struct adapter *adap) |
714 | { | 727 | { |
@@ -718,7 +731,7 @@ static int upgrade_fw(struct adapter *adap) | |||
718 | struct device *dev = &adap->pdev->dev; | 731 | struct device *dev = &adap->pdev->dev; |
719 | 732 | ||
720 | snprintf(buf, sizeof(buf), FW_FNAME, FW_VERSION_MAJOR, | 733 | snprintf(buf, sizeof(buf), FW_FNAME, FW_VERSION_MAJOR, |
721 | FW_VERSION_MINOR); | 734 | FW_VERSION_MINOR, FW_VERSION_MICRO); |
722 | ret = request_firmware(&fw, buf, dev); | 735 | ret = request_firmware(&fw, buf, dev); |
723 | if (ret < 0) { | 736 | if (ret < 0) { |
724 | dev_err(dev, "could not upgrade firmware: unable to load %s\n", | 737 | dev_err(dev, "could not upgrade firmware: unable to load %s\n", |
@@ -919,7 +932,7 @@ static int cxgb_open(struct net_device *dev) | |||
919 | return err; | 932 | return err; |
920 | 933 | ||
921 | set_bit(pi->port_id, &adapter->open_device_map); | 934 | set_bit(pi->port_id, &adapter->open_device_map); |
922 | if (!ofld_disable) { | 935 | if (is_offload(adapter) && !ofld_disable) { |
923 | err = offload_open(dev); | 936 | err = offload_open(dev); |
924 | if (err) | 937 | if (err) |
925 | printk(KERN_WARNING | 938 | printk(KERN_WARNING |
@@ -2116,7 +2129,7 @@ static void check_t3b2_mac(struct adapter *adapter) | |||
2116 | continue; | 2129 | continue; |
2117 | 2130 | ||
2118 | status = 0; | 2131 | status = 0; |
2119 | if (netif_running(dev)) | 2132 | if (netif_running(dev) && netif_carrier_ok(dev)) |
2120 | status = t3b2_mac_watchdog_task(&p->mac); | 2133 | status = t3b2_mac_watchdog_task(&p->mac); |
2121 | if (status == 1) | 2134 | if (status == 1) |
2122 | p->mac.stats.num_toggled++; | 2135 | p->mac.stats.num_toggled++; |
@@ -2267,9 +2280,9 @@ static void __devinit print_port_info(struct adapter *adap, | |||
2267 | 2280 | ||
2268 | if (!test_bit(i, &adap->registered_device_map)) | 2281 | if (!test_bit(i, &adap->registered_device_map)) |
2269 | continue; | 2282 | continue; |
2270 | printk(KERN_INFO "%s: %s %s RNIC (rev %d) %s%s\n", | 2283 | printk(KERN_INFO "%s: %s %s %sNIC (rev %d) %s%s\n", |
2271 | dev->name, ai->desc, pi->port_type->desc, | 2284 | dev->name, ai->desc, pi->port_type->desc, |
2272 | adap->params.rev, buf, | 2285 | is_offload(adap) ? "R" : "", adap->params.rev, buf, |
2273 | (adap->flags & USING_MSIX) ? " MSI-X" : | 2286 | (adap->flags & USING_MSIX) ? " MSI-X" : |
2274 | (adap->flags & USING_MSI) ? " MSI" : ""); | 2287 | (adap->flags & USING_MSI) ? " MSI" : ""); |
2275 | if (adap->name == dev->name && adap->params.vpd.mclk) | 2288 | if (adap->name == dev->name && adap->params.vpd.mclk) |
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index f6ed033efb56..eed7a48e3111 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -553,7 +553,9 @@ int cxgb3_alloc_atid(struct t3cdev *tdev, struct cxgb3_client *client, | |||
553 | struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; | 553 | struct tid_info *t = &(T3C_DATA(tdev))->tid_maps; |
554 | 554 | ||
555 | spin_lock_bh(&t->atid_lock); | 555 | spin_lock_bh(&t->atid_lock); |
556 | if (t->afree) { | 556 | if (t->afree && |
557 | t->atids_in_use + atomic_read(&t->tids_in_use) + MC5_MIN_TIDS <= | ||
558 | t->ntids) { | ||
557 | union active_open_entry *p = t->afree; | 559 | union active_open_entry *p = t->afree; |
558 | 560 | ||
559 | atid = (p - t->atid_tab) + t->atid_base; | 561 | atid = (p - t->atid_tab) + t->atid_base; |
diff --git a/drivers/net/cxgb3/mc5.c b/drivers/net/cxgb3/mc5.c index 644d62ea86a6..84c1ffa8e2d3 100644 --- a/drivers/net/cxgb3/mc5.c +++ b/drivers/net/cxgb3/mc5.c | |||
@@ -328,6 +328,9 @@ int t3_mc5_init(struct mc5 *mc5, unsigned int nservers, unsigned int nfilters, | |||
328 | unsigned int tcam_size = mc5->tcam_size; | 328 | unsigned int tcam_size = mc5->tcam_size; |
329 | struct adapter *adap = mc5->adapter; | 329 | struct adapter *adap = mc5->adapter; |
330 | 330 | ||
331 | if (!tcam_size) | ||
332 | return 0; | ||
333 | |||
331 | if (nroutes > MAX_ROUTES || nroutes + nservers + nfilters > tcam_size) | 334 | if (nroutes > MAX_ROUTES || nroutes + nservers + nfilters > tcam_size) |
332 | return -EINVAL; | 335 | return -EINVAL; |
333 | 336 | ||
diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h index b38629a244d0..f8be41c5a081 100644 --- a/drivers/net/cxgb3/regs.h +++ b/drivers/net/cxgb3/regs.h | |||
@@ -1940,6 +1940,10 @@ | |||
1940 | 1940 | ||
1941 | #define V_TXFIFOTHRESH(x) ((x) << S_TXFIFOTHRESH) | 1941 | #define V_TXFIFOTHRESH(x) ((x) << S_TXFIFOTHRESH) |
1942 | 1942 | ||
1943 | #define S_ENDROPPKT 21 | ||
1944 | #define V_ENDROPPKT(x) ((x) << S_ENDROPPKT) | ||
1945 | #define F_ENDROPPKT V_ENDROPPKT(1U) | ||
1946 | |||
1943 | #define A_XGM_SERDES_CTRL 0x890 | 1947 | #define A_XGM_SERDES_CTRL 0x890 |
1944 | #define A_XGM_SERDES_CTRL0 0x8e0 | 1948 | #define A_XGM_SERDES_CTRL0 0x8e0 |
1945 | 1949 | ||
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index c23783432e51..027ab2c3825c 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -2631,7 +2631,7 @@ int t3_sge_alloc_qset(struct adapter *adapter, unsigned int id, int nports, | |||
2631 | q->txq[TXQ_ETH].stop_thres = nports * | 2631 | q->txq[TXQ_ETH].stop_thres = nports * |
2632 | flits_to_desc(sgl_len(MAX_SKB_FRAGS + 1) + 3); | 2632 | flits_to_desc(sgl_len(MAX_SKB_FRAGS + 1) + 3); |
2633 | 2633 | ||
2634 | if (ntxq == 1) { | 2634 | if (!is_offload(adapter)) { |
2635 | #ifdef USE_RX_PAGE | 2635 | #ifdef USE_RX_PAGE |
2636 | q->fl[0].buf_size = RX_PAGE_SIZE; | 2636 | q->fl[0].buf_size = RX_PAGE_SIZE; |
2637 | #else | 2637 | #else |
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index 791ed6dc1943..d83f075ef2d7 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
@@ -438,23 +438,23 @@ static const struct adapter_info t3_adap_info[] = { | |||
438 | {2, 0, 0, 0, | 438 | {2, 0, 0, 0, |
439 | F_GPIO2_OEN | F_GPIO4_OEN | | 439 | F_GPIO2_OEN | F_GPIO4_OEN | |
440 | F_GPIO2_OUT_VAL | F_GPIO4_OUT_VAL, F_GPIO3 | F_GPIO5, | 440 | F_GPIO2_OUT_VAL | F_GPIO4_OUT_VAL, F_GPIO3 | F_GPIO5, |
441 | SUPPORTED_OFFLOAD, | 441 | 0, |
442 | &mi1_mdio_ops, "Chelsio PE9000"}, | 442 | &mi1_mdio_ops, "Chelsio PE9000"}, |
443 | {2, 0, 0, 0, | 443 | {2, 0, 0, 0, |
444 | F_GPIO2_OEN | F_GPIO4_OEN | | 444 | F_GPIO2_OEN | F_GPIO4_OEN | |
445 | F_GPIO2_OUT_VAL | F_GPIO4_OUT_VAL, F_GPIO3 | F_GPIO5, | 445 | F_GPIO2_OUT_VAL | F_GPIO4_OUT_VAL, F_GPIO3 | F_GPIO5, |
446 | SUPPORTED_OFFLOAD, | 446 | 0, |
447 | &mi1_mdio_ops, "Chelsio T302"}, | 447 | &mi1_mdio_ops, "Chelsio T302"}, |
448 | {1, 0, 0, 0, | 448 | {1, 0, 0, 0, |
449 | F_GPIO1_OEN | F_GPIO6_OEN | F_GPIO7_OEN | F_GPIO10_OEN | | 449 | F_GPIO1_OEN | F_GPIO6_OEN | F_GPIO7_OEN | F_GPIO10_OEN | |
450 | F_GPIO1_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL, 0, | 450 | F_GPIO1_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL, 0, |
451 | SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_OFFLOAD, | 451 | SUPPORTED_10000baseT_Full | SUPPORTED_AUI, |
452 | &mi1_mdio_ext_ops, "Chelsio T310"}, | 452 | &mi1_mdio_ext_ops, "Chelsio T310"}, |
453 | {2, 0, 0, 0, | 453 | {2, 0, 0, 0, |
454 | F_GPIO1_OEN | F_GPIO2_OEN | F_GPIO4_OEN | F_GPIO5_OEN | F_GPIO6_OEN | | 454 | F_GPIO1_OEN | F_GPIO2_OEN | F_GPIO4_OEN | F_GPIO5_OEN | F_GPIO6_OEN | |
455 | F_GPIO7_OEN | F_GPIO10_OEN | F_GPIO11_OEN | F_GPIO1_OUT_VAL | | 455 | F_GPIO7_OEN | F_GPIO10_OEN | F_GPIO11_OEN | F_GPIO1_OUT_VAL | |
456 | F_GPIO5_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL, 0, | 456 | F_GPIO5_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL, 0, |
457 | SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_OFFLOAD, | 457 | SUPPORTED_10000baseT_Full | SUPPORTED_AUI, |
458 | &mi1_mdio_ext_ops, "Chelsio T320"}, | 458 | &mi1_mdio_ext_ops, "Chelsio T320"}, |
459 | }; | 459 | }; |
460 | 460 | ||
@@ -2900,6 +2900,9 @@ static int mc7_init(struct mc7 *mc7, unsigned int mc7_clock, int mem_type) | |||
2900 | struct adapter *adapter = mc7->adapter; | 2900 | struct adapter *adapter = mc7->adapter; |
2901 | const struct mc7_timing_params *p = &mc7_timings[mem_type]; | 2901 | const struct mc7_timing_params *p = &mc7_timings[mem_type]; |
2902 | 2902 | ||
2903 | if (!mc7->size) | ||
2904 | return 0; | ||
2905 | |||
2903 | val = t3_read_reg(adapter, mc7->offset + A_MC7_CFG); | 2906 | val = t3_read_reg(adapter, mc7->offset + A_MC7_CFG); |
2904 | slow = val & F_SLOW; | 2907 | slow = val & F_SLOW; |
2905 | width = G_WIDTH(val); | 2908 | width = G_WIDTH(val); |
@@ -3100,8 +3103,10 @@ int t3_init_hw(struct adapter *adapter, u32 fw_params) | |||
3100 | do { /* wait for uP to initialize */ | 3103 | do { /* wait for uP to initialize */ |
3101 | msleep(20); | 3104 | msleep(20); |
3102 | } while (t3_read_reg(adapter, A_CIM_HOST_ACC_DATA) && --attempts); | 3105 | } while (t3_read_reg(adapter, A_CIM_HOST_ACC_DATA) && --attempts); |
3103 | if (!attempts) | 3106 | if (!attempts) { |
3107 | CH_ERR(adapter, "uP initialization timed out\n"); | ||
3104 | goto out_err; | 3108 | goto out_err; |
3109 | } | ||
3105 | 3110 | ||
3106 | err = 0; | 3111 | err = 0; |
3107 | out_err: | 3112 | out_err: |
@@ -3201,7 +3206,7 @@ static void __devinit mc7_prep(struct adapter *adapter, struct mc7 *mc7, | |||
3201 | mc7->name = name; | 3206 | mc7->name = name; |
3202 | mc7->offset = base_addr - MC7_PMRX_BASE_ADDR; | 3207 | mc7->offset = base_addr - MC7_PMRX_BASE_ADDR; |
3203 | cfg = t3_read_reg(adapter, mc7->offset + A_MC7_CFG); | 3208 | cfg = t3_read_reg(adapter, mc7->offset + A_MC7_CFG); |
3204 | mc7->size = mc7_calc_size(cfg); | 3209 | mc7->size = mc7->size = G_DEN(cfg) == M_DEN ? 0 : mc7_calc_size(cfg); |
3205 | mc7->width = G_WIDTH(cfg); | 3210 | mc7->width = G_WIDTH(cfg); |
3206 | } | 3211 | } |
3207 | 3212 | ||
@@ -3228,6 +3233,7 @@ void early_hw_init(struct adapter *adapter, const struct adapter_info *ai) | |||
3228 | V_I2C_CLKDIV(adapter->params.vpd.cclk / 80 - 1)); | 3233 | V_I2C_CLKDIV(adapter->params.vpd.cclk / 80 - 1)); |
3229 | t3_write_reg(adapter, A_T3DBG_GPIO_EN, | 3234 | t3_write_reg(adapter, A_T3DBG_GPIO_EN, |
3230 | ai->gpio_out | F_GPIO0_OEN | F_GPIO0_OUT_VAL); | 3235 | ai->gpio_out | F_GPIO0_OEN | F_GPIO0_OUT_VAL); |
3236 | t3_write_reg(adapter, A_MC5_DB_SERVER_INDEX, 0); | ||
3231 | 3237 | ||
3232 | if (adapter->params.rev == 0 || !uses_xaui(adapter)) | 3238 | if (adapter->params.rev == 0 || !uses_xaui(adapter)) |
3233 | val |= F_ENRGMII; | 3239 | val |= F_ENRGMII; |
@@ -3326,7 +3332,13 @@ int __devinit t3_prep_adapter(struct adapter *adapter, | |||
3326 | p->tx_num_pgs = pm_num_pages(p->chan_tx_size, p->tx_pg_size); | 3332 | p->tx_num_pgs = pm_num_pages(p->chan_tx_size, p->tx_pg_size); |
3327 | p->ntimer_qs = p->cm_size >= (128 << 20) || | 3333 | p->ntimer_qs = p->cm_size >= (128 << 20) || |
3328 | adapter->params.rev > 0 ? 12 : 6; | 3334 | adapter->params.rev > 0 ? 12 : 6; |
3335 | } | ||
3336 | |||
3337 | adapter->params.offload = t3_mc7_size(&adapter->pmrx) && | ||
3338 | t3_mc7_size(&adapter->pmtx) && | ||
3339 | t3_mc7_size(&adapter->cm); | ||
3329 | 3340 | ||
3341 | if (is_offload(adapter)) { | ||
3330 | adapter->params.mc5.nservers = DEFAULT_NSERVERS; | 3342 | adapter->params.mc5.nservers = DEFAULT_NSERVERS; |
3331 | adapter->params.mc5.nfilters = adapter->params.rev > 0 ? | 3343 | adapter->params.mc5.nfilters = adapter->params.rev > 0 ? |
3332 | DEFAULT_NFILTERS : 0; | 3344 | DEFAULT_NFILTERS : 0; |
diff --git a/drivers/net/cxgb3/version.h b/drivers/net/cxgb3/version.h index 82278f850259..042e27e291cd 100644 --- a/drivers/net/cxgb3/version.h +++ b/drivers/net/cxgb3/version.h | |||
@@ -36,6 +36,9 @@ | |||
36 | #define DRV_NAME "cxgb3" | 36 | #define DRV_NAME "cxgb3" |
37 | /* Driver version */ | 37 | /* Driver version */ |
38 | #define DRV_VERSION "1.0-ko" | 38 | #define DRV_VERSION "1.0-ko" |
39 | |||
40 | /* Firmware version */ | ||
39 | #define FW_VERSION_MAJOR 3 | 41 | #define FW_VERSION_MAJOR 3 |
40 | #define FW_VERSION_MINOR 2 | 42 | #define FW_VERSION_MINOR 3 |
43 | #define FW_VERSION_MICRO 0 | ||
41 | #endif /* __CHELSIO_VERSION_H */ | 44 | #endif /* __CHELSIO_VERSION_H */ |
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c index 2b42c13ba8e0..94aaff005a35 100644 --- a/drivers/net/cxgb3/xgmac.c +++ b/drivers/net/cxgb3/xgmac.c | |||
@@ -471,7 +471,6 @@ const struct mac_stats *t3_mac_update_stats(struct cmac *mac) | |||
471 | RMON_UPDATE(mac, rx_symbol_errs, RX_SYM_CODE_ERR_FRAMES); | 471 | RMON_UPDATE(mac, rx_symbol_errs, RX_SYM_CODE_ERR_FRAMES); |
472 | 472 | ||
473 | RMON_UPDATE(mac, rx_too_long, RX_OVERSIZE_FRAMES); | 473 | RMON_UPDATE(mac, rx_too_long, RX_OVERSIZE_FRAMES); |
474 | mac->stats.rx_too_long += RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT); | ||
475 | 474 | ||
476 | v = RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT); | 475 | v = RMON_READ(mac, A_XGM_RX_MAX_PKT_SIZE_ERR_CNT); |
477 | if (mac->adapter->params.rev == T3_REV_B2) | 476 | if (mac->adapter->params.rev == T3_REV_B2) |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 521b5f0618a4..6a77b8a92245 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -66,6 +66,7 @@ VERSION 2.2LK <2005/01/25> | |||
66 | #include <linux/init.h> | 66 | #include <linux/init.h> |
67 | #include <linux/dma-mapping.h> | 67 | #include <linux/dma-mapping.h> |
68 | 68 | ||
69 | #include <asm/system.h> | ||
69 | #include <asm/io.h> | 70 | #include <asm/io.h> |
70 | #include <asm/irq.h> | 71 | #include <asm/irq.h> |
71 | 72 | ||
@@ -486,6 +487,7 @@ static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *, | |||
486 | void __iomem *); | 487 | void __iomem *); |
487 | static int rtl8169_change_mtu(struct net_device *dev, int new_mtu); | 488 | static int rtl8169_change_mtu(struct net_device *dev, int new_mtu); |
488 | static void rtl8169_down(struct net_device *dev); | 489 | static void rtl8169_down(struct net_device *dev); |
490 | static void rtl8169_rx_clear(struct rtl8169_private *tp); | ||
489 | 491 | ||
490 | #ifdef CONFIG_R8169_NAPI | 492 | #ifdef CONFIG_R8169_NAPI |
491 | static int rtl8169_poll(struct net_device *dev, int *budget); | 493 | static int rtl8169_poll(struct net_device *dev, int *budget); |
@@ -1751,16 +1753,10 @@ static int rtl8169_open(struct net_device *dev) | |||
1751 | { | 1753 | { |
1752 | struct rtl8169_private *tp = netdev_priv(dev); | 1754 | struct rtl8169_private *tp = netdev_priv(dev); |
1753 | struct pci_dev *pdev = tp->pci_dev; | 1755 | struct pci_dev *pdev = tp->pci_dev; |
1754 | int retval; | 1756 | int retval = -ENOMEM; |
1755 | 1757 | ||
1756 | rtl8169_set_rxbufsize(tp, dev); | ||
1757 | |||
1758 | retval = | ||
1759 | request_irq(dev->irq, rtl8169_interrupt, IRQF_SHARED, dev->name, dev); | ||
1760 | if (retval < 0) | ||
1761 | goto out; | ||
1762 | 1758 | ||
1763 | retval = -ENOMEM; | 1759 | rtl8169_set_rxbufsize(tp, dev); |
1764 | 1760 | ||
1765 | /* | 1761 | /* |
1766 | * Rx and Tx desscriptors needs 256 bytes alignment. | 1762 | * Rx and Tx desscriptors needs 256 bytes alignment. |
@@ -1769,19 +1765,26 @@ static int rtl8169_open(struct net_device *dev) | |||
1769 | tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES, | 1765 | tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES, |
1770 | &tp->TxPhyAddr); | 1766 | &tp->TxPhyAddr); |
1771 | if (!tp->TxDescArray) | 1767 | if (!tp->TxDescArray) |
1772 | goto err_free_irq; | 1768 | goto out; |
1773 | 1769 | ||
1774 | tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES, | 1770 | tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES, |
1775 | &tp->RxPhyAddr); | 1771 | &tp->RxPhyAddr); |
1776 | if (!tp->RxDescArray) | 1772 | if (!tp->RxDescArray) |
1777 | goto err_free_tx; | 1773 | goto err_free_tx_0; |
1778 | 1774 | ||
1779 | retval = rtl8169_init_ring(dev); | 1775 | retval = rtl8169_init_ring(dev); |
1780 | if (retval < 0) | 1776 | if (retval < 0) |
1781 | goto err_free_rx; | 1777 | goto err_free_rx_1; |
1782 | 1778 | ||
1783 | INIT_DELAYED_WORK(&tp->task, NULL); | 1779 | INIT_DELAYED_WORK(&tp->task, NULL); |
1784 | 1780 | ||
1781 | smp_mb(); | ||
1782 | |||
1783 | retval = request_irq(dev->irq, rtl8169_interrupt, IRQF_SHARED, | ||
1784 | dev->name, dev); | ||
1785 | if (retval < 0) | ||
1786 | goto err_release_ring_2; | ||
1787 | |||
1785 | rtl8169_hw_start(dev); | 1788 | rtl8169_hw_start(dev); |
1786 | 1789 | ||
1787 | rtl8169_request_timer(dev); | 1790 | rtl8169_request_timer(dev); |
@@ -1790,14 +1793,14 @@ static int rtl8169_open(struct net_device *dev) | |||
1790 | out: | 1793 | out: |
1791 | return retval; | 1794 | return retval; |
1792 | 1795 | ||
1793 | err_free_rx: | 1796 | err_release_ring_2: |
1797 | rtl8169_rx_clear(tp); | ||
1798 | err_free_rx_1: | ||
1794 | pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, | 1799 | pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, |
1795 | tp->RxPhyAddr); | 1800 | tp->RxPhyAddr); |
1796 | err_free_tx: | 1801 | err_free_tx_0: |
1797 | pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, | 1802 | pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, |
1798 | tp->TxPhyAddr); | 1803 | tp->TxPhyAddr); |
1799 | err_free_irq: | ||
1800 | free_irq(dev->irq, dev); | ||
1801 | goto out; | 1804 | goto out; |
1802 | } | 1805 | } |
1803 | 1806 | ||
@@ -2887,7 +2890,7 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2887 | void __iomem *ioaddr = tp->mmio_addr; | 2890 | void __iomem *ioaddr = tp->mmio_addr; |
2888 | 2891 | ||
2889 | if (!netif_running(dev)) | 2892 | if (!netif_running(dev)) |
2890 | goto out; | 2893 | goto out_pci_suspend; |
2891 | 2894 | ||
2892 | netif_device_detach(dev); | 2895 | netif_device_detach(dev); |
2893 | netif_stop_queue(dev); | 2896 | netif_stop_queue(dev); |
@@ -2901,10 +2904,11 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state) | |||
2901 | 2904 | ||
2902 | spin_unlock_irq(&tp->lock); | 2905 | spin_unlock_irq(&tp->lock); |
2903 | 2906 | ||
2907 | out_pci_suspend: | ||
2904 | pci_save_state(pdev); | 2908 | pci_save_state(pdev); |
2905 | pci_enable_wake(pdev, pci_choose_state(pdev, state), tp->wol_enabled); | 2909 | pci_enable_wake(pdev, pci_choose_state(pdev, state), tp->wol_enabled); |
2906 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); | 2910 | pci_set_power_state(pdev, pci_choose_state(pdev, state)); |
2907 | out: | 2911 | |
2908 | return 0; | 2912 | return 0; |
2909 | } | 2913 | } |
2910 | 2914 | ||
@@ -2912,15 +2916,15 @@ static int rtl8169_resume(struct pci_dev *pdev) | |||
2912 | { | 2916 | { |
2913 | struct net_device *dev = pci_get_drvdata(pdev); | 2917 | struct net_device *dev = pci_get_drvdata(pdev); |
2914 | 2918 | ||
2919 | pci_set_power_state(pdev, PCI_D0); | ||
2920 | pci_restore_state(pdev); | ||
2921 | pci_enable_wake(pdev, PCI_D0, 0); | ||
2922 | |||
2915 | if (!netif_running(dev)) | 2923 | if (!netif_running(dev)) |
2916 | goto out; | 2924 | goto out; |
2917 | 2925 | ||
2918 | netif_device_attach(dev); | 2926 | netif_device_attach(dev); |
2919 | 2927 | ||
2920 | pci_set_power_state(pdev, PCI_D0); | ||
2921 | pci_restore_state(pdev); | ||
2922 | pci_enable_wake(pdev, PCI_D0, 0); | ||
2923 | |||
2924 | rtl8169_schedule_work(dev, rtl8169_reset_task); | 2928 | rtl8169_schedule_work(dev, rtl8169_reset_task); |
2925 | out: | 2929 | out: |
2926 | return 0; | 2930 | return 0; |