summaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-02-23 10:42:13 +0000
committerDavid S. Miller <davem@davemloft.net>2009-02-24 23:50:00 -0800
commitbb58b5b67c08b5fde08090917a040a07ac9d43de (patch)
treef02a05ac7ebd6abff080b54b11de826cceff724f /drivers/net/qlge
parentbb80087a9440178bcd8363dc27a486f34786fec3 (diff)
downloadblackbird-op-linux-bb58b5b67c08b5fde08090917a040a07ac9d43de.tar.gz
blackbird-op-linux-bb58b5b67c08b5fde08090917a040a07ac9d43de.zip
qlge: Clean up mac address and frame route settings.
Setting MAC addresses and routing frames to various queues will need to be done in response to firmware events as well as during initialization. This change encapsulates the facilities into a single call that can later me made from other places. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r--drivers/net/qlge/qlge_main.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index fd515afb1aa5..3a041b6d9fec 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -2958,6 +2958,24 @@ static int ql_route_initialize(struct ql_adapter *qdev)
return status;
}
+static int ql_cam_route_initialize(struct ql_adapter *qdev)
+{
+ int status;
+
+ status = ql_set_mac_addr_reg(qdev, (u8 *) qdev->ndev->perm_addr,
+ MAC_ADDR_TYPE_CAM_MAC, qdev->func * MAX_CQ);
+ if (status) {
+ QPRINTK(qdev, IFUP, ERR, "Failed to init mac address.\n");
+ return status;
+ }
+
+ status = ql_route_initialize(qdev);
+ if (status)
+ QPRINTK(qdev, IFUP, ERR, "Failed to init routing table.\n");
+
+ return status;
+}
+
static int ql_adapter_initialize(struct ql_adapter *qdev)
{
u32 value, mask;
@@ -3028,16 +3046,11 @@ static int ql_adapter_initialize(struct ql_adapter *qdev)
return status;
}
- status = ql_set_mac_addr_reg(qdev, (u8 *) qdev->ndev->perm_addr,
- MAC_ADDR_TYPE_CAM_MAC, qdev->func);
- if (status) {
- QPRINTK(qdev, IFUP, ERR, "Failed to init mac address.\n");
- return status;
- }
-
- status = ql_route_initialize(qdev);
+ /* Set up the MAC address and frame routing filter. */
+ status = ql_cam_route_initialize(qdev);
if (status) {
- QPRINTK(qdev, IFUP, ERR, "Failed to init routing table.\n");
+ QPRINTK(qdev, IFUP, ERR,
+ "Failed to init CAM/Routing tables.\n");
return status;
}
OpenPOWER on IntegriCloud