aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2009-12-01 07:15:53 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-02 03:52:30 -0500
commitd4d7f1f9116089a4ae5102dcda35e8120308a515 (patch)
tree7c528e319d653a32ca84564f472f5a6843c14ab9 /drivers
parent0dffc83e5b831df1df83dfe32a0c267347f9950b (diff)
net/ps3: Cleanup gelic enums
Cleanup of the gelic driver enumerations: o Add some missing commas. o Add an Ether port post fix (PS3 currently only supports PORT_0). o Add a new enum gelic_lv1_phy to use when interacting with the PHY. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ps3_gelic_net.c26
-rw-r--r--drivers/net/ps3_gelic_net.h19
2 files changed, 25 insertions, 20 deletions
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index b211613e9dbd..06a29768a864 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -95,11 +95,11 @@ static void gelic_card_get_ether_port_status(struct gelic_card *card,
95 95
96 lv1_net_control(bus_id(card), dev_id(card), 96 lv1_net_control(bus_id(card), dev_id(card),
97 GELIC_LV1_GET_ETH_PORT_STATUS, 97 GELIC_LV1_GET_ETH_PORT_STATUS,
98 GELIC_LV1_VLAN_TX_ETHERNET, 0, 0, 98 GELIC_LV1_VLAN_TX_ETHERNET_0, 0, 0,
99 &card->ether_port_status, &v2); 99 &card->ether_port_status, &v2);
100 100
101 if (inform) { 101 if (inform) {
102 ether_netdev = card->netdev[GELIC_PORT_ETHERNET]; 102 ether_netdev = card->netdev[GELIC_PORT_ETHERNET_0];
103 if (card->ether_port_status & GELIC_LV1_ETHER_LINK_UP) 103 if (card->ether_port_status & GELIC_LV1_ETHER_LINK_UP)
104 netif_carrier_on(ether_netdev); 104 netif_carrier_on(ether_netdev);
105 else 105 else
@@ -451,14 +451,14 @@ static void gelic_descr_release_tx(struct gelic_card *card,
451 451
452static void gelic_card_stop_queues(struct gelic_card *card) 452static void gelic_card_stop_queues(struct gelic_card *card)
453{ 453{
454 netif_stop_queue(card->netdev[GELIC_PORT_ETHERNET]); 454 netif_stop_queue(card->netdev[GELIC_PORT_ETHERNET_0]);
455 455
456 if (card->netdev[GELIC_PORT_WIRELESS]) 456 if (card->netdev[GELIC_PORT_WIRELESS])
457 netif_stop_queue(card->netdev[GELIC_PORT_WIRELESS]); 457 netif_stop_queue(card->netdev[GELIC_PORT_WIRELESS]);
458} 458}
459static void gelic_card_wake_queues(struct gelic_card *card) 459static void gelic_card_wake_queues(struct gelic_card *card)
460{ 460{
461 netif_wake_queue(card->netdev[GELIC_PORT_ETHERNET]); 461 netif_wake_queue(card->netdev[GELIC_PORT_ETHERNET_0]);
462 462
463 if (card->netdev[GELIC_PORT_WIRELESS]) 463 if (card->netdev[GELIC_PORT_WIRELESS])
464 netif_wake_queue(card->netdev[GELIC_PORT_WIRELESS]); 464 netif_wake_queue(card->netdev[GELIC_PORT_WIRELESS]);
@@ -999,7 +999,7 @@ static int gelic_card_decode_one_descr(struct gelic_card *card)
999 goto refill; 999 goto refill;
1000 } 1000 }
1001 } else 1001 } else
1002 netdev = card->netdev[GELIC_PORT_ETHERNET]; 1002 netdev = card->netdev[GELIC_PORT_ETHERNET_0];
1003 1003
1004 if ((status == GELIC_DESCR_DMA_RESPONSE_ERROR) || 1004 if ((status == GELIC_DESCR_DMA_RESPONSE_ERROR) ||
1005 (status == GELIC_DESCR_DMA_PROTECTION_ERROR) || 1005 (status == GELIC_DESCR_DMA_PROTECTION_ERROR) ||
@@ -1369,7 +1369,7 @@ static void gelic_net_tx_timeout_task(struct work_struct *work)
1369{ 1369{
1370 struct gelic_card *card = 1370 struct gelic_card *card =
1371 container_of(work, struct gelic_card, tx_timeout_task); 1371 container_of(work, struct gelic_card, tx_timeout_task);
1372 struct net_device *netdev = card->netdev[GELIC_PORT_ETHERNET]; 1372 struct net_device *netdev = card->netdev[GELIC_PORT_ETHERNET_0];
1373 1373
1374 dev_info(ctodev(card), "%s:Timed out. Restarting... \n", __func__); 1374 dev_info(ctodev(card), "%s:Timed out. Restarting... \n", __func__);
1375 1375
@@ -1531,10 +1531,10 @@ static struct gelic_card * __devinit gelic_alloc_card_net(struct net_device **ne
1531 /* gelic_port */ 1531 /* gelic_port */
1532 port->netdev = *netdev; 1532 port->netdev = *netdev;
1533 port->card = card; 1533 port->card = card;
1534 port->type = GELIC_PORT_ETHERNET; 1534 port->type = GELIC_PORT_ETHERNET_0;
1535 1535
1536 /* gelic_card */ 1536 /* gelic_card */
1537 card->netdev[GELIC_PORT_ETHERNET] = *netdev; 1537 card->netdev[GELIC_PORT_ETHERNET_0] = *netdev;
1538 1538
1539 INIT_WORK(&card->tx_timeout_task, gelic_net_tx_timeout_task); 1539 INIT_WORK(&card->tx_timeout_task, gelic_net_tx_timeout_task);
1540 init_waitqueue_head(&card->waitq); 1540 init_waitqueue_head(&card->waitq);
@@ -1554,9 +1554,9 @@ static void __devinit gelic_card_get_vlan_info(struct gelic_card *card)
1554 int tx; 1554 int tx;
1555 int rx; 1555 int rx;
1556 } vlan_id_ix[2] = { 1556 } vlan_id_ix[2] = {
1557 [GELIC_PORT_ETHERNET] = { 1557 [GELIC_PORT_ETHERNET_0] = {
1558 .tx = GELIC_LV1_VLAN_TX_ETHERNET, 1558 .tx = GELIC_LV1_VLAN_TX_ETHERNET_0,
1559 .rx = GELIC_LV1_VLAN_RX_ETHERNET 1559 .rx = GELIC_LV1_VLAN_RX_ETHERNET_0
1560 }, 1560 },
1561 [GELIC_PORT_WIRELESS] = { 1561 [GELIC_PORT_WIRELESS] = {
1562 .tx = GELIC_LV1_VLAN_TX_WIRELESS, 1562 .tx = GELIC_LV1_VLAN_TX_WIRELESS,
@@ -1601,7 +1601,7 @@ static void __devinit gelic_card_get_vlan_info(struct gelic_card *card)
1601 i, card->vlan[i].tx, card->vlan[i].rx); 1601 i, card->vlan[i].tx, card->vlan[i].rx);
1602 } 1602 }
1603 1603
1604 if (card->vlan[GELIC_PORT_ETHERNET].tx) { 1604 if (card->vlan[GELIC_PORT_ETHERNET_0].tx) {
1605 BUG_ON(!card->vlan[GELIC_PORT_WIRELESS].tx); 1605 BUG_ON(!card->vlan[GELIC_PORT_WIRELESS].tx);
1606 card->vlan_required = 1; 1606 card->vlan_required = 1;
1607 } else 1607 } else
@@ -1790,7 +1790,7 @@ static int ps3_gelic_driver_remove(struct ps3_system_bus_device *dev)
1790 gelic_card_free_chain(card, card->tx_top); 1790 gelic_card_free_chain(card, card->tx_top);
1791 gelic_card_free_chain(card, card->rx_top); 1791 gelic_card_free_chain(card, card->rx_top);
1792 1792
1793 netdev0 = card->netdev[GELIC_PORT_ETHERNET]; 1793 netdev0 = card->netdev[GELIC_PORT_ETHERNET_0];
1794 /* disconnect event port */ 1794 /* disconnect event port */
1795 free_irq(card->irq, card); 1795 free_irq(card->irq, card);
1796 netdev0->irq = NO_IRQ; 1796 netdev0->irq = NO_IRQ;
diff --git a/drivers/net/ps3_gelic_net.h b/drivers/net/ps3_gelic_net.h
index 8b413868bbe2..a09e4862706a 100644
--- a/drivers/net/ps3_gelic_net.h
+++ b/drivers/net/ps3_gelic_net.h
@@ -186,7 +186,7 @@ enum gelic_lv1_net_control_code {
186 GELIC_LV1_GET_CHANNEL = 6, 186 GELIC_LV1_GET_CHANNEL = 6,
187 GELIC_LV1_POST_WLAN_CMD = 9, 187 GELIC_LV1_POST_WLAN_CMD = 9,
188 GELIC_LV1_GET_WLAN_CMD_RESULT = 10, 188 GELIC_LV1_GET_WLAN_CMD_RESULT = 10,
189 GELIC_LV1_GET_WLAN_EVENT = 11 189 GELIC_LV1_GET_WLAN_EVENT = 11,
190}; 190};
191 191
192/* for GELIC_LV1_SET_WOL */ 192/* for GELIC_LV1_SET_WOL */
@@ -217,24 +217,29 @@ enum gelic_lv1_ether_port_status {
217 GELIC_LV1_ETHER_SPEED_10 = 0x0000000000000010L, 217 GELIC_LV1_ETHER_SPEED_10 = 0x0000000000000010L,
218 GELIC_LV1_ETHER_SPEED_100 = 0x0000000000000020L, 218 GELIC_LV1_ETHER_SPEED_100 = 0x0000000000000020L,
219 GELIC_LV1_ETHER_SPEED_1000 = 0x0000000000000040L, 219 GELIC_LV1_ETHER_SPEED_1000 = 0x0000000000000040L,
220 GELIC_LV1_ETHER_SPEED_MASK = 0x0000000000000070L 220 GELIC_LV1_ETHER_SPEED_MASK = 0x0000000000000070L,
221}; 221};
222 222
223enum gelic_lv1_vlan_index { 223enum gelic_lv1_vlan_index {
224 /* for outgoing packets */ 224 /* for outgoing packets */
225 GELIC_LV1_VLAN_TX_ETHERNET = 0x0000000000000002L, 225 GELIC_LV1_VLAN_TX_ETHERNET_0 = 0x0000000000000002L,
226 GELIC_LV1_VLAN_TX_WIRELESS = 0x0000000000000003L, 226 GELIC_LV1_VLAN_TX_WIRELESS = 0x0000000000000003L,
227
227 /* for incoming packets */ 228 /* for incoming packets */
228 GELIC_LV1_VLAN_RX_ETHERNET = 0x0000000000000012L, 229 GELIC_LV1_VLAN_RX_ETHERNET_0 = 0x0000000000000012L,
229 GELIC_LV1_VLAN_RX_WIRELESS = 0x0000000000000013L 230 GELIC_LV1_VLAN_RX_WIRELESS = 0x0000000000000013L,
231};
232
233enum gelic_lv1_phy {
234 GELIC_LV1_PHY_ETHERNET_0 = 0x0000000000000002L,
230}; 235};
231 236
232/* size of hardware part of gelic descriptor */ 237/* size of hardware part of gelic descriptor */
233#define GELIC_DESCR_SIZE (32) 238#define GELIC_DESCR_SIZE (32)
234 239
235enum gelic_port_type { 240enum gelic_port_type {
236 GELIC_PORT_ETHERNET = 0, 241 GELIC_PORT_ETHERNET_0 = 0,
237 GELIC_PORT_WIRELESS = 1, 242 GELIC_PORT_WIRELESS = 1,
238 GELIC_PORT_MAX 243 GELIC_PORT_MAX
239}; 244};
240 245