diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/mem.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/w83627ehf.c | 6 | ||||
-rw-r--r-- | drivers/i2c/busses/Kconfig | 3 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-pasemi.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_mr.c | 1 | ||||
-rw-r--r-- | drivers/kvm/mmu.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/smu.c | 4 | ||||
-rw-r--r-- | drivers/net/Kconfig | 1 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_defs.h | 5 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 69 | ||||
-rw-r--r-- | drivers/net/cxgb3/t3_hw.c | 18 | ||||
-rw-r--r-- | drivers/net/sky2.c | 176 | ||||
-rw-r--r-- | drivers/net/sky2.h | 11 | ||||
-rw-r--r-- | drivers/net/spider_net.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi_s3c24xx.c | 4 |
15 files changed, 204 insertions, 105 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index f5c160caf9f4..5f066963f171 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -248,7 +248,7 @@ static unsigned long get_unmapped_area_mem(struct file *file, | |||
248 | { | 248 | { |
249 | if (!valid_mmap_phys_addr_range(pgoff, len)) | 249 | if (!valid_mmap_phys_addr_range(pgoff, len)) |
250 | return (unsigned long) -EINVAL; | 250 | return (unsigned long) -EINVAL; |
251 | return pgoff; | 251 | return pgoff << PAGE_SHIFT; |
252 | } | 252 | } |
253 | 253 | ||
254 | /* can't do an in-place private mapping if there's no MMU */ | 254 | /* can't do an in-place private mapping if there's no MMU */ |
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index da5828f2dfc2..01206ebb1cf2 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -407,7 +407,7 @@ static void w83627ehf_write_fan_div(struct i2c_client *client, int nr) | |||
407 | break; | 407 | break; |
408 | case 4: | 408 | case 4: |
409 | reg = (w83627ehf_read_value(client, W83627EHF_REG_DIODE) & 0x73) | 409 | reg = (w83627ehf_read_value(client, W83627EHF_REG_DIODE) & 0x73) |
410 | | ((data->fan_div[4] & 0x03) << 3) | 410 | | ((data->fan_div[4] & 0x03) << 2) |
411 | | ((data->fan_div[4] & 0x04) << 5); | 411 | | ((data->fan_div[4] & 0x04) << 5); |
412 | w83627ehf_write_value(client, W83627EHF_REG_DIODE, reg); | 412 | w83627ehf_write_value(client, W83627EHF_REG_DIODE, reg); |
413 | break; | 413 | break; |
@@ -471,9 +471,9 @@ static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) | |||
471 | time */ | 471 | time */ |
472 | if (data->fan[i] == 0xff | 472 | if (data->fan[i] == 0xff |
473 | && data->fan_div[i] < 0x07) { | 473 | && data->fan_div[i] < 0x07) { |
474 | dev_dbg(&client->dev, "Increasing fan %d " | 474 | dev_dbg(&client->dev, "Increasing fan%d " |
475 | "clock divider from %u to %u\n", | 475 | "clock divider from %u to %u\n", |
476 | i, div_from_reg(data->fan_div[i]), | 476 | i + 1, div_from_reg(data->fan_div[i]), |
477 | div_from_reg(data->fan_div[i] + 1)); | 477 | div_from_reg(data->fan_div[i] + 1)); |
478 | data->fan_div[i]++; | 478 | data->fan_div[i]++; |
479 | w83627ehf_write_fan_div(client, i); | 479 | w83627ehf_write_fan_div(client, i); |
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index fb19dbb31e42..ece31d2c6c64 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -344,8 +344,7 @@ config I2C_PARPORT_LIGHT | |||
344 | 344 | ||
345 | config I2C_PASEMI | 345 | config I2C_PASEMI |
346 | tristate "PA Semi SMBus interface" | 346 | tristate "PA Semi SMBus interface" |
347 | # depends on PPC_PASEMI && I2C && PCI | 347 | depends on PPC_PASEMI && I2C && PCI |
348 | depends on I2C && PCI | ||
349 | help | 348 | help |
350 | Supports the PA Semi PWRficient on-chip SMBus interfaces. | 349 | Supports the PA Semi PWRficient on-chip SMBus interfaces. |
351 | 350 | ||
diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c index f54fb5d65cc4..bf89eeef74e9 100644 --- a/drivers/i2c/busses/i2c-pasemi.c +++ b/drivers/i2c/busses/i2c-pasemi.c | |||
@@ -141,7 +141,7 @@ static int pasemi_i2c_xfer_msg(struct i2c_adapter *adapter, | |||
141 | for (i = 0; i < msg->len - 1; i++) | 141 | for (i = 0; i < msg->len - 1; i++) |
142 | TXFIFO_WR(smbus, msg->buf[i]); | 142 | TXFIFO_WR(smbus, msg->buf[i]); |
143 | 143 | ||
144 | TXFIFO_WR(smbus, msg->buf[msg->len] | | 144 | TXFIFO_WR(smbus, msg->buf[msg->len-1] | |
145 | (stop ? MTXFIFO_STOP : 0)); | 145 | (stop ? MTXFIFO_STOP : 0)); |
146 | } | 146 | } |
147 | 147 | ||
@@ -226,7 +226,7 @@ static int pasemi_smb_xfer(struct i2c_adapter *adapter, | |||
226 | rd = RXFIFO_RD(smbus); | 226 | rd = RXFIFO_RD(smbus); |
227 | len = min_t(u8, (rd & MRXFIFO_DATA_M), | 227 | len = min_t(u8, (rd & MRXFIFO_DATA_M), |
228 | I2C_SMBUS_BLOCK_MAX); | 228 | I2C_SMBUS_BLOCK_MAX); |
229 | TXFIFO_WR(smbus, (len + 1) | MTXFIFO_READ | | 229 | TXFIFO_WR(smbus, len | MTXFIFO_READ | |
230 | MTXFIFO_STOP); | 230 | MTXFIFO_STOP); |
231 | } else { | 231 | } else { |
232 | len = min_t(u8, data->block[0], I2C_SMBUS_BLOCK_MAX); | 232 | len = min_t(u8, data->block[0], I2C_SMBUS_BLOCK_MAX); |
@@ -258,7 +258,7 @@ static int pasemi_smb_xfer(struct i2c_adapter *adapter, | |||
258 | rd = RXFIFO_RD(smbus); | 258 | rd = RXFIFO_RD(smbus); |
259 | len = min_t(u8, (rd & MRXFIFO_DATA_M), | 259 | len = min_t(u8, (rd & MRXFIFO_DATA_M), |
260 | I2C_SMBUS_BLOCK_MAX - len); | 260 | I2C_SMBUS_BLOCK_MAX - len); |
261 | TXFIFO_WR(smbus, (len + 1) | MTXFIFO_READ | MTXFIFO_STOP); | 261 | TXFIFO_WR(smbus, len | MTXFIFO_READ | MTXFIFO_STOP); |
262 | break; | 262 | break; |
263 | 263 | ||
264 | default: | 264 | default: |
diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c index fdb576dcfaa8..ee561c569d5f 100644 --- a/drivers/infiniband/hw/mthca/mthca_mr.c +++ b/drivers/infiniband/hw/mthca/mthca_mr.c | |||
@@ -835,6 +835,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr) | |||
835 | 835 | ||
836 | key = arbel_key_to_hw_index(fmr->ibmr.lkey); | 836 | key = arbel_key_to_hw_index(fmr->ibmr.lkey); |
837 | key &= dev->limits.num_mpts - 1; | 837 | key &= dev->limits.num_mpts - 1; |
838 | key = adjust_key(dev, key); | ||
838 | fmr->ibmr.lkey = fmr->ibmr.rkey = arbel_hw_index_to_key(key); | 839 | fmr->ibmr.lkey = fmr->ibmr.rkey = arbel_hw_index_to_key(key); |
839 | 840 | ||
840 | fmr->maps = 0; | 841 | fmr->maps = 0; |
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index e85b4c7c36f7..cab26f301eab 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -1171,6 +1171,7 @@ void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) | |||
1171 | * and zap two pdes instead of one. | 1171 | * and zap two pdes instead of one. |
1172 | */ | 1172 | */ |
1173 | if (level == PT32_ROOT_LEVEL) { | 1173 | if (level == PT32_ROOT_LEVEL) { |
1174 | page_offset &= ~7; /* kill rounding error */ | ||
1174 | page_offset <<= 1; | 1175 | page_offset <<= 1; |
1175 | npte = 2; | 1176 | npte = 2; |
1176 | } | 1177 | } |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 3096836d8bd3..c9f3dc4fd3ee 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -1259,9 +1259,9 @@ static int smu_release(struct inode *inode, struct file *file) | |||
1259 | set_current_state(TASK_UNINTERRUPTIBLE); | 1259 | set_current_state(TASK_UNINTERRUPTIBLE); |
1260 | if (pp->cmd.status != 1) | 1260 | if (pp->cmd.status != 1) |
1261 | break; | 1261 | break; |
1262 | spin_lock_irqsave(&pp->lock, flags); | ||
1263 | schedule(); | ||
1264 | spin_unlock_irqrestore(&pp->lock, flags); | 1262 | spin_unlock_irqrestore(&pp->lock, flags); |
1263 | schedule(); | ||
1264 | spin_lock_irqsave(&pp->lock, flags); | ||
1265 | } | 1265 | } |
1266 | set_current_state(TASK_RUNNING); | 1266 | set_current_state(TASK_RUNNING); |
1267 | remove_wait_queue(&pp->wait, &wait); | 1267 | remove_wait_queue(&pp->wait, &wait); |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index c3f9f599f134..a3d46ea37126 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2263,6 +2263,7 @@ config GIANFAR | |||
2263 | tristate "Gianfar Ethernet" | 2263 | tristate "Gianfar Ethernet" |
2264 | depends on 85xx || 83xx || PPC_86xx | 2264 | depends on 85xx || 83xx || PPC_86xx |
2265 | select PHYLIB | 2265 | select PHYLIB |
2266 | select CRC32 | ||
2266 | help | 2267 | help |
2267 | This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx, | 2268 | This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx, |
2268 | and MPC86xx family of chips, and the FEC on the 8540. | 2269 | and MPC86xx family of chips, and the FEC on the 8540. |
diff --git a/drivers/net/cxgb3/cxgb3_defs.h b/drivers/net/cxgb3/cxgb3_defs.h index e14862b43d17..483a594210a7 100644 --- a/drivers/net/cxgb3/cxgb3_defs.h +++ b/drivers/net/cxgb3/cxgb3_defs.h | |||
@@ -67,7 +67,10 @@ static inline union listen_entry *stid2entry(const struct tid_info *t, | |||
67 | static inline struct t3c_tid_entry *lookup_tid(const struct tid_info *t, | 67 | static inline struct t3c_tid_entry *lookup_tid(const struct tid_info *t, |
68 | unsigned int tid) | 68 | unsigned int tid) |
69 | { | 69 | { |
70 | return tid < t->ntids ? &(t->tid_tab[tid]) : NULL; | 70 | struct t3c_tid_entry *t3c_tid = tid < t->ntids ? |
71 | &(t->tid_tab[tid]) : NULL; | ||
72 | |||
73 | return (t3c_tid && t3c_tid->client) ? t3c_tid : NULL; | ||
71 | } | 74 | } |
72 | 75 | ||
73 | /* | 76 | /* |
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index 48649244673e..199e5066acf3 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -508,6 +508,7 @@ void cxgb3_queue_tid_release(struct t3cdev *tdev, unsigned int tid) | |||
508 | 508 | ||
509 | spin_lock_bh(&td->tid_release_lock); | 509 | spin_lock_bh(&td->tid_release_lock); |
510 | p->ctx = (void *)td->tid_release_list; | 510 | p->ctx = (void *)td->tid_release_list; |
511 | p->client = NULL; | ||
511 | td->tid_release_list = p; | 512 | td->tid_release_list = p; |
512 | if (!p->ctx) | 513 | if (!p->ctx) |
513 | schedule_work(&td->tid_release_task); | 514 | schedule_work(&td->tid_release_task); |
@@ -623,7 +624,8 @@ static int do_act_open_rpl(struct t3cdev *dev, struct sk_buff *skb) | |||
623 | struct t3c_tid_entry *t3c_tid; | 624 | struct t3c_tid_entry *t3c_tid; |
624 | 625 | ||
625 | t3c_tid = lookup_atid(&(T3C_DATA(dev))->tid_maps, atid); | 626 | t3c_tid = lookup_atid(&(T3C_DATA(dev))->tid_maps, atid); |
626 | if (t3c_tid->ctx && t3c_tid->client && t3c_tid->client->handlers && | 627 | if (t3c_tid && t3c_tid->ctx && t3c_tid->client && |
628 | t3c_tid->client->handlers && | ||
627 | t3c_tid->client->handlers[CPL_ACT_OPEN_RPL]) { | 629 | t3c_tid->client->handlers[CPL_ACT_OPEN_RPL]) { |
628 | return t3c_tid->client->handlers[CPL_ACT_OPEN_RPL] (dev, skb, | 630 | return t3c_tid->client->handlers[CPL_ACT_OPEN_RPL] (dev, skb, |
629 | t3c_tid-> | 631 | t3c_tid-> |
@@ -642,7 +644,7 @@ static int do_stid_rpl(struct t3cdev *dev, struct sk_buff *skb) | |||
642 | struct t3c_tid_entry *t3c_tid; | 644 | struct t3c_tid_entry *t3c_tid; |
643 | 645 | ||
644 | t3c_tid = lookup_stid(&(T3C_DATA(dev))->tid_maps, stid); | 646 | t3c_tid = lookup_stid(&(T3C_DATA(dev))->tid_maps, stid); |
645 | if (t3c_tid->ctx && t3c_tid->client->handlers && | 647 | if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && |
646 | t3c_tid->client->handlers[p->opcode]) { | 648 | t3c_tid->client->handlers[p->opcode]) { |
647 | return t3c_tid->client->handlers[p->opcode] (dev, skb, | 649 | return t3c_tid->client->handlers[p->opcode] (dev, skb, |
648 | t3c_tid->ctx); | 650 | t3c_tid->ctx); |
@@ -660,7 +662,7 @@ static int do_hwtid_rpl(struct t3cdev *dev, struct sk_buff *skb) | |||
660 | struct t3c_tid_entry *t3c_tid; | 662 | struct t3c_tid_entry *t3c_tid; |
661 | 663 | ||
662 | t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); | 664 | t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); |
663 | if (t3c_tid->ctx && t3c_tid->client->handlers && | 665 | if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && |
664 | t3c_tid->client->handlers[p->opcode]) { | 666 | t3c_tid->client->handlers[p->opcode]) { |
665 | return t3c_tid->client->handlers[p->opcode] | 667 | return t3c_tid->client->handlers[p->opcode] |
666 | (dev, skb, t3c_tid->ctx); | 668 | (dev, skb, t3c_tid->ctx); |
@@ -689,6 +691,28 @@ static int do_cr(struct t3cdev *dev, struct sk_buff *skb) | |||
689 | } | 691 | } |
690 | } | 692 | } |
691 | 693 | ||
694 | /* | ||
695 | * Returns an sk_buff for a reply CPL message of size len. If the input | ||
696 | * sk_buff has no other users it is trimmed and reused, otherwise a new buffer | ||
697 | * is allocated. The input skb must be of size at least len. Note that this | ||
698 | * operation does not destroy the original skb data even if it decides to reuse | ||
699 | * the buffer. | ||
700 | */ | ||
701 | static struct sk_buff *cxgb3_get_cpl_reply_skb(struct sk_buff *skb, size_t len, | ||
702 | int gfp) | ||
703 | { | ||
704 | if (likely(!skb_cloned(skb))) { | ||
705 | BUG_ON(skb->len < len); | ||
706 | __skb_trim(skb, len); | ||
707 | skb_get(skb); | ||
708 | } else { | ||
709 | skb = alloc_skb(len, gfp); | ||
710 | if (skb) | ||
711 | __skb_put(skb, len); | ||
712 | } | ||
713 | return skb; | ||
714 | } | ||
715 | |||
692 | static int do_abort_req_rss(struct t3cdev *dev, struct sk_buff *skb) | 716 | static int do_abort_req_rss(struct t3cdev *dev, struct sk_buff *skb) |
693 | { | 717 | { |
694 | union opcode_tid *p = cplhdr(skb); | 718 | union opcode_tid *p = cplhdr(skb); |
@@ -696,30 +720,39 @@ static int do_abort_req_rss(struct t3cdev *dev, struct sk_buff *skb) | |||
696 | struct t3c_tid_entry *t3c_tid; | 720 | struct t3c_tid_entry *t3c_tid; |
697 | 721 | ||
698 | t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); | 722 | t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); |
699 | if (t3c_tid->ctx && t3c_tid->client->handlers && | 723 | if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && |
700 | t3c_tid->client->handlers[p->opcode]) { | 724 | t3c_tid->client->handlers[p->opcode]) { |
701 | return t3c_tid->client->handlers[p->opcode] | 725 | return t3c_tid->client->handlers[p->opcode] |
702 | (dev, skb, t3c_tid->ctx); | 726 | (dev, skb, t3c_tid->ctx); |
703 | } else { | 727 | } else { |
704 | struct cpl_abort_req_rss *req = cplhdr(skb); | 728 | struct cpl_abort_req_rss *req = cplhdr(skb); |
705 | struct cpl_abort_rpl *rpl; | 729 | struct cpl_abort_rpl *rpl; |
730 | struct sk_buff *reply_skb; | ||
731 | unsigned int tid = GET_TID(req); | ||
732 | u8 cmd = req->status; | ||
733 | |||
734 | if (req->status == CPL_ERR_RTX_NEG_ADVICE || | ||
735 | req->status == CPL_ERR_PERSIST_NEG_ADVICE) | ||
736 | goto out; | ||
706 | 737 | ||
707 | struct sk_buff *skb = | 738 | reply_skb = cxgb3_get_cpl_reply_skb(skb, |
708 | alloc_skb(sizeof(struct cpl_abort_rpl), GFP_ATOMIC); | 739 | sizeof(struct |
709 | if (!skb) { | 740 | cpl_abort_rpl), |
741 | GFP_ATOMIC); | ||
742 | |||
743 | if (!reply_skb) { | ||
710 | printk("do_abort_req_rss: couldn't get skb!\n"); | 744 | printk("do_abort_req_rss: couldn't get skb!\n"); |
711 | goto out; | 745 | goto out; |
712 | } | 746 | } |
713 | skb->priority = CPL_PRIORITY_DATA; | 747 | reply_skb->priority = CPL_PRIORITY_DATA; |
714 | __skb_put(skb, sizeof(struct cpl_abort_rpl)); | 748 | __skb_put(reply_skb, sizeof(struct cpl_abort_rpl)); |
715 | rpl = cplhdr(skb); | 749 | rpl = cplhdr(reply_skb); |
716 | rpl->wr.wr_hi = | 750 | rpl->wr.wr_hi = |
717 | htonl(V_WR_OP(FW_WROPCODE_OFLD_HOST_ABORT_CON_RPL)); | 751 | htonl(V_WR_OP(FW_WROPCODE_OFLD_HOST_ABORT_CON_RPL)); |
718 | rpl->wr.wr_lo = htonl(V_WR_TID(GET_TID(req))); | 752 | rpl->wr.wr_lo = htonl(V_WR_TID(tid)); |
719 | OPCODE_TID(rpl) = | 753 | OPCODE_TID(rpl) = htonl(MK_OPCODE_TID(CPL_ABORT_RPL, tid)); |
720 | htonl(MK_OPCODE_TID(CPL_ABORT_RPL, GET_TID(req))); | 754 | rpl->cmd = cmd; |
721 | rpl->cmd = req->status; | 755 | cxgb3_ofld_send(dev, reply_skb); |
722 | cxgb3_ofld_send(dev, skb); | ||
723 | out: | 756 | out: |
724 | return CPL_RET_BUF_DONE; | 757 | return CPL_RET_BUF_DONE; |
725 | } | 758 | } |
@@ -732,7 +765,7 @@ static int do_act_establish(struct t3cdev *dev, struct sk_buff *skb) | |||
732 | struct t3c_tid_entry *t3c_tid; | 765 | struct t3c_tid_entry *t3c_tid; |
733 | 766 | ||
734 | t3c_tid = lookup_atid(&(T3C_DATA(dev))->tid_maps, atid); | 767 | t3c_tid = lookup_atid(&(T3C_DATA(dev))->tid_maps, atid); |
735 | if (t3c_tid->ctx && t3c_tid->client->handlers && | 768 | if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && |
736 | t3c_tid->client->handlers[CPL_ACT_ESTABLISH]) { | 769 | t3c_tid->client->handlers[CPL_ACT_ESTABLISH]) { |
737 | return t3c_tid->client->handlers[CPL_ACT_ESTABLISH] | 770 | return t3c_tid->client->handlers[CPL_ACT_ESTABLISH] |
738 | (dev, skb, t3c_tid->ctx); | 771 | (dev, skb, t3c_tid->ctx); |
@@ -762,7 +795,7 @@ static int do_term(struct t3cdev *dev, struct sk_buff *skb) | |||
762 | struct t3c_tid_entry *t3c_tid; | 795 | struct t3c_tid_entry *t3c_tid; |
763 | 796 | ||
764 | t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); | 797 | t3c_tid = lookup_tid(&(T3C_DATA(dev))->tid_maps, hwtid); |
765 | if (t3c_tid->ctx && t3c_tid->client->handlers && | 798 | if (t3c_tid && t3c_tid->ctx && t3c_tid->client->handlers && |
766 | t3c_tid->client->handlers[opcode]) { | 799 | t3c_tid->client->handlers[opcode]) { |
767 | return t3c_tid->client->handlers[opcode] (dev, skb, | 800 | return t3c_tid->client->handlers[opcode] (dev, skb, |
768 | t3c_tid->ctx); | 801 | t3c_tid->ctx); |
@@ -961,7 +994,7 @@ void cxgb_redirect(struct dst_entry *old, struct dst_entry *new) | |||
961 | for (tid = 0; tid < ti->ntids; tid++) { | 994 | for (tid = 0; tid < ti->ntids; tid++) { |
962 | te = lookup_tid(ti, tid); | 995 | te = lookup_tid(ti, tid); |
963 | BUG_ON(!te); | 996 | BUG_ON(!te); |
964 | if (te->ctx && te->client && te->client->redirect) { | 997 | if (te && te->ctx && te->client && te->client->redirect) { |
965 | update_tcb = te->client->redirect(te->ctx, old, new, e); | 998 | update_tcb = te->client->redirect(te->ctx, old, new, e); |
966 | if (update_tcb) { | 999 | if (update_tcb) { |
967 | l2t_hold(L2DATA(tdev), e); | 1000 | l2t_hold(L2DATA(tdev), e); |
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index d83f075ef2d7..fb485d0a43d8 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
@@ -1523,19 +1523,25 @@ static int mac_intr_handler(struct adapter *adap, unsigned int idx) | |||
1523 | */ | 1523 | */ |
1524 | int t3_phy_intr_handler(struct adapter *adapter) | 1524 | int t3_phy_intr_handler(struct adapter *adapter) |
1525 | { | 1525 | { |
1526 | static const int intr_gpio_bits[] = { 8, 0x20 }; | 1526 | u32 mask, gpi = adapter_info(adapter)->gpio_intr; |
1527 | |||
1528 | u32 i, cause = t3_read_reg(adapter, A_T3DBG_INT_CAUSE); | 1527 | u32 i, cause = t3_read_reg(adapter, A_T3DBG_INT_CAUSE); |
1529 | 1528 | ||
1530 | for_each_port(adapter, i) { | 1529 | for_each_port(adapter, i) { |
1531 | if (cause & intr_gpio_bits[i]) { | 1530 | struct port_info *p = adap2pinfo(adapter, i); |
1532 | struct cphy *phy = &adap2pinfo(adapter, i)->phy; | 1531 | |
1533 | int phy_cause = phy->ops->intr_handler(phy); | 1532 | mask = gpi - (gpi & (gpi - 1)); |
1533 | gpi -= mask; | ||
1534 | |||
1535 | if (!(p->port_type->caps & SUPPORTED_IRQ)) | ||
1536 | continue; | ||
1537 | |||
1538 | if (cause & mask) { | ||
1539 | int phy_cause = p->phy.ops->intr_handler(&p->phy); | ||
1534 | 1540 | ||
1535 | if (phy_cause & cphy_cause_link_change) | 1541 | if (phy_cause & cphy_cause_link_change) |
1536 | t3_link_changed(adapter, i); | 1542 | t3_link_changed(adapter, i); |
1537 | if (phy_cause & cphy_cause_fifo_error) | 1543 | if (phy_cause & cphy_cause_fifo_error) |
1538 | phy->fifo_errors++; | 1544 | p->phy.fifo_errors++; |
1539 | } | 1545 | } |
1540 | } | 1546 | } |
1541 | 1547 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 4a009b7b1777..ac36152c68bf 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -49,7 +49,7 @@ | |||
49 | #include "sky2.h" | 49 | #include "sky2.h" |
50 | 50 | ||
51 | #define DRV_NAME "sky2" | 51 | #define DRV_NAME "sky2" |
52 | #define DRV_VERSION "1.13" | 52 | #define DRV_VERSION "1.14" |
53 | #define PFX DRV_NAME " " | 53 | #define PFX DRV_NAME " " |
54 | 54 | ||
55 | /* | 55 | /* |
@@ -123,7 +123,10 @@ static const struct pci_device_id sky2_id_table[] = { | |||
123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ | 123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ |
124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4362) }, /* 88E8053 */ | 124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4362) }, /* 88E8053 */ |
125 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4363) }, /* 88E8055 */ | 125 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4363) }, /* 88E8055 */ |
126 | #ifdef broken | ||
127 | /* This device causes data corruption problems that are not resolved */ | ||
126 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4364) }, /* 88E8056 */ | 128 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4364) }, /* 88E8056 */ |
129 | #endif | ||
127 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4366) }, /* 88EC036 */ | 130 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4366) }, /* 88EC036 */ |
128 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4367) }, /* 88EC032 */ | 131 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4367) }, /* 88EC032 */ |
129 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4368) }, /* 88EC034 */ | 132 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4368) }, /* 88EC034 */ |
@@ -740,12 +743,17 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
740 | if (hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX) { | 743 | if (hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX) { |
741 | sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8); | 744 | sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8); |
742 | sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8); | 745 | sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8); |
743 | if (hw->dev[port]->mtu > ETH_DATA_LEN) { | 746 | |
744 | /* set Tx GMAC FIFO Almost Empty Threshold */ | 747 | /* set Tx GMAC FIFO Almost Empty Threshold */ |
745 | sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR), 0x180); | 748 | sky2_write32(hw, SK_REG(port, TX_GMF_AE_THR), |
746 | /* Disable Store & Forward mode for TX */ | 749 | (ECU_JUMBO_WM << 16) | ECU_AE_THR); |
747 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_STFW_DIS); | 750 | |
748 | } | 751 | if (hw->dev[port]->mtu > ETH_DATA_LEN) |
752 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), | ||
753 | TX_JUMBO_ENA | TX_STFW_DIS); | ||
754 | else | ||
755 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), | ||
756 | TX_JUMBO_DIS | TX_STFW_ENA); | ||
749 | } | 757 | } |
750 | 758 | ||
751 | } | 759 | } |
@@ -1278,7 +1286,7 @@ static int sky2_up(struct net_device *dev) | |||
1278 | /* Set almost empty threshold */ | 1286 | /* Set almost empty threshold */ |
1279 | if (hw->chip_id == CHIP_ID_YUKON_EC_U | 1287 | if (hw->chip_id == CHIP_ID_YUKON_EC_U |
1280 | && hw->chip_rev == CHIP_REV_YU_EC_U_A0) | 1288 | && hw->chip_rev == CHIP_REV_YU_EC_U_A0) |
1281 | sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), 0x1a0); | 1289 | sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), ECU_TXFF_LEV); |
1282 | 1290 | ||
1283 | sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, | 1291 | sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, |
1284 | TX_RING_SIZE - 1); | 1292 | TX_RING_SIZE - 1); |
@@ -1584,13 +1592,6 @@ static int sky2_down(struct net_device *dev) | |||
1584 | sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), | 1592 | sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), |
1585 | RB_RST_SET | RB_DIS_OP_MD); | 1593 | RB_RST_SET | RB_DIS_OP_MD); |
1586 | 1594 | ||
1587 | /* WA for dev. #4.209 */ | ||
1588 | if (hw->chip_id == CHIP_ID_YUKON_EC_U | ||
1589 | && (hw->chip_rev == CHIP_REV_YU_EC_U_A1 || hw->chip_rev == CHIP_REV_YU_EC_U_B0)) | ||
1590 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), | ||
1591 | sky2->speed != SPEED_1000 ? | ||
1592 | TX_STFW_ENA : TX_STFW_DIS); | ||
1593 | |||
1594 | ctrl = gma_read16(hw, port, GM_GP_CTRL); | 1595 | ctrl = gma_read16(hw, port, GM_GP_CTRL); |
1595 | ctrl &= ~(GM_GPCR_TX_ENA | GM_GPCR_RX_ENA); | 1596 | ctrl &= ~(GM_GPCR_TX_ENA | GM_GPCR_RX_ENA); |
1596 | gma_write16(hw, port, GM_GP_CTRL, ctrl); | 1597 | gma_write16(hw, port, GM_GP_CTRL, ctrl); |
@@ -1890,6 +1891,7 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
1890 | { | 1891 | { |
1891 | struct sky2_port *sky2 = netdev_priv(dev); | 1892 | struct sky2_port *sky2 = netdev_priv(dev); |
1892 | struct sky2_hw *hw = sky2->hw; | 1893 | struct sky2_hw *hw = sky2->hw; |
1894 | unsigned port = sky2->port; | ||
1893 | int err; | 1895 | int err; |
1894 | u16 ctl, mode; | 1896 | u16 ctl, mode; |
1895 | u32 imask; | 1897 | u32 imask; |
@@ -1897,9 +1899,8 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
1897 | if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) | 1899 | if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) |
1898 | return -EINVAL; | 1900 | return -EINVAL; |
1899 | 1901 | ||
1900 | /* TSO on Yukon Ultra and MTU > 1500 not supported */ | 1902 | if (new_mtu > ETH_DATA_LEN && hw->chip_id == CHIP_ID_YUKON_FE) |
1901 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && new_mtu > ETH_DATA_LEN) | 1903 | return -EINVAL; |
1902 | dev->features &= ~NETIF_F_TSO; | ||
1903 | 1904 | ||
1904 | if (!netif_running(dev)) { | 1905 | if (!netif_running(dev)) { |
1905 | dev->mtu = new_mtu; | 1906 | dev->mtu = new_mtu; |
@@ -1915,8 +1916,18 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
1915 | 1916 | ||
1916 | synchronize_irq(hw->pdev->irq); | 1917 | synchronize_irq(hw->pdev->irq); |
1917 | 1918 | ||
1918 | ctl = gma_read16(hw, sky2->port, GM_GP_CTRL); | 1919 | if (hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX) { |
1919 | gma_write16(hw, sky2->port, GM_GP_CTRL, ctl & ~GM_GPCR_RX_ENA); | 1920 | if (new_mtu > ETH_DATA_LEN) { |
1921 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), | ||
1922 | TX_JUMBO_ENA | TX_STFW_DIS); | ||
1923 | dev->features &= NETIF_F_TSO | NETIF_F_SG | NETIF_F_IP_CSUM; | ||
1924 | } else | ||
1925 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), | ||
1926 | TX_JUMBO_DIS | TX_STFW_ENA); | ||
1927 | } | ||
1928 | |||
1929 | ctl = gma_read16(hw, port, GM_GP_CTRL); | ||
1930 | gma_write16(hw, port, GM_GP_CTRL, ctl & ~GM_GPCR_RX_ENA); | ||
1920 | sky2_rx_stop(sky2); | 1931 | sky2_rx_stop(sky2); |
1921 | sky2_rx_clean(sky2); | 1932 | sky2_rx_clean(sky2); |
1922 | 1933 | ||
@@ -1928,9 +1939,9 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
1928 | if (dev->mtu > ETH_DATA_LEN) | 1939 | if (dev->mtu > ETH_DATA_LEN) |
1929 | mode |= GM_SMOD_JUMBO_ENA; | 1940 | mode |= GM_SMOD_JUMBO_ENA; |
1930 | 1941 | ||
1931 | gma_write16(hw, sky2->port, GM_SERIAL_MODE, mode); | 1942 | gma_write16(hw, port, GM_SERIAL_MODE, mode); |
1932 | 1943 | ||
1933 | sky2_write8(hw, RB_ADDR(rxqaddr[sky2->port], RB_CTRL), RB_ENA_OP_MD); | 1944 | sky2_write8(hw, RB_ADDR(rxqaddr[port], RB_CTRL), RB_ENA_OP_MD); |
1934 | 1945 | ||
1935 | err = sky2_rx_start(sky2); | 1946 | err = sky2_rx_start(sky2); |
1936 | sky2_write32(hw, B0_IMSK, imask); | 1947 | sky2_write32(hw, B0_IMSK, imask); |
@@ -1938,7 +1949,7 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
1938 | if (err) | 1949 | if (err) |
1939 | dev_close(dev); | 1950 | dev_close(dev); |
1940 | else { | 1951 | else { |
1941 | gma_write16(hw, sky2->port, GM_GP_CTRL, ctl); | 1952 | gma_write16(hw, port, GM_GP_CTRL, ctl); |
1942 | 1953 | ||
1943 | netif_poll_enable(hw->dev[0]); | 1954 | netif_poll_enable(hw->dev[0]); |
1944 | netif_wake_queue(dev); | 1955 | netif_wake_queue(dev); |
@@ -2340,26 +2351,22 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port) | |||
2340 | } | 2351 | } |
2341 | } | 2352 | } |
2342 | 2353 | ||
2343 | /* This should never happen it is a fatal situation */ | 2354 | /* This should never happen it is a bug. */ |
2344 | static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port, | 2355 | static void sky2_le_error(struct sky2_hw *hw, unsigned port, |
2345 | const char *rxtx, u32 mask) | 2356 | u16 q, unsigned ring_size) |
2346 | { | 2357 | { |
2347 | struct net_device *dev = hw->dev[port]; | 2358 | struct net_device *dev = hw->dev[port]; |
2348 | struct sky2_port *sky2 = netdev_priv(dev); | 2359 | struct sky2_port *sky2 = netdev_priv(dev); |
2349 | u32 imask; | 2360 | unsigned idx; |
2350 | 2361 | const u64 *le = (q == Q_R1 || q == Q_R2) | |
2351 | printk(KERN_ERR PFX "%s: %s descriptor error (hardware problem)\n", | 2362 | ? (u64 *) sky2->rx_le : (u64 *) sky2->tx_le; |
2352 | dev ? dev->name : "<not registered>", rxtx); | ||
2353 | 2363 | ||
2354 | imask = sky2_read32(hw, B0_IMSK); | 2364 | idx = sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_GET_IDX)); |
2355 | imask &= ~mask; | 2365 | printk(KERN_ERR PFX "%s: descriptor error q=%#x get=%u [%llx] put=%u\n", |
2356 | sky2_write32(hw, B0_IMSK, imask); | 2366 | dev->name, (unsigned) q, idx, (unsigned long long) le[idx], |
2367 | (unsigned) sky2_read16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX))); | ||
2357 | 2368 | ||
2358 | if (dev) { | 2369 | sky2_write32(hw, Q_ADDR(q, Q_CSR), BMU_CLR_IRQ_CHK); |
2359 | spin_lock(&sky2->phy_lock); | ||
2360 | sky2_link_down(sky2); | ||
2361 | spin_unlock(&sky2->phy_lock); | ||
2362 | } | ||
2363 | } | 2370 | } |
2364 | 2371 | ||
2365 | /* If idle then force a fake soft NAPI poll once a second | 2372 | /* If idle then force a fake soft NAPI poll once a second |
@@ -2383,23 +2390,15 @@ static void sky2_idle(unsigned long arg) | |||
2383 | mod_timer(&hw->idle_timer, jiffies + msecs_to_jiffies(idle_timeout)); | 2390 | mod_timer(&hw->idle_timer, jiffies + msecs_to_jiffies(idle_timeout)); |
2384 | } | 2391 | } |
2385 | 2392 | ||
2386 | 2393 | /* Hardware/software error handling */ | |
2387 | static int sky2_poll(struct net_device *dev0, int *budget) | 2394 | static void sky2_err_intr(struct sky2_hw *hw, u32 status) |
2388 | { | 2395 | { |
2389 | struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw; | 2396 | if (net_ratelimit()) |
2390 | int work_limit = min(dev0->quota, *budget); | 2397 | dev_warn(&hw->pdev->dev, "error interrupt status=%#x\n", status); |
2391 | int work_done = 0; | ||
2392 | u32 status = sky2_read32(hw, B0_Y2_SP_EISR); | ||
2393 | 2398 | ||
2394 | if (status & Y2_IS_HW_ERR) | 2399 | if (status & Y2_IS_HW_ERR) |
2395 | sky2_hw_intr(hw); | 2400 | sky2_hw_intr(hw); |
2396 | 2401 | ||
2397 | if (status & Y2_IS_IRQ_PHY1) | ||
2398 | sky2_phy_intr(hw, 0); | ||
2399 | |||
2400 | if (status & Y2_IS_IRQ_PHY2) | ||
2401 | sky2_phy_intr(hw, 1); | ||
2402 | |||
2403 | if (status & Y2_IS_IRQ_MAC1) | 2402 | if (status & Y2_IS_IRQ_MAC1) |
2404 | sky2_mac_intr(hw, 0); | 2403 | sky2_mac_intr(hw, 0); |
2405 | 2404 | ||
@@ -2407,16 +2406,33 @@ static int sky2_poll(struct net_device *dev0, int *budget) | |||
2407 | sky2_mac_intr(hw, 1); | 2406 | sky2_mac_intr(hw, 1); |
2408 | 2407 | ||
2409 | if (status & Y2_IS_CHK_RX1) | 2408 | if (status & Y2_IS_CHK_RX1) |
2410 | sky2_descriptor_error(hw, 0, "receive", Y2_IS_CHK_RX1); | 2409 | sky2_le_error(hw, 0, Q_R1, RX_LE_SIZE); |
2411 | 2410 | ||
2412 | if (status & Y2_IS_CHK_RX2) | 2411 | if (status & Y2_IS_CHK_RX2) |
2413 | sky2_descriptor_error(hw, 1, "receive", Y2_IS_CHK_RX2); | 2412 | sky2_le_error(hw, 1, Q_R2, RX_LE_SIZE); |
2414 | 2413 | ||
2415 | if (status & Y2_IS_CHK_TXA1) | 2414 | if (status & Y2_IS_CHK_TXA1) |
2416 | sky2_descriptor_error(hw, 0, "transmit", Y2_IS_CHK_TXA1); | 2415 | sky2_le_error(hw, 0, Q_XA1, TX_RING_SIZE); |
2417 | 2416 | ||
2418 | if (status & Y2_IS_CHK_TXA2) | 2417 | if (status & Y2_IS_CHK_TXA2) |
2419 | sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2); | 2418 | sky2_le_error(hw, 1, Q_XA2, TX_RING_SIZE); |
2419 | } | ||
2420 | |||
2421 | static int sky2_poll(struct net_device *dev0, int *budget) | ||
2422 | { | ||
2423 | struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw; | ||
2424 | int work_limit = min(dev0->quota, *budget); | ||
2425 | int work_done = 0; | ||
2426 | u32 status = sky2_read32(hw, B0_Y2_SP_EISR); | ||
2427 | |||
2428 | if (unlikely(status & Y2_IS_ERROR)) | ||
2429 | sky2_err_intr(hw, status); | ||
2430 | |||
2431 | if (status & Y2_IS_IRQ_PHY1) | ||
2432 | sky2_phy_intr(hw, 0); | ||
2433 | |||
2434 | if (status & Y2_IS_IRQ_PHY2) | ||
2435 | sky2_phy_intr(hw, 1); | ||
2420 | 2436 | ||
2421 | work_done = sky2_status_intr(hw, work_limit); | 2437 | work_done = sky2_status_intr(hw, work_limit); |
2422 | if (work_done < work_limit) { | 2438 | if (work_done < work_limit) { |
@@ -2534,16 +2550,14 @@ static void sky2_reset(struct sky2_hw *hw) | |||
2534 | int i; | 2550 | int i; |
2535 | 2551 | ||
2536 | /* disable ASF */ | 2552 | /* disable ASF */ |
2537 | if (hw->chip_id <= CHIP_ID_YUKON_EC) { | 2553 | if (hw->chip_id == CHIP_ID_YUKON_EX) { |
2538 | if (hw->chip_id == CHIP_ID_YUKON_EX) { | 2554 | status = sky2_read16(hw, HCU_CCSR); |
2539 | status = sky2_read16(hw, HCU_CCSR); | 2555 | status &= ~(HCU_CCSR_AHB_RST | HCU_CCSR_CPU_RST_MODE | |
2540 | status &= ~(HCU_CCSR_AHB_RST | HCU_CCSR_CPU_RST_MODE | | 2556 | HCU_CCSR_UC_STATE_MSK); |
2541 | HCU_CCSR_UC_STATE_MSK); | 2557 | sky2_write16(hw, HCU_CCSR, status); |
2542 | sky2_write16(hw, HCU_CCSR, status); | 2558 | } else |
2543 | } else | 2559 | sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); |
2544 | sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); | 2560 | sky2_write16(hw, B0_CTST, Y2_ASF_DISABLE); |
2545 | sky2_write16(hw, B0_CTST, Y2_ASF_DISABLE); | ||
2546 | } | ||
2547 | 2561 | ||
2548 | /* do a SW reset */ | 2562 | /* do a SW reset */ |
2549 | sky2_write8(hw, B0_CTST, CS_RST_SET); | 2563 | sky2_write8(hw, B0_CTST, CS_RST_SET); |
@@ -3328,6 +3342,36 @@ static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs, | |||
3328 | regs->len - B3_RI_WTO_R1); | 3342 | regs->len - B3_RI_WTO_R1); |
3329 | } | 3343 | } |
3330 | 3344 | ||
3345 | /* In order to do Jumbo packets on these chips, need to turn off the | ||
3346 | * transmit store/forward. Therefore checksum offload won't work. | ||
3347 | */ | ||
3348 | static int no_tx_offload(struct net_device *dev) | ||
3349 | { | ||
3350 | const struct sky2_port *sky2 = netdev_priv(dev); | ||
3351 | const struct sky2_hw *hw = sky2->hw; | ||
3352 | |||
3353 | return dev->mtu > ETH_DATA_LEN && | ||
3354 | (hw->chip_id == CHIP_ID_YUKON_EX | ||
3355 | || hw->chip_id == CHIP_ID_YUKON_EC_U); | ||
3356 | } | ||
3357 | |||
3358 | static int sky2_set_tx_csum(struct net_device *dev, u32 data) | ||
3359 | { | ||
3360 | if (data && no_tx_offload(dev)) | ||
3361 | return -EINVAL; | ||
3362 | |||
3363 | return ethtool_op_set_tx_csum(dev, data); | ||
3364 | } | ||
3365 | |||
3366 | |||
3367 | static int sky2_set_tso(struct net_device *dev, u32 data) | ||
3368 | { | ||
3369 | if (data && no_tx_offload(dev)) | ||
3370 | return -EINVAL; | ||
3371 | |||
3372 | return ethtool_op_set_tso(dev, data); | ||
3373 | } | ||
3374 | |||
3331 | static const struct ethtool_ops sky2_ethtool_ops = { | 3375 | static const struct ethtool_ops sky2_ethtool_ops = { |
3332 | .get_settings = sky2_get_settings, | 3376 | .get_settings = sky2_get_settings, |
3333 | .set_settings = sky2_set_settings, | 3377 | .set_settings = sky2_set_settings, |
@@ -3343,9 +3387,9 @@ static const struct ethtool_ops sky2_ethtool_ops = { | |||
3343 | .get_sg = ethtool_op_get_sg, | 3387 | .get_sg = ethtool_op_get_sg, |
3344 | .set_sg = ethtool_op_set_sg, | 3388 | .set_sg = ethtool_op_set_sg, |
3345 | .get_tx_csum = ethtool_op_get_tx_csum, | 3389 | .get_tx_csum = ethtool_op_get_tx_csum, |
3346 | .set_tx_csum = ethtool_op_set_tx_csum, | 3390 | .set_tx_csum = sky2_set_tx_csum, |
3347 | .get_tso = ethtool_op_get_tso, | 3391 | .get_tso = ethtool_op_get_tso, |
3348 | .set_tso = ethtool_op_set_tso, | 3392 | .set_tso = sky2_set_tso, |
3349 | .get_rx_csum = sky2_get_rx_csum, | 3393 | .get_rx_csum = sky2_get_rx_csum, |
3350 | .set_rx_csum = sky2_set_rx_csum, | 3394 | .set_rx_csum = sky2_set_rx_csum, |
3351 | .get_strings = sky2_get_strings, | 3395 | .get_strings = sky2_get_strings, |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index ac24bdc42976..5efb5afc45ba 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -288,6 +288,9 @@ enum { | |||
288 | | Y2_IS_CHK_TXA1 | Y2_IS_CHK_RX1, | 288 | | Y2_IS_CHK_TXA1 | Y2_IS_CHK_RX1, |
289 | Y2_IS_PORT_2 = Y2_IS_IRQ_PHY2 | Y2_IS_IRQ_MAC2 | 289 | Y2_IS_PORT_2 = Y2_IS_IRQ_PHY2 | Y2_IS_IRQ_MAC2 |
290 | | Y2_IS_CHK_TXA2 | Y2_IS_CHK_RX2, | 290 | | Y2_IS_CHK_TXA2 | Y2_IS_CHK_RX2, |
291 | Y2_IS_ERROR = Y2_IS_HW_ERR | | ||
292 | Y2_IS_IRQ_MAC1 | Y2_IS_CHK_TXA1 | Y2_IS_CHK_RX1 | | ||
293 | Y2_IS_IRQ_MAC2 | Y2_IS_CHK_TXA2 | Y2_IS_CHK_RX2, | ||
291 | }; | 294 | }; |
292 | 295 | ||
293 | /* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ | 296 | /* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ |
@@ -738,6 +741,11 @@ enum { | |||
738 | TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */ | 741 | TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */ |
739 | TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */ | 742 | TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */ |
740 | TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */ | 743 | TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */ |
744 | |||
745 | /* Threshold values for Yukon-EC Ultra and Extreme */ | ||
746 | ECU_AE_THR = 0x0070, /* Almost Empty Threshold */ | ||
747 | ECU_TXFF_LEV = 0x01a0, /* Tx BMU FIFO Level */ | ||
748 | ECU_JUMBO_WM = 0x0080, /* Jumbo Mode Watermark */ | ||
741 | }; | 749 | }; |
742 | 750 | ||
743 | /* Descriptor Poll Timer Registers */ | 751 | /* Descriptor Poll Timer Registers */ |
@@ -1631,6 +1639,9 @@ enum { | |||
1631 | TX_VLAN_TAG_ON = 1<<25,/* enable VLAN tagging */ | 1639 | TX_VLAN_TAG_ON = 1<<25,/* enable VLAN tagging */ |
1632 | TX_VLAN_TAG_OFF = 1<<24,/* disable VLAN tagging */ | 1640 | TX_VLAN_TAG_OFF = 1<<24,/* disable VLAN tagging */ |
1633 | 1641 | ||
1642 | TX_JUMBO_ENA = 1<<23,/* PCI Jumbo Mode enable (Yukon-EC Ultra) */ | ||
1643 | TX_JUMBO_DIS = 1<<22,/* PCI Jumbo Mode enable (Yukon-EC Ultra) */ | ||
1644 | |||
1634 | GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */ | 1645 | GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */ |
1635 | GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */ | 1646 | GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */ |
1636 | GMF_WSP_STEP = 1<<16,/* Write Shadow Pointer Step/Increment */ | 1647 | GMF_WSP_STEP = 1<<16,/* Write Shadow Pointer Step/Increment */ |
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 3b91af89e4c7..e3019d52c30f 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -719,7 +719,7 @@ spider_net_prepare_tx_descr(struct spider_net_card *card, | |||
719 | SPIDER_NET_DESCR_CARDOWNED | SPIDER_NET_DMAC_NOCS; | 719 | SPIDER_NET_DESCR_CARDOWNED | SPIDER_NET_DMAC_NOCS; |
720 | spin_unlock_irqrestore(&chain->lock, flags); | 720 | spin_unlock_irqrestore(&chain->lock, flags); |
721 | 721 | ||
722 | if (skb->protocol == htons(ETH_P_IP)) | 722 | if (skb->protocol == htons(ETH_P_IP) && skb->ip_summed == CHECKSUM_PARTIAL) |
723 | switch (skb->nh.iph->protocol) { | 723 | switch (skb->nh.iph->protocol) { |
724 | case IPPROTO_TCP: | 724 | case IPPROTO_TCP: |
725 | hwdescr->dmac_cmd_status |= SPIDER_NET_DMAC_TCP; | 725 | hwdescr->dmac_cmd_status |= SPIDER_NET_DMAC_TCP; |
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 220abce63e4a..b10211c420ef 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -77,7 +77,7 @@ static void s3c24xx_spi_chipsel(struct spi_device *spi, int value) | |||
77 | 77 | ||
78 | switch (value) { | 78 | switch (value) { |
79 | case BITBANG_CS_INACTIVE: | 79 | case BITBANG_CS_INACTIVE: |
80 | hw->pdata->set_cs(hw->pdata, spi->chip_select, cspol^1); | 80 | hw->set_cs(hw->pdata, spi->chip_select, cspol^1); |
81 | break; | 81 | break; |
82 | 82 | ||
83 | case BITBANG_CS_ACTIVE: | 83 | case BITBANG_CS_ACTIVE: |
@@ -98,7 +98,7 @@ static void s3c24xx_spi_chipsel(struct spi_device *spi, int value) | |||
98 | /* write new configration */ | 98 | /* write new configration */ |
99 | 99 | ||
100 | writeb(spcon, hw->regs + S3C2410_SPCON); | 100 | writeb(spcon, hw->regs + S3C2410_SPCON); |
101 | hw->pdata->set_cs(hw->pdata, spi->chip_select, cspol); | 101 | hw->set_cs(hw->pdata, spi->chip_select, cspol); |
102 | 102 | ||
103 | break; | 103 | break; |
104 | } | 104 | } |