diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-05-11 11:15:31 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-05-11 11:15:31 -0400 |
commit | 93c6d8927fa692faef3d7d945bd4fe84b0185ad4 (patch) | |
tree | 0a971c86114656ec4e39f7789d9faeb70432c36a /drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | |
parent | ea01d31a07ae182028d2398380948f5a4ee09953 (diff) | |
parent | 50260924afd4b745bfb6e5f1caee381a1875fc31 (diff) |
Merge branch 'clk/mxs' of git://git.linaro.org/people/shawnguo/linux-2.6 into next/clock
Shawn Guo <shawn.guo@linaro.org> writes:
mxs common clk porting for v3.5. It depends on the following two branches.
[1] git://git.linaro.org/people/mturquette/linux.git clk-next
[2] http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm.git clkdev
As the mxs device tree conversion will constantly touch clock files,
to save the conflicts, the updated mxs/dt branch coming later will
based on this pull-request.
* 'clk/mxs' of git://git.linaro.org/people/shawnguo/linux-2.6:
ARM: mxs: remove now unused timer_clk argument from mxs_timer_init
ARM: mxs: remove old clock support
ARM: mxs: switch to common clk framework
ARM: mxs: change the lookup name for fec phy clock
ARM: mxs: request clock for timer
clk: mxs: add clock support for imx28
clk: mxs: add clock support for imx23
clk: mxs: add mxs specific clocks
Includes an update to Linux 3.4-rc6
Conflicts:
drivers/clk/Makefile
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index 63bfdd10bd6d..abb6ce7c1b7e 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | |||
@@ -1150,6 +1150,48 @@ release_tpsram: | |||
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | /** | 1152 | /** |
1153 | * t3_synchronize_rx - wait for current Rx processing on a port to complete | ||
1154 | * @adap: the adapter | ||
1155 | * @p: the port | ||
1156 | * | ||
1157 | * Ensures that current Rx processing on any of the queues associated with | ||
1158 | * the given port completes before returning. We do this by acquiring and | ||
1159 | * releasing the locks of the response queues associated with the port. | ||
1160 | */ | ||
1161 | static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p) | ||
1162 | { | ||
1163 | int i; | ||
1164 | |||
1165 | for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) { | ||
1166 | struct sge_rspq *q = &adap->sge.qs[i].rspq; | ||
1167 | |||
1168 | spin_lock_irq(&q->lock); | ||
1169 | spin_unlock_irq(&q->lock); | ||
1170 | } | ||
1171 | } | ||
1172 | |||
1173 | static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features) | ||
1174 | { | ||
1175 | struct port_info *pi = netdev_priv(dev); | ||
1176 | struct adapter *adapter = pi->adapter; | ||
1177 | |||
1178 | if (adapter->params.rev > 0) { | ||
1179 | t3_set_vlan_accel(adapter, 1 << pi->port_id, | ||
1180 | features & NETIF_F_HW_VLAN_RX); | ||
1181 | } else { | ||
1182 | /* single control for all ports */ | ||
1183 | unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX; | ||
1184 | |||
1185 | for_each_port(adapter, i) | ||
1186 | have_vlans |= | ||
1187 | adapter->port[i]->features & NETIF_F_HW_VLAN_RX; | ||
1188 | |||
1189 | t3_set_vlan_accel(adapter, 1, have_vlans); | ||
1190 | } | ||
1191 | t3_synchronize_rx(adapter, pi); | ||
1192 | } | ||
1193 | |||
1194 | /** | ||
1153 | * cxgb_up - enable the adapter | 1195 | * cxgb_up - enable the adapter |
1154 | * @adapter: adapter being enabled | 1196 | * @adapter: adapter being enabled |
1155 | * | 1197 | * |
@@ -1161,7 +1203,7 @@ release_tpsram: | |||
1161 | */ | 1203 | */ |
1162 | static int cxgb_up(struct adapter *adap) | 1204 | static int cxgb_up(struct adapter *adap) |
1163 | { | 1205 | { |
1164 | int err; | 1206 | int i, err; |
1165 | 1207 | ||
1166 | if (!(adap->flags & FULL_INIT_DONE)) { | 1208 | if (!(adap->flags & FULL_INIT_DONE)) { |
1167 | err = t3_check_fw_version(adap); | 1209 | err = t3_check_fw_version(adap); |
@@ -1198,6 +1240,9 @@ static int cxgb_up(struct adapter *adap) | |||
1198 | if (err) | 1240 | if (err) |
1199 | goto out; | 1241 | goto out; |
1200 | 1242 | ||
1243 | for_each_port(adap, i) | ||
1244 | cxgb_vlan_mode(adap->port[i], adap->port[i]->features); | ||
1245 | |||
1201 | setup_rss(adap); | 1246 | setup_rss(adap); |
1202 | if (!(adap->flags & NAPI_INIT)) | 1247 | if (!(adap->flags & NAPI_INIT)) |
1203 | init_napi(adap); | 1248 | init_napi(adap); |
@@ -2508,48 +2553,6 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p) | |||
2508 | return 0; | 2553 | return 0; |
2509 | } | 2554 | } |
2510 | 2555 | ||
2511 | /** | ||
2512 | * t3_synchronize_rx - wait for current Rx processing on a port to complete | ||
2513 | * @adap: the adapter | ||
2514 | * @p: the port | ||
2515 | * | ||
2516 | * Ensures that current Rx processing on any of the queues associated with | ||
2517 | * the given port completes before returning. We do this by acquiring and | ||
2518 | * releasing the locks of the response queues associated with the port. | ||
2519 | */ | ||
2520 | static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p) | ||
2521 | { | ||
2522 | int i; | ||
2523 | |||
2524 | for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) { | ||
2525 | struct sge_rspq *q = &adap->sge.qs[i].rspq; | ||
2526 | |||
2527 | spin_lock_irq(&q->lock); | ||
2528 | spin_unlock_irq(&q->lock); | ||
2529 | } | ||
2530 | } | ||
2531 | |||
2532 | static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features) | ||
2533 | { | ||
2534 | struct port_info *pi = netdev_priv(dev); | ||
2535 | struct adapter *adapter = pi->adapter; | ||
2536 | |||
2537 | if (adapter->params.rev > 0) { | ||
2538 | t3_set_vlan_accel(adapter, 1 << pi->port_id, | ||
2539 | features & NETIF_F_HW_VLAN_RX); | ||
2540 | } else { | ||
2541 | /* single control for all ports */ | ||
2542 | unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX; | ||
2543 | |||
2544 | for_each_port(adapter, i) | ||
2545 | have_vlans |= | ||
2546 | adapter->port[i]->features & NETIF_F_HW_VLAN_RX; | ||
2547 | |||
2548 | t3_set_vlan_accel(adapter, 1, have_vlans); | ||
2549 | } | ||
2550 | t3_synchronize_rx(adapter, pi); | ||
2551 | } | ||
2552 | |||
2553 | static netdev_features_t cxgb_fix_features(struct net_device *dev, | 2556 | static netdev_features_t cxgb_fix_features(struct net_device *dev, |
2554 | netdev_features_t features) | 2557 | netdev_features_t features) |
2555 | { | 2558 | { |
@@ -3353,9 +3356,6 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
3353 | err = sysfs_create_group(&adapter->port[0]->dev.kobj, | 3356 | err = sysfs_create_group(&adapter->port[0]->dev.kobj, |
3354 | &cxgb3_attr_group); | 3357 | &cxgb3_attr_group); |
3355 | 3358 | ||
3356 | for_each_port(adapter, i) | ||
3357 | cxgb_vlan_mode(adapter->port[i], adapter->port[i]->features); | ||
3358 | |||
3359 | print_port_info(adapter, ai); | 3359 | print_port_info(adapter, ai); |
3360 | return 0; | 3360 | return 0; |
3361 | 3361 | ||