aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-04-26 04:22:15 -0400
committerJiri Kosina <jkosina@suse.cz>2011-04-26 04:22:59 -0400
commit07f9479a40cc778bc1462ada11f95b01360ae4ff (patch)
tree0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /drivers/net/can
parent9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff)
parentcd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff)
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be applied for files that didn't exist on the old branch.
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/at91_can.c4
-rw-r--r--drivers/net/can/c_can/c_can.c26
-rw-r--r--drivers/net/can/c_can/c_can_platform.c9
-rw-r--r--drivers/net/can/janz-ican3.c11
-rw-r--r--drivers/net/can/mcp251x.c3
-rw-r--r--drivers/net/can/mscan/mpc5xxx_can.c2
-rw-r--r--drivers/net/can/mscan/mscan.c2
-rw-r--r--drivers/net/can/sja1000/sja1000.c2
-rw-r--r--drivers/net/can/softing/softing.h2
-rw-r--r--drivers/net/can/softing/softing_main.c2
-rw-r--r--drivers/net/can/ti_hecc.c2
-rw-r--r--drivers/net/can/usb/ems_usb.c2
-rw-r--r--drivers/net/can/usb/esd_usb2.c2
13 files changed, 33 insertions, 36 deletions
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 57d2ffbbb433..74efb5a2ad41 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -416,7 +416,7 @@ static netdev_tx_t at91_start_xmit(struct sk_buff *skb, struct net_device *dev)
416 416
417 stats->tx_bytes += cf->can_dlc; 417 stats->tx_bytes += cf->can_dlc;
418 418
419 /* _NOTE_: substract AT91_MB_TX_FIRST offset from mb! */ 419 /* _NOTE_: subtract AT91_MB_TX_FIRST offset from mb! */
420 can_put_echo_skb(skb, dev, mb - AT91_MB_TX_FIRST); 420 can_put_echo_skb(skb, dev, mb - AT91_MB_TX_FIRST);
421 421
422 /* 422 /*
@@ -782,7 +782,7 @@ static void at91_irq_tx(struct net_device *dev, u32 reg_sr)
782 reg_msr = at91_read(priv, AT91_MSR(mb)); 782 reg_msr = at91_read(priv, AT91_MSR(mb));
783 if (likely(reg_msr & AT91_MSR_MRDY && 783 if (likely(reg_msr & AT91_MSR_MRDY &&
784 ~reg_msr & AT91_MSR_MABT)) { 784 ~reg_msr & AT91_MSR_MABT)) {
785 /* _NOTE_: substract AT91_MB_TX_FIRST offset from mb! */ 785 /* _NOTE_: subtract AT91_MB_TX_FIRST offset from mb! */
786 can_get_echo_skb(dev, mb - AT91_MB_TX_FIRST); 786 can_get_echo_skb(dev, mb - AT91_MB_TX_FIRST);
787 dev->stats.tx_packets++; 787 dev->stats.tx_packets++;
788 } 788 }
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 14050786218a..7e5cc0bd913d 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -588,14 +588,9 @@ static void c_can_chip_config(struct net_device *dev)
588{ 588{
589 struct c_can_priv *priv = netdev_priv(dev); 589 struct c_can_priv *priv = netdev_priv(dev);
590 590
591 if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT) 591 /* enable automatic retransmission */
592 /* disable automatic retransmission */ 592 priv->write_reg(priv, &priv->regs->control,
593 priv->write_reg(priv, &priv->regs->control, 593 CONTROL_ENABLE_AR);
594 CONTROL_DISABLE_AR);
595 else
596 /* enable automatic retransmission */
597 priv->write_reg(priv, &priv->regs->control,
598 CONTROL_ENABLE_AR);
599 594
600 if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY & 595 if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY &
601 CAN_CTRLMODE_LOOPBACK)) { 596 CAN_CTRLMODE_LOOPBACK)) {
@@ -633,9 +628,6 @@ static void c_can_start(struct net_device *dev)
633{ 628{
634 struct c_can_priv *priv = netdev_priv(dev); 629 struct c_can_priv *priv = netdev_priv(dev);
635 630
636 /* enable status change, error and module interrupts */
637 c_can_enable_all_interrupts(priv, ENABLE_ALL_INTERRUPTS);
638
639 /* basic c_can configuration */ 631 /* basic c_can configuration */
640 c_can_chip_config(dev); 632 c_can_chip_config(dev);
641 633
@@ -643,6 +635,9 @@ static void c_can_start(struct net_device *dev)
643 635
644 /* reset tx helper pointers */ 636 /* reset tx helper pointers */
645 priv->tx_next = priv->tx_echo = 0; 637 priv->tx_next = priv->tx_echo = 0;
638
639 /* enable status change, error and module interrupts */
640 c_can_enable_all_interrupts(priv, ENABLE_ALL_INTERRUPTS);
646} 641}
647 642
648static void c_can_stop(struct net_device *dev) 643static void c_can_stop(struct net_device *dev)
@@ -704,7 +699,6 @@ static void c_can_do_tx(struct net_device *dev)
704 699
705 for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) { 700 for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) {
706 msg_obj_no = get_tx_echo_msg_obj(priv); 701 msg_obj_no = get_tx_echo_msg_obj(priv);
707 c_can_inval_msg_object(dev, 0, msg_obj_no);
708 val = c_can_read_reg32(priv, &priv->regs->txrqst1); 702 val = c_can_read_reg32(priv, &priv->regs->txrqst1);
709 if (!(val & (1 << msg_obj_no))) { 703 if (!(val & (1 << msg_obj_no))) {
710 can_get_echo_skb(dev, 704 can_get_echo_skb(dev,
@@ -713,6 +707,7 @@ static void c_can_do_tx(struct net_device *dev)
713 &priv->regs->ifregs[0].msg_cntrl) 707 &priv->regs->ifregs[0].msg_cntrl)
714 & IF_MCONT_DLC_MASK; 708 & IF_MCONT_DLC_MASK;
715 stats->tx_packets++; 709 stats->tx_packets++;
710 c_can_inval_msg_object(dev, 0, msg_obj_no);
716 } 711 }
717 } 712 }
718 713
@@ -818,7 +813,7 @@ static int c_can_handle_state_change(struct net_device *dev,
818 struct sk_buff *skb; 813 struct sk_buff *skb;
819 struct can_berr_counter bec; 814 struct can_berr_counter bec;
820 815
821 /* propogate the error condition to the CAN stack */ 816 /* propagate the error condition to the CAN stack */
822 skb = alloc_can_err_skb(dev, &cf); 817 skb = alloc_can_err_skb(dev, &cf);
823 if (unlikely(!skb)) 818 if (unlikely(!skb))
824 return 0; 819 return 0;
@@ -892,7 +887,7 @@ static int c_can_handle_bus_err(struct net_device *dev,
892 if (lec_type == LEC_UNUSED || lec_type == LEC_NO_ERROR) 887 if (lec_type == LEC_UNUSED || lec_type == LEC_NO_ERROR)
893 return 0; 888 return 0;
894 889
895 /* propogate the error condition to the CAN stack */ 890 /* propagate the error condition to the CAN stack */
896 skb = alloc_can_err_skb(dev, &cf); 891 skb = alloc_can_err_skb(dev, &cf);
897 if (unlikely(!skb)) 892 if (unlikely(!skb))
898 return 0; 893 return 0;
@@ -1112,8 +1107,7 @@ struct net_device *alloc_c_can_dev(void)
1112 priv->can.bittiming_const = &c_can_bittiming_const; 1107 priv->can.bittiming_const = &c_can_bittiming_const;
1113 priv->can.do_set_mode = c_can_set_mode; 1108 priv->can.do_set_mode = c_can_set_mode;
1114 priv->can.do_get_berr_counter = c_can_get_berr_counter; 1109 priv->can.do_get_berr_counter = c_can_get_berr_counter;
1115 priv->can.ctrlmode_supported = CAN_CTRLMODE_ONE_SHOT | 1110 priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
1116 CAN_CTRLMODE_LOOPBACK |
1117 CAN_CTRLMODE_LISTENONLY | 1111 CAN_CTRLMODE_LISTENONLY |
1118 CAN_CTRLMODE_BERR_REPORTING; 1112 CAN_CTRLMODE_BERR_REPORTING;
1119 1113
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index e629b961ae2d..cc90824f2c9c 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -73,7 +73,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
73 void __iomem *addr; 73 void __iomem *addr;
74 struct net_device *dev; 74 struct net_device *dev;
75 struct c_can_priv *priv; 75 struct c_can_priv *priv;
76 struct resource *mem, *irq; 76 struct resource *mem;
77 int irq;
77#ifdef CONFIG_HAVE_CLK 78#ifdef CONFIG_HAVE_CLK
78 struct clk *clk; 79 struct clk *clk;
79 80
@@ -88,8 +89,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
88 89
89 /* get the platform data */ 90 /* get the platform data */
90 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 91 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
91 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 92 irq = platform_get_irq(pdev, 0);
92 if (!mem || (irq <= 0)) { 93 if (!mem || irq <= 0) {
93 ret = -ENODEV; 94 ret = -ENODEV;
94 goto exit_free_clk; 95 goto exit_free_clk;
95 } 96 }
@@ -117,7 +118,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
117 118
118 priv = netdev_priv(dev); 119 priv = netdev_priv(dev);
119 120
120 dev->irq = irq->start; 121 dev->irq = irq;
121 priv->regs = addr; 122 priv->regs = addr;
122#ifdef CONFIG_HAVE_CLK 123#ifdef CONFIG_HAVE_CLK
123 priv->can.clock.freq = clk_get_rate(clk); 124 priv->can.clock.freq = clk_get_rate(clk);
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 366f5cc050ae..587fba48cdd9 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -15,6 +15,7 @@
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/mfd/core.h>
18 19
19#include <linux/netdevice.h> 20#include <linux/netdevice.h>
20#include <linux/can.h> 21#include <linux/can.h>
@@ -273,7 +274,7 @@ static inline void ican3_set_page(struct ican3_dev *mod, unsigned int page)
273 */ 274 */
274 275
275/* 276/*
276 * Recieve a message from the ICAN3 "old-style" firmware interface 277 * Receive a message from the ICAN3 "old-style" firmware interface
277 * 278 *
278 * LOCKING: must hold mod->lock 279 * LOCKING: must hold mod->lock
279 * 280 *
@@ -1049,7 +1050,7 @@ static void ican3_handle_inquiry(struct ican3_dev *mod, struct ican3_msg *msg)
1049 complete(&mod->termination_comp); 1050 complete(&mod->termination_comp);
1050 break; 1051 break;
1051 default: 1052 default:
1052 dev_err(mod->dev, "recieved an unknown inquiry response\n"); 1053 dev_err(mod->dev, "received an unknown inquiry response\n");
1053 break; 1054 break;
1054 } 1055 }
1055} 1056}
@@ -1057,7 +1058,7 @@ static void ican3_handle_inquiry(struct ican3_dev *mod, struct ican3_msg *msg)
1057static void ican3_handle_unknown_message(struct ican3_dev *mod, 1058static void ican3_handle_unknown_message(struct ican3_dev *mod,
1058 struct ican3_msg *msg) 1059 struct ican3_msg *msg)
1059{ 1060{
1060 dev_warn(mod->dev, "recieved unknown message: spec 0x%.2x length %d\n", 1061 dev_warn(mod->dev, "received unknown message: spec 0x%.2x length %d\n",
1061 msg->spec, le16_to_cpu(msg->len)); 1062 msg->spec, le16_to_cpu(msg->len));
1062} 1063}
1063 1064
@@ -1112,7 +1113,7 @@ static bool ican3_txok(struct ican3_dev *mod)
1112} 1113}
1113 1114
1114/* 1115/*
1115 * Recieve one CAN frame from the hardware 1116 * Receive one CAN frame from the hardware
1116 * 1117 *
1117 * CONTEXT: must be called from user context 1118 * CONTEXT: must be called from user context
1118 */ 1119 */
@@ -1643,7 +1644,7 @@ static int __devinit ican3_probe(struct platform_device *pdev)
1643 struct device *dev; 1644 struct device *dev;
1644 int ret; 1645 int ret;
1645 1646
1646 pdata = pdev->dev.platform_data; 1647 pdata = mfd_get_data(pdev);
1647 if (!pdata) 1648 if (!pdata)
1648 return -ENXIO; 1649 return -ENXIO;
1649 1650
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 7513c4523ac4..330140ee266d 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -931,7 +931,8 @@ static int mcp251x_open(struct net_device *net)
931 priv->tx_len = 0; 931 priv->tx_len = 0;
932 932
933 ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist, 933 ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
934 IRQF_TRIGGER_FALLING, DEVICE_NAME, priv); 934 pdata->irq_flags ? pdata->irq_flags : IRQF_TRIGGER_FALLING,
935 DEVICE_NAME, priv);
935 if (ret) { 936 if (ret) {
936 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq); 937 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);
937 if (pdata->transceiver_enable) 938 if (pdata->transceiver_enable)
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index c0a1bc5b1435..bd1d811c204f 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -260,7 +260,7 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
260 260
261 if (!ofdev->dev.of_match) 261 if (!ofdev->dev.of_match)
262 return -EINVAL; 262 return -EINVAL;
263 data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data; 263 data = (struct mpc5xxx_can_data *)ofdev->dev.of_match->data;
264 264
265 base = of_iomap(np, 0); 265 base = of_iomap(np, 0);
266 if (!base) { 266 if (!base) {
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index 74cd880c7e06..92feac68b66e 100644
--- a/drivers/net/can/mscan/mscan.c
+++ b/drivers/net/can/mscan/mscan.c
@@ -246,7 +246,7 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev)
246 out_be16(&regs->tx.idr3_2, can_id); 246 out_be16(&regs->tx.idr3_2, can_id);
247 247
248 can_id >>= 16; 248 can_id >>= 16;
249 /* EFF_FLAGS are inbetween the IDs :( */ 249 /* EFF_FLAGS are between the IDs :( */
250 can_id = (can_id & 0x7) | ((can_id << 2) & 0xffe0) 250 can_id = (can_id & 0x7) | ((can_id << 2) & 0xffe0)
251 | MSCAN_EFF_FLAGS; 251 | MSCAN_EFF_FLAGS;
252 } else { 252 } else {
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 0a8de01d52f7..a358ea9445a2 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -425,7 +425,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
425 cf->data[3] = ecc & ECC_SEG; 425 cf->data[3] = ecc & ECC_SEG;
426 break; 426 break;
427 } 427 }
428 /* Error occured during transmission? */ 428 /* Error occurred during transmission? */
429 if ((ecc & ECC_DIR) == 0) 429 if ((ecc & ECC_DIR) == 0)
430 cf->data[2] |= CAN_ERR_PROT_TX; 430 cf->data[2] |= CAN_ERR_PROT_TX;
431 } 431 }
diff --git a/drivers/net/can/softing/softing.h b/drivers/net/can/softing/softing.h
index 7ec9f4db3d52..afd7d85b6915 100644
--- a/drivers/net/can/softing/softing.h
+++ b/drivers/net/can/softing/softing.h
@@ -22,7 +22,7 @@ struct softing_priv {
22 struct softing *card; 22 struct softing *card;
23 struct { 23 struct {
24 int pending; 24 int pending;
25 /* variables wich hold the circular buffer */ 25 /* variables which hold the circular buffer */
26 int echo_put; 26 int echo_put;
27 int echo_get; 27 int echo_get;
28 } tx; 28 } tx;
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 8d7595344a62..60a49e5a2a53 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -218,7 +218,7 @@ static int softing_handle_1(struct softing *card)
218 ptr = buf; 218 ptr = buf;
219 cmd = *ptr++; 219 cmd = *ptr++;
220 if (cmd == 0xff) 220 if (cmd == 0xff)
221 /* not quite usefull, probably the card has got out */ 221 /* not quite useful, probably the card has got out */
222 return 0; 222 return 0;
223 netdev = card->net[0]; 223 netdev = card->net[0];
224 if (cmd & CMD_BUS2) 224 if (cmd & CMD_BUS2)
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 4d07f1ee7168..f7bbde9eb2cb 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -663,7 +663,7 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
663 struct can_frame *cf; 663 struct can_frame *cf;
664 struct sk_buff *skb; 664 struct sk_buff *skb;
665 665
666 /* propogate the error condition to the can stack */ 666 /* propagate the error condition to the can stack */
667 skb = alloc_can_err_skb(ndev, &cf); 667 skb = alloc_can_err_skb(ndev, &cf);
668 if (!skb) { 668 if (!skb) {
669 if (printk_ratelimit()) 669 if (printk_ratelimit())
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index e75f1a876972..a72c7bfb4090 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -386,7 +386,7 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
386 break; 386 break;
387 } 387 }
388 388
389 /* Error occured during transmission? */ 389 /* Error occurred during transmission? */
390 if ((ecc & SJA1000_ECC_DIR) == 0) 390 if ((ecc & SJA1000_ECC_DIR) == 0)
391 cf->data[2] |= CAN_ERR_PROT_TX; 391 cf->data[2] |= CAN_ERR_PROT_TX;
392 392
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index dc53c831ea95..eb8b0e600282 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -284,7 +284,7 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
284 break; 284 break;
285 } 285 }
286 286
287 /* Error occured during transmission? */ 287 /* Error occurred during transmission? */
288 if (!(ecc & SJA1000_ECC_DIR)) 288 if (!(ecc & SJA1000_ECC_DIR))
289 cf->data[2] |= CAN_ERR_PROT_TX; 289 cf->data[2] |= CAN_ERR_PROT_TX;
290 290