Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
authorDavid S. Miller <davem@davemloft.net>
Sat, 22 Sep 2012 19:38:25 +0000 (15:38 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 22 Sep 2012 19:38:25 +0000 (15:38 -0400)
Jeff Kirsher says:

====================
This series contains updates to igb only.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/devicetree/bindings/net/can/c_can.txt [new file with mode: 0644]
drivers/net/can/c_can/c_can.c
drivers/net/can/c_can/c_can.h
drivers/net/can/c_can/c_can_pci.c
drivers/net/can/c_can/c_can_platform.c
drivers/net/can/mscan/mpc5xxx_can.c
drivers/net/can/sja1000/sja1000.c
drivers/net/can/usb/peak_usb/pcan_usb_core.c
drivers/net/can/usb/peak_usb/pcan_usb_core.h
drivers/net/can/usb/peak_usb/pcan_usb_pro.c

diff --git a/Documentation/devicetree/bindings/net/can/c_can.txt b/Documentation/devicetree/bindings/net/can/c_can.txt
new file mode 100644 (file)
index 0000000..8f1ae81
--- /dev/null
@@ -0,0 +1,49 @@
+Bosch C_CAN/D_CAN controller Device Tree Bindings
+-------------------------------------------------
+
+Required properties:
+- compatible           : Should be "bosch,c_can" for C_CAN controllers and
+                         "bosch,d_can" for D_CAN controllers.
+- reg                  : physical base address and size of the C_CAN/D_CAN
+                         registers map
+- interrupts           : property with a value describing the interrupt
+                         number
+
+Optional properties:
+- ti,hwmods            : Must be "d_can<n>" or "c_can<n>", n being the
+                         instance number
+
+Note: "ti,hwmods" field is used to fetch the base address and irq
+resources from TI, omap hwmod data base during device registration.
+Future plan is to migrate hwmod data base contents into device tree
+blob so that, all the required data will be used from device tree dts
+file.
+
+Example:
+
+Step1: SoC common .dtsi file
+
+       dcan1: d_can@481d0000 {
+               compatible = "bosch,d_can";
+               reg = <0x481d0000 0x2000>;
+               interrupts = <55>;
+               interrupt-parent = <&intc>;
+               status = "disabled";
+       };
+
+(or)
+
+       dcan1: d_can@481d0000 {
+               compatible = "bosch,d_can";
+               ti,hwmods = "d_can1";
+               reg = <0x481d0000 0x2000>;
+               interrupts = <55>;
+               interrupt-parent = <&intc>;
+               status = "disabled";
+       };
+
+Step 2: board specific .dts file
+
+       &dcan1 {
+               status = "okay";
+       };
index 4c538e3886553f678729ebe2aa42affd021cc755..2c4a21f9844211f72675e44bbf04b833b513a458 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/if_ether.h>
 #include <linux/list.h>
 #include <linux/io.h>
+#include <linux/pm_runtime.h>
 
 #include <linux/can.h>
 #include <linux/can/dev.h>
@@ -45,6 +46,9 @@
 #define IF_ENUM_REG_LEN                11
 #define C_CAN_IFACE(reg, iface)        (C_CAN_IF1_##reg + (iface) * IF_ENUM_REG_LEN)
 
+/* control extension register D_CAN specific */
+#define CONTROL_EX_PDR         BIT(8)
+
 /* control register */
 #define CONTROL_TEST           BIT(7)
 #define CONTROL_CCE            BIT(6)
@@ -64,6 +68,7 @@
 #define TEST_BASIC             BIT(2)
 
 /* status register */
+#define STATUS_PDA             BIT(10)
 #define STATUS_BOFF            BIT(7)
 #define STATUS_EWARN           BIT(6)
 #define STATUS_EPASS           BIT(5)
 /* minimum timeout for checking BUSY status */
 #define MIN_TIMEOUT_VALUE      6
 
+/* Wait for ~1 sec for INIT bit */
+#define INIT_WAIT_MS           1000
+
 /* napi related */
 #define C_CAN_NAPI_WEIGHT      C_CAN_MSG_OBJ_RX_NUM
 
@@ -201,6 +209,30 @@ static const struct can_bittiming_const c_can_bittiming_const = {
        .brp_inc = 1,
 };
 
+static inline void c_can_pm_runtime_enable(const struct c_can_priv *priv)
+{
+       if (priv->device)
+               pm_runtime_enable(priv->device);
+}
+
+static inline void c_can_pm_runtime_disable(const struct c_can_priv *priv)
+{
+       if (priv->device)
+               pm_runtime_disable(priv->device);
+}
+
+static inline void c_can_pm_runtime_get_sync(const struct c_can_priv *priv)
+{
+       if (priv->device)
+               pm_runtime_get_sync(priv->device);
+}
+
+static inline void c_can_pm_runtime_put_sync(const struct c_can_priv *priv)
+{
+       if (priv->device)
+               pm_runtime_put_sync(priv->device);
+}
+
 static inline int get_tx_next_msg_obj(const struct c_can_priv *priv)
 {
        return (priv->tx_next & C_CAN_NEXT_MSG_OBJ_MASK) +
@@ -673,11 +705,15 @@ static int c_can_get_berr_counter(const struct net_device *dev,
        unsigned int reg_err_counter;
        struct c_can_priv *priv = netdev_priv(dev);
 
+       c_can_pm_runtime_get_sync(priv);
+
        reg_err_counter = priv->read_reg(priv, C_CAN_ERR_CNT_REG);
        bec->rxerr = (reg_err_counter & ERR_CNT_REC_MASK) >>
                                ERR_CNT_REC_SHIFT;
        bec->txerr = reg_err_counter & ERR_CNT_TEC_MASK;
 
+       c_can_pm_runtime_put_sync(priv);
+
        return 0;
 }
 
@@ -1053,11 +1089,13 @@ static int c_can_open(struct net_device *dev)
        int err;
        struct c_can_priv *priv = netdev_priv(dev);
 
+       c_can_pm_runtime_get_sync(priv);
+
        /* open the can device */
        err = open_candev(dev);
        if (err) {
                netdev_err(dev, "failed to open can device\n");
-               return err;
+               goto exit_open_fail;
        }
 
        /* register interrupt handler */
@@ -1079,6 +1117,8 @@ static int c_can_open(struct net_device *dev)
 
 exit_irq_fail:
        close_candev(dev);
+exit_open_fail:
+       c_can_pm_runtime_put_sync(priv);
        return err;
 }
 
@@ -1091,6 +1131,7 @@ static int c_can_close(struct net_device *dev)
        c_can_stop(dev);
        free_irq(dev->irq, dev);
        close_candev(dev);
+       c_can_pm_runtime_put_sync(priv);
 
        return 0;
 }
