aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2009-02-23 05:42:13 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-25 02:50:00 -0500
commitbb58b5b67c08b5fde08090917a040a07ac9d43de (patch)
treef02a05ac7ebd6abff080b54b11de826cceff724f /drivers/net/qlge
parentbb80087a9440178bcd8363dc27a486f34786fec3 (diff)
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)
2958 return status; 2958 return status;
2959} 2959}
2960 2960
2961static int ql_cam_route_initialize(struct ql_adapter *qdev)
2962{
2963 int status;
2964
2965 status = ql_set_mac_addr_reg(qdev, (u8 *) qdev->ndev->perm_addr,
2966 MAC_ADDR_TYPE_CAM_MAC, qdev->func * MAX_CQ);
2967 if (status) {
2968 QPRINTK(qdev, IFUP, ERR, "Failed to init mac address.\n");
2969 return status;
2970 }
2971
2972 status = ql_route_initialize(qdev);
2973 if (status)
2974 QPRINTK(qdev, IFUP, ERR, "Failed to init routing table.\n");
2975
2976 return status;
2977}
2978
2961static int ql_adapter_initialize(struct ql_adapter *qdev) 2979static int ql_adapter_initialize(struct ql_adapter *qdev)
2962{ 2980{
2963 u32 value, mask; 2981 u32 value, mask;
@@ -3028,16 +3046,11 @@ static int ql_adapter_initialize(struct ql_adapter *qdev)
3028 return status; 3046 return status;
3029 } 3047 }
3030 3048
3031 status = ql_set_mac_addr_reg(qdev, (u8 *) qdev->ndev->perm_addr, 3049 /* Set up the MAC address and frame routing filter. */
3032 MAC_ADDR_TYPE_CAM_MAC, qdev->func); 3050 status = ql_cam_route_initialize(qdev);
3033 if (status) {
3034 QPRINTK(qdev, IFUP, ERR, "Failed to init mac address.\n");
3035 return status;
3036 }
3037
3038 status = ql_route_initialize(qdev);
3039 if (status) { 3051 if (status) {
3040 QPRINTK(qdev, IFUP, ERR, "Failed to init routing table.\n"); 3052 QPRINTK(qdev, IFUP, ERR,
3053 "Failed to init CAM/Routing tables.\n");
3041 return status; 3054 return status;
3042 } 3055 }
3043 3056