diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cris/eth_v10.c | 20 | ||||
-rw-r--r-- | drivers/net/irda/kingsun-sir.c | 1 | ||||
-rw-r--r-- | drivers/net/irda/ks959-sir.c | 1 | ||||
-rw-r--r-- | drivers/net/irda/ksdazzle-sir.c | 1 | ||||
-rw-r--r-- | drivers/net/irda/mcs7780.c | 1 | ||||
-rw-r--r-- | drivers/net/irda/pxaficp_ir.c | 47 | ||||
-rw-r--r-- | drivers/net/mlx4/fw.c | 5 |
7 files changed, 63 insertions, 13 deletions
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c index 15c0195ebd31..a24be34a3f7a 100644 --- a/drivers/net/cris/eth_v10.c +++ b/drivers/net/cris/eth_v10.c | |||
@@ -768,10 +768,24 @@ e100_negotiate(struct net_device* dev) | |||
768 | 768 | ||
769 | e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE, data); | 769 | e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_ADVERTISE, data); |
770 | 770 | ||
771 | /* Renegotiate with link partner */ | 771 | data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR); |
772 | if (autoneg_normal) { | 772 | if (autoneg_normal) { |
773 | data = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR); | 773 | /* Renegotiate with link partner */ |
774 | data |= BMCR_ANENABLE | BMCR_ANRESTART; | 774 | data |= BMCR_ANENABLE | BMCR_ANRESTART; |
775 | } else { | ||
776 | /* Don't negotiate speed or duplex */ | ||
777 | data &= ~(BMCR_ANENABLE | BMCR_ANRESTART); | ||
778 | |||
779 | /* Set speed and duplex static */ | ||
780 | if (current_speed_selection == 10) | ||
781 | data &= ~BMCR_SPEED100; | ||
782 | else | ||
783 | data |= BMCR_SPEED100; | ||
784 | |||
785 | if (current_duplex != full) | ||
786 | data &= ~BMCR_FULLDPLX; | ||
787 | else | ||
788 | data |= BMCR_FULLDPLX; | ||
775 | } | 789 | } |
776 | e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR, data); | 790 | e100_set_mdio_reg(dev, np->mii_if.phy_id, MII_BMCR, data); |
777 | } | 791 | } |
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c index 2fc30b449eea..cb90d640007a 100644 --- a/drivers/net/irda/kingsun-sir.c +++ b/drivers/net/irda/kingsun-sir.c | |||
@@ -66,7 +66,6 @@ | |||
66 | #include <linux/errno.h> | 66 | #include <linux/errno.h> |
67 | #include <linux/init.h> | 67 | #include <linux/init.h> |
68 | #include <linux/slab.h> | 68 | #include <linux/slab.h> |
69 | #include <linux/kref.h> | ||
70 | #include <linux/usb.h> | 69 | #include <linux/usb.h> |
71 | #include <linux/device.h> | 70 | #include <linux/device.h> |
72 | #include <linux/crc32.h> | 71 | #include <linux/crc32.h> |
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index f4d13fc51cbc..b54d3b48045e 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c | |||
@@ -118,7 +118,6 @@ | |||
118 | #include <linux/errno.h> | 118 | #include <linux/errno.h> |
119 | #include <linux/init.h> | 119 | #include <linux/init.h> |
120 | #include <linux/slab.h> | 120 | #include <linux/slab.h> |
121 | #include <linux/kref.h> | ||
122 | #include <linux/usb.h> | 121 | #include <linux/usb.h> |
123 | #include <linux/device.h> | 122 | #include <linux/device.h> |
124 | #include <linux/crc32.h> | 123 | #include <linux/crc32.h> |
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c index 5f9d73353972..8d713ebac15b 100644 --- a/drivers/net/irda/ksdazzle-sir.c +++ b/drivers/net/irda/ksdazzle-sir.c | |||
@@ -82,7 +82,6 @@ | |||
82 | #include <linux/errno.h> | 82 | #include <linux/errno.h> |
83 | #include <linux/init.h> | 83 | #include <linux/init.h> |
84 | #include <linux/slab.h> | 84 | #include <linux/slab.h> |
85 | #include <linux/kref.h> | ||
86 | #include <linux/usb.h> | 85 | #include <linux/usb.h> |
87 | #include <linux/device.h> | 86 | #include <linux/device.h> |
88 | #include <linux/crc32.h> | 87 | #include <linux/crc32.h> |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index b3d30bcb88e7..c0e0bb9401d3 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -50,7 +50,6 @@ | |||
50 | #include <linux/errno.h> | 50 | #include <linux/errno.h> |
51 | #include <linux/init.h> | 51 | #include <linux/init.h> |
52 | #include <linux/slab.h> | 52 | #include <linux/slab.h> |
53 | #include <linux/kref.h> | ||
54 | #include <linux/usb.h> | 53 | #include <linux/usb.h> |
55 | #include <linux/device.h> | 54 | #include <linux/device.h> |
56 | #include <linux/crc32.h> | 55 | #include <linux/crc32.h> |
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index 1445e5865196..84db145d2b59 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/etherdevice.h> | 17 | #include <linux/etherdevice.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/gpio.h> | ||
20 | 21 | ||
21 | #include <net/irda/irda.h> | 22 | #include <net/irda/irda.h> |
22 | #include <net/irda/irmod.h> | 23 | #include <net/irda/irmod.h> |
@@ -163,6 +164,22 @@ inline static void pxa_irda_fir_dma_tx_start(struct pxa_irda *si) | |||
163 | } | 164 | } |
164 | 165 | ||
165 | /* | 166 | /* |
167 | * Set the IrDA communications mode. | ||
168 | */ | ||
169 | static void pxa_irda_set_mode(struct pxa_irda *si, int mode) | ||
170 | { | ||
171 | if (si->pdata->transceiver_mode) | ||
172 | si->pdata->transceiver_mode(si->dev, mode); | ||
173 | else { | ||
174 | if (gpio_is_valid(si->pdata->gpio_pwdown)) | ||
175 | gpio_set_value(si->pdata->gpio_pwdown, | ||
176 | !(mode & IR_OFF) ^ | ||
177 | !si->pdata->gpio_pwdown_inverted); | ||
178 | pxa2xx_transceiver_mode(si->dev, mode); | ||
179 | } | ||
180 | } | ||
181 | |||
182 | /* | ||
166 | * Set the IrDA communications speed. | 183 | * Set the IrDA communications speed. |
167 | */ | 184 | */ |
168 | static int pxa_irda_set_speed(struct pxa_irda *si, int speed) | 185 | static int pxa_irda_set_speed(struct pxa_irda *si, int speed) |
@@ -188,7 +205,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed) | |||
188 | pxa_irda_disable_clk(si); | 205 | pxa_irda_disable_clk(si); |
189 | 206 | ||
190 | /* set board transceiver to SIR mode */ | 207 | /* set board transceiver to SIR mode */ |
191 | si->pdata->transceiver_mode(si->dev, IR_SIRMODE); | 208 | pxa_irda_set_mode(si, IR_SIRMODE); |
192 | 209 | ||
193 | /* enable the STUART clock */ | 210 | /* enable the STUART clock */ |
194 | pxa_irda_enable_sirclk(si); | 211 | pxa_irda_enable_sirclk(si); |
@@ -222,7 +239,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed) | |||
222 | ICCR0 = 0; | 239 | ICCR0 = 0; |
223 | 240 | ||
224 | /* set board transceiver to FIR mode */ | 241 | /* set board transceiver to FIR mode */ |
225 | si->pdata->transceiver_mode(si->dev, IR_FIRMODE); | 242 | pxa_irda_set_mode(si, IR_FIRMODE); |
226 | 243 | ||
227 | /* enable the FICP clock */ | 244 | /* enable the FICP clock */ |
228 | pxa_irda_enable_firclk(si); | 245 | pxa_irda_enable_firclk(si); |
@@ -641,7 +658,7 @@ static void pxa_irda_shutdown(struct pxa_irda *si) | |||
641 | local_irq_restore(flags); | 658 | local_irq_restore(flags); |
642 | 659 | ||
643 | /* power off board transceiver */ | 660 | /* power off board transceiver */ |
644 | si->pdata->transceiver_mode(si->dev, IR_OFF); | 661 | pxa_irda_set_mode(si, IR_OFF); |
645 | 662 | ||
646 | printk(KERN_DEBUG "pxa_ir: irda shutdown\n"); | 663 | printk(KERN_DEBUG "pxa_ir: irda shutdown\n"); |
647 | } | 664 | } |
@@ -849,10 +866,26 @@ static int pxa_irda_probe(struct platform_device *pdev) | |||
849 | if (err) | 866 | if (err) |
850 | goto err_mem_5; | 867 | goto err_mem_5; |
851 | 868 | ||
852 | if (si->pdata->startup) | 869 | if (gpio_is_valid(si->pdata->gpio_pwdown)) { |
870 | err = gpio_request(si->pdata->gpio_pwdown, "IrDA switch"); | ||
871 | if (err) | ||
872 | goto err_startup; | ||
873 | err = gpio_direction_output(si->pdata->gpio_pwdown, | ||
874 | !si->pdata->gpio_pwdown_inverted); | ||
875 | if (err) { | ||
876 | gpio_free(si->pdata->gpio_pwdown); | ||
877 | goto err_startup; | ||
878 | } | ||
879 | } | ||
880 | |||
881 | if (si->pdata->startup) { | ||
853 | err = si->pdata->startup(si->dev); | 882 | err = si->pdata->startup(si->dev); |
854 | if (err) | 883 | if (err) |
855 | goto err_startup; | 884 | goto err_startup; |
885 | } | ||
886 | |||
887 | if (gpio_is_valid(si->pdata->gpio_pwdown) && si->pdata->startup) | ||
888 | dev_warn(si->dev, "gpio_pwdown and startup() both defined!\n"); | ||
856 | 889 | ||
857 | dev->netdev_ops = &pxa_irda_netdev_ops; | 890 | dev->netdev_ops = &pxa_irda_netdev_ops; |
858 | 891 | ||
@@ -903,6 +936,8 @@ static int pxa_irda_remove(struct platform_device *_dev) | |||
903 | if (dev) { | 936 | if (dev) { |
904 | struct pxa_irda *si = netdev_priv(dev); | 937 | struct pxa_irda *si = netdev_priv(dev); |
905 | unregister_netdev(dev); | 938 | unregister_netdev(dev); |
939 | if (gpio_is_valid(si->pdata->gpio_pwdown)) | ||
940 | gpio_free(si->pdata->gpio_pwdown); | ||
906 | if (si->pdata->shutdown) | 941 | if (si->pdata->shutdown) |
907 | si->pdata->shutdown(si->dev); | 942 | si->pdata->shutdown(si->dev); |
908 | kfree(si->tx_buff.head); | 943 | kfree(si->tx_buff.head); |
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index cee199ceba2f..3c16602172fc 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c | |||
@@ -33,6 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include <linux/mlx4/cmd.h> | 35 | #include <linux/mlx4/cmd.h> |
36 | #include <linux/cache.h> | ||
36 | 37 | ||
37 | #include "fw.h" | 38 | #include "fw.h" |
38 | #include "icm.h" | 39 | #include "icm.h" |
@@ -698,6 +699,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) | |||
698 | #define INIT_HCA_IN_SIZE 0x200 | 699 | #define INIT_HCA_IN_SIZE 0x200 |
699 | #define INIT_HCA_VERSION_OFFSET 0x000 | 700 | #define INIT_HCA_VERSION_OFFSET 0x000 |
700 | #define INIT_HCA_VERSION 2 | 701 | #define INIT_HCA_VERSION 2 |
702 | #define INIT_HCA_CACHELINE_SZ_OFFSET 0x0e | ||
701 | #define INIT_HCA_FLAGS_OFFSET 0x014 | 703 | #define INIT_HCA_FLAGS_OFFSET 0x014 |
702 | #define INIT_HCA_QPC_OFFSET 0x020 | 704 | #define INIT_HCA_QPC_OFFSET 0x020 |
703 | #define INIT_HCA_QPC_BASE_OFFSET (INIT_HCA_QPC_OFFSET + 0x10) | 705 | #define INIT_HCA_QPC_BASE_OFFSET (INIT_HCA_QPC_OFFSET + 0x10) |
@@ -735,6 +737,9 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) | |||
735 | 737 | ||
736 | *((u8 *) mailbox->buf + INIT_HCA_VERSION_OFFSET) = INIT_HCA_VERSION; | 738 | *((u8 *) mailbox->buf + INIT_HCA_VERSION_OFFSET) = INIT_HCA_VERSION; |
737 | 739 | ||
740 | *((u8 *) mailbox->buf + INIT_HCA_CACHELINE_SZ_OFFSET) = | ||
741 | (ilog2(cache_line_size()) - 4) << 5; | ||
742 | |||
738 | #if defined(__LITTLE_ENDIAN) | 743 | #if defined(__LITTLE_ENDIAN) |
739 | *(inbox + INIT_HCA_FLAGS_OFFSET / 4) &= ~cpu_to_be32(1 << 1); | 744 | *(inbox + INIT_HCA_FLAGS_OFFSET / 4) &= ~cpu_to_be32(1 << 1); |
740 | #elif defined(__BIG_ENDIAN) | 745 | #elif defined(__BIG_ENDIAN) |