@@ -1119,6 +1160,77 @@ struct net_device *alloc_c_can_dev(void)
 }
 EXPORT_SYMBOL_GPL(alloc_c_can_dev);
 
+#ifdef CONFIG_PM
+int c_can_power_down(struct net_device *dev)
+{
+       u32 val;
+       unsigned long time_out;
+       struct c_can_priv *priv = netdev_priv(dev);
+
+       if (!(dev->flags & IFF_UP))
+               return 0;
+
+       WARN_ON(priv->type != BOSCH_D_CAN);
+
+       /* set PDR value so the device goes to power down mode */
+       val = priv->read_reg(priv, C_CAN_CTRL_EX_REG);
+       val |= CONTROL_EX_PDR;
+       priv->write_reg(priv, C_CAN_CTRL_EX_REG, val);
+
+       /* Wait for the PDA bit to get set */
+       time_out = jiffies + msecs_to_jiffies(INIT_WAIT_MS);
+       while (!(priv->read_reg(priv, C_CAN_STS_REG) & STATUS_PDA) &&
+                               time_after(time_out, jiffies))
+               cpu_relax();
+
+       if (time_after(jiffies, time_out))
+               return -ETIMEDOUT;
+
+       c_can_stop(dev);
+
+       c_can_pm_runtime_put_sync(priv);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(c_can_power_down);
+
+int c_can_power_up(struct net_device *dev)
+{
+       u32 val;
+       unsigned long time_out;
+       struct c_can_priv *priv = netdev_priv(dev);
+
+       if (!(dev->flags & IFF_UP))
+               return 0;
+
+       WARN_ON(priv->type != BOSCH_D_CAN);
+
+       c_can_pm_runtime_get_sync(priv);
+
+       /* Clear PDR and INIT bits */
+       val = priv->read_reg(priv, C_CAN_CTRL_EX_REG);
+       val &= ~CONTROL_EX_PDR;
+       priv->write_reg(priv, C_CAN_CTRL_EX_REG, val);
+       val = priv->read_reg(priv, C_CAN_CTRL_REG);
+       val &= ~CONTROL_INIT;
+       priv->write_reg(priv, C_CAN_CTRL_REG, val);
+
+       /* Wait for the PDA bit to get clear */
+       time_out = jiffies + msecs_to_jiffies(INIT_WAIT_MS);
+       while ((priv->read_reg(priv, C_CAN_STS_REG) & STATUS_PDA) &&
+                               time_after(time_out, jiffies))
+               cpu_relax();
+
+       if (time_after(jiffies, time_out))
+               return -ETIMEDOUT;
+
+       c_can_start(dev);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(c_can_power_up);
+#endif
+
 void free_c_can_dev(struct net_device *dev)
 {
        free_candev(dev);
@@ -1133,10 +1245,19 @@ static const struct net_device_ops c_can_netdev_ops = {
 
 int register_c_can_dev(struct net_device *dev)
 {
+       struct c_can_priv *priv = netdev_priv(dev);
+       int err;
+
+       c_can_pm_runtime_enable(priv);
+
        dev->flags |= IFF_ECHO; /* we support local echo */
        dev->netdev_ops = &c_can_netdev_ops;
 
-       return register_candev(dev);
+       err = register_candev(dev);
+       if (err)
+               c_can_pm_runtime_disable(priv);
+
+       return err;
 }
 EXPORT_SYMBOL_GPL(register_c_can_dev);
 
@@ -1148,6 +1269,8 @@ void unregister_c_can_dev(struct net_device *dev)
        c_can_enable_all_interrupts(priv, DISABLE_ALL_INTERRUPTS);
 
        unregister_candev(dev);
+
+       c_can_pm_runtime_disable(priv);
 }
 EXPORT_SYMBOL_GPL(unregister_c_can_dev);
 
index 01a7049ab990eacd173c76edecede0b912e14382..e5ed41dafa1b94aa234749064813c587aa79c468 100644 (file)
@@ -24,6 +24,7 @@
 
 enum reg {
        C_CAN_CTRL_REG = 0,
+       C_CAN_CTRL_EX_REG,
        C_CAN_STS_REG,
        C_CAN_ERR_CNT_REG,
        C_CAN_BTR_REG,
@@ -104,6 +105,7 @@ static const u16 reg_map_c_can[] = {
 
 static const u16 reg_map_d_can[] = {
        [C_CAN_CTRL_REG]        = 0x00,
+       [C_CAN_CTRL_EX_REG]     = 0x02,
        [C_CAN_STS_REG]         = 0x04,
        [C_CAN_ERR_CNT_REG]     = 0x08,
        [C_CAN_BTR_REG]         = 0x0C,
@@ -143,8 +145,9 @@ static const u16 reg_map_d_can[] = {
 };
 
 enum c_can_dev_id {
-       C_CAN_DEVTYPE,
-       D_CAN_DEVTYPE,
+       BOSCH_C_CAN_PLATFORM,
+       BOSCH_C_CAN,
+       BOSCH_D_CAN,
 };
 
 /* c_can private data structure */
@@ -152,6 +155,7 @@ struct c_can_priv {
        struct can_priv can;    /* must be the first member */
        struct napi_struct napi;
        struct net_device *dev;
+       struct device *device;
        int tx_object;
        int current_status;
        int last_status;
@@ -164,6 +168,7 @@ struct c_can_priv {
        unsigned int tx_echo;
        void *priv;             /* for board-specific data */
        u16 irqstatus;
+       enum c_can_dev_id type;
 };
 
 struct net_device *alloc_c_can_dev(void);
@@ -171,4 +176,9 @@ void free_c_can_dev(struct net_device *dev);
 int register_c_can_dev(struct net_device *dev);
 void unregister_c_can_dev(struct net_device *dev);
 
+#ifdef CONFIG_PM
+int c_can_power_up(struct net_device *dev);
+int c_can_power_down(struct net_device *dev);
+#endif
+
 #endif /* C_CAN_H */
index 1011146ea51319accbdcf6658d9c22de723e3be7..3d7830bcd2bf83fa55346754f74c2205eae4b3f7 100644 (file)
@@ -120,10 +120,10 @@ static int __devinit c_can_pci_probe(struct pci_dev *pdev,
 
        /* Configure CAN type */
        switch (c_can_pci_data->type) {
-       case C_CAN_DEVTYPE:
+       case BOSCH_C_CAN:
                priv->regs = reg_map_c_can;
                break;
-       case D_CAN_DEVTYPE:
+       case BOSCH_D_CAN:
                priv->regs = reg_map_d_can;
                priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
                break;
@@ -192,7 +192,7 @@ static void __devexit c_can_pci_remove(struct pci_dev *pdev)
 }
 
 static struct c_can_pci_data c_can_sta2x11= {
-       .type = C_CAN_DEVTYPE,
+       .type = BOSCH_C_CAN,
        .reg_align = C_CAN_REG_ALIGN_32,
        .freq = 52000000, /* 52 Mhz */
 };
index 6ff7ad006c300b5a9c499e6bf3465e4cb8b7f2bc..ee1416132aba2e1f9582b7911f67e94eb21b3084 100644 (file)
@@ -30,6 +30,9 @@
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <linux/can/dev.h>
 
@@ -65,17 +68,58 @@ static void c_can_plat_write_reg_aligned_to_32bit(struct c_can_priv *priv,
        writew(val, priv->base + 2 * priv->regs[index]);
 }
 
+static struct platform_device_id c_can_id_table[] = {
+       [BOSCH_C_CAN_PLATFORM] = {
+               .name = KBUILD_MODNAME,
+               .driver_data = BOSCH_C_CAN,
+       },
+       [BOSCH_C_CAN] = {
+               .name = "c_can",
+               .driver_data = BOSCH_C_CAN,
+       },
+       [BOSCH_D_CAN] = {
+               .name = "d_can",
+               .driver_data = BOSCH_D_CAN,
+       }, {
+       }
+};
+
+static const struct of_device_id c_can_of_table[] = {
+       { .compatible = "bosch,c_can", .data = &c_can_id_table[BOSCH_C_CAN] },
+       { .compatible = "bosch,d_can", .data = &c_can_id_table[BOSCH_D_CAN] },
+       { /* sentinel */ },
+};
+
 static int __devinit c_can_plat_probe(struct platform_device *pdev)
 {
        int ret;
        void __iomem *addr;
        struct net_device *dev;
        struct c_can_priv *priv;
+       const struct of_device_id *match;
        const struct platform_device_id *id;
+       struct pinctrl *pinctrl;
        struct resource *mem;
        int irq;
        struct clk *clk;
 
+       if (pdev->dev.of_node) {
+               match = of_match_device(c_can_of_table, &pdev->dev);
+               if (!match) {
+                       dev_err(&pdev->dev, "Failed to find matching dt id\n");
+                       ret = -EINVAL;
+                       goto exit;
+               }
+               id = match->data;
+       } else {
+               id = platform_get_device_id(pdev);
+       }
+
+       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+       if (IS_ERR(pinctrl))
+               dev_warn(&pdev->dev,
+                       "failed to configure pins from driver\n");
+
        /* get the appropriate clk */
        clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(clk)) {
@@ -114,9 +158,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
        }
 
        priv = netdev_priv(dev);
-       id = platform_get_device_id(pdev);
        switch (id->driver_data) {
-       case C_CAN_DEVTYPE:
+       case BOSCH_C_CAN:
                priv->regs = reg_map_c_can;
                switch (mem->flags & IORESOURCE_MEM_TYPE_MASK) {
                case IORESOURCE_MEM_32BIT:
@@ -130,7 +173,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
                        break;
                }
                break;
-       case D_CAN_DEVTYPE:
+       case BOSCH_D_CAN:
                priv->regs = reg_map_d_can;
                priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
                priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
@@ -143,8 +186,10 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
 
        dev->irq = irq;
        priv->base = addr;
+       priv->device = &pdev->dev;
        priv->can.clock.freq = clk_get_rate(clk);
        priv->priv = clk;
+       priv->type = id->driver_data;
 
        platform_set_drvdata(pdev, dev);
        SET_NETDEV_DEV(dev, &pdev->dev);
@@ -195,27 +240,75 @@ static int __devexit c_can_plat_remove(struct platform_device *pdev)
        return 0;
 }
 
-static const struct platform_device_id c_can_id_table[] = {
-       {
-               .name = KBUILD_MODNAME,
-               .driver_data = C_CAN_DEVTYPE,
-       }, {
-               .name = "c_can",
-               .driver_data = C_CAN_DEVTYPE,
-       }, {
-               .name = "d_can",
-               .driver_data = D_CAN_DEVTYPE,
-       }, {
+#ifdef CONFIG_PM
+static int c_can_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       int ret;
+       struct net_device *ndev = platform_get_drvdata(pdev);
+       struct c_can_priv *priv = netdev_priv(ndev);
+
+       if (priv->type != BOSCH_D_CAN) {
+               dev_warn(&pdev->dev, "Not supported\n");
+               return 0;
        }
-};
+
+       if (netif_running(ndev)) {
+               netif_stop_queue(ndev);
+               netif_device_detach(ndev);
+       }
+
+       ret = c_can_power_down(ndev);
+       if (ret) {
+               netdev_err(ndev, "failed to enter power down mode\n");
+               return ret;
+       }
+
+       priv->can.state = CAN_STATE_SLEEPING;
+
+       return 0;
+}
+
+static int c_can_resume(struct platform_device *pdev)
+{
+       int ret;
+       struct net_device *ndev = platform_get_drvdata(pdev);
+       struct c_can_priv *priv = netdev_priv(ndev);
+
+       if (priv->type != BOSCH_D_CAN) {
+               dev_warn(&pdev->dev, "Not supported\n");
+               return 0;
+       }
+
+       ret = c_can_power_up(ndev);
+       if (ret) {
+               netdev_err(ndev, "Still in power down mode\n");
+               return ret;
+       }
+
+       priv->can.state = CAN_STATE_ERROR_ACTIVE;
+
+       if (netif_running(ndev)) {
+               netif_device_attach(ndev);
+               netif_start_queue(ndev);
+       }
+
+       return 0;
+}
+#else
+#define c_can_suspend NULL
+#define c_can_resume NULL
+#endif
 
 static struct platform_driver c_can_plat_driver = {
        .driver = {
                .name = KBUILD_MODNAME,
                .owner = THIS_MODULE,
+               .of_match_table = of_match_ptr(c_can_of_table),
        },
        .probe = c_can_plat_probe,
        .remove = __devexit_p(c_can_plat_remove),
+       .suspend = c_can_suspend,
+       .resume = c_can_resume,
        .id_table = c_can_id_table,
 };
 
index 06adf881ea24b39fef1401b40db6b5a5a88410d3..524ef96dc24d8682ad90cbb6d98935ed6ebc6607 100644 (file)
@@ -181,7 +181,7 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
 
                if (!clock_name || !strcmp(clock_name, "sys")) {
                        sys_clk = clk_get(&ofdev->dev, "sys_clk");
-                       if (!sys_clk) {
+                       if (IS_ERR(sys_clk)) {
                                dev_err(&ofdev->dev, "couldn't get sys_clk\n");
                                goto exit_unmap;
                        }
@@ -204,7 +204,7 @@ static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
 
                if (clocksrc < 0) {
                        ref_clk = clk_get(&ofdev->dev, "ref_clk");
-                       if (!ref_clk) {
+                       if (IS_ERR(ref_clk)) {
                                dev_err(&ofdev->dev, "couldn't get ref_clk\n");
                                goto exit_unmap;
                        }
index 4c4f33d482d2faa44d36bb1cfe669470032eb8b3..25011dbe1b96f15b951ba555477f4ba14be94b0f 100644 (file)
@@ -156,8 +156,13 @@ static void set_normal_mode(struct net_device *dev)
                }
 
                /* set chip to normal mode */
-               priv->write_reg(priv, REG_MOD, 0x00);
+               if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
+                       priv->write_reg(priv, REG_MOD, MOD_LOM);
+               else
+                       priv->write_reg(priv, REG_MOD, 0x00);
+
                udelay(10);
+
                status = priv->read_reg(priv, REG_MOD);
        }
 
@@ -310,7 +315,10 @@ static netdev_tx_t sja1000_start_xmit(struct sk_buff *skb,
 
        can_put_echo_skb(skb, dev, 0);
 
-       sja1000_write_cmdreg(priv, CMD_TR);
+       if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT)
+               sja1000_write_cmdreg(priv, CMD_TR | CMD_AT);
+       else
+               sja1000_write_cmdreg(priv, CMD_TR);
 
        return NETDEV_TX_OK;
 }
@@ -505,10 +513,18 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
                        netdev_warn(dev, "wakeup interrupt\n");
 
                if (isrc & IRQ_TI) {
-                       /* transmission complete interrupt */
-                       stats->tx_bytes += priv->read_reg(priv, REG_FI) & 0xf;
-                       stats->tx_packets++;
-                       can_get_echo_skb(dev, 0);
+                       /* transmission buffer released */
+                       if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT &&
+                           !(status & SR_TCS)) {
+                               stats->tx_errors++;
+                               can_free_echo_skb(dev, 0);
+                       } else {
+                               /* transmission complete */
+                               stats->tx_bytes +=
+                                       priv->read_reg(priv, REG_FI) & 0xf;
+                               stats->tx_packets++;
+                               can_get_echo_skb(dev, 0);
+                       }
                        netif_wake_queue(dev);
                }
                if (isrc & IRQ_RI) {
@@ -605,7 +621,8 @@ struct net_device *alloc_sja1000dev(int sizeof_priv)
        priv->can.do_set_mode = sja1000_set_mode;
        priv->can.do_get_berr_counter = sja1000_get_berr_counter;
        priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
-               CAN_CTRLMODE_BERR_REPORTING;
+               CAN_CTRLMODE_BERR_REPORTING | CAN_CTRLMODE_LISTENONLY |
+               CAN_CTRLMODE_ONE_SHOT;
 
        spin_lock_init(&priv->cmdreg_lock);
 
index d2f91f737871889e59f83b227abed4751f04c171..c4643c400d462bfc63ce7b4df6c76558e4e92e50 100644 (file)
@@ -53,7 +53,7 @@ static struct peak_usb_adapter *peak_usb_adapters_list[] = {
  * dump memory
  */
 #define DUMP_WIDTH     16
-void dump_mem(char *prompt, void *p, int l)
+void pcan_dump_mem(char *prompt, void *p, int l)
 {
        pr_info("%s dumping %s (%d bytes):\n",
                PCAN_USB_DRIVER_NAME, prompt ? prompt : "memory", l);
@@ -203,9 +203,9 @@ static void peak_usb_read_bulk_callback(struct urb *urb)
                if (dev->state & PCAN_USB_STATE_STARTED) {
                        err = dev->adapter->dev_decode_buf(dev, urb);
                        if (err)
-                               dump_mem("received usb message",
-                                       urb->transfer_buffer,
-                                       urb->transfer_buffer_length);
+                               pcan_dump_mem("received usb message",
+                                             urb->transfer_buffer,
+                                             urb->transfer_buffer_length);
                }
        }
 
index 4c775b620be287b9a08eac5ed27a8d390f1930ba..c8e5e91d7cb571f350eef5ff2b0e26cf317d6460 100644 (file)
@@ -131,7 +131,7 @@ struct peak_usb_device {
        struct peak_usb_device *next_siblings;
 };
 
-void dump_mem(char *prompt, void *p, int l);
+void pcan_dump_mem(char *prompt, void *p, int l);
 
 /* common timestamp management */
 void peak_usb_init_time_ref(struct peak_time_ref *time_ref,
index 629c4ba5d49d95792717f75b3a8919543a60b5d0..e1626d92511adc88d084345f7fdbf098a4aafb09 100644 (file)
@@ -292,8 +292,8 @@ static int pcan_usb_pro_wait_rsp(struct peak_usb_device *dev,
                        if (!rec_len) {
                                netdev_err(dev->netdev,
                                           "got unprocessed record in msg\n");
-                               dump_mem("rcvd rsp msg", pum->u.rec_buffer,
-                                        actual_length);
+                               pcan_dump_mem("rcvd rsp msg", pum->u.rec_buffer,
+                                             actual_length);
                                break;
                        }
 
@@ -756,8 +756,8 @@ static int pcan_usb_pro_decode_buf(struct peak_usb_device *dev, struct urb *urb)
 
 fail:
        if (err)
-               dump_mem("received msg",
-                        urb->transfer_buffer, urb->actual_length);
+               pcan_dump_mem("received msg",
+                             urb->transfer_buffer, urb->actual_length);
 
        return err;
 }
This page took 0.038566 seconds and 5 git commands to generate.