diff options
-rw-r--r-- | drivers/net/qlge/qlge_main.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 7f372672ac4e..1da831e99422 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -3040,25 +3040,40 @@ static int ql_start_rss(struct ql_adapter *qdev) | |||
3040 | return status; | 3040 | return status; |
3041 | } | 3041 | } |
3042 | 3042 | ||
3043 | /* Initialize the frame-to-queue routing. */ | 3043 | static int ql_clear_routing_entries(struct ql_adapter *qdev) |
3044 | static int ql_route_initialize(struct ql_adapter *qdev) | ||
3045 | { | 3044 | { |
3046 | int status = 0; | 3045 | int i, status = 0; |
3047 | int i; | ||
3048 | 3046 | ||
3049 | status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); | 3047 | status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); |
3050 | if (status) | 3048 | if (status) |
3051 | return status; | 3049 | return status; |
3052 | |||
3053 | /* Clear all the entries in the routing table. */ | 3050 | /* Clear all the entries in the routing table. */ |
3054 | for (i = 0; i < 16; i++) { | 3051 | for (i = 0; i < 16; i++) { |
3055 | status = ql_set_routing_reg(qdev, i, 0, 0); | 3052 | status = ql_set_routing_reg(qdev, i, 0, 0); |
3056 | if (status) { | 3053 | if (status) { |
3057 | QPRINTK(qdev, IFUP, ERR, | 3054 | QPRINTK(qdev, IFUP, ERR, |
3058 | "Failed to init routing register for CAM packets.\n"); | 3055 | "Failed to init routing register for CAM " |
3059 | goto exit; | 3056 | "packets.\n"); |
3057 | break; | ||
3060 | } | 3058 | } |
3061 | } | 3059 | } |
3060 | ql_sem_unlock(qdev, SEM_RT_IDX_MASK); | ||
3061 | return status; | ||
3062 | } | ||
3063 | |||
3064 | /* Initialize the frame-to-queue routing. */ | ||
3065 | static int ql_route_initialize(struct ql_adapter *qdev) | ||
3066 | { | ||
3067 | int status = 0; | ||
3068 | |||
3069 | status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK); | ||
3070 | if (status) | ||
3071 | return status; | ||
3072 | |||
3073 | /* Clear all the entries in the routing table. */ | ||
3074 | status = ql_clear_routing_entries(qdev); | ||
3075 | if (status) | ||
3076 | goto exit; | ||
3062 | 3077 | ||
3063 | status = ql_set_routing_reg(qdev, RT_IDX_ALL_ERR_SLOT, RT_IDX_ERR, 1); | 3078 | status = ql_set_routing_reg(qdev, RT_IDX_ALL_ERR_SLOT, RT_IDX_ERR, 1); |
3064 | if (status) { | 3079 | if (status) { |
@@ -3211,9 +3226,17 @@ static int ql_adapter_reset(struct ql_adapter *qdev) | |||
3211 | { | 3226 | { |
3212 | u32 value; | 3227 | u32 value; |
3213 | int status = 0; | 3228 | int status = 0; |
3214 | unsigned long end_jiffies = jiffies + | 3229 | unsigned long end_jiffies; |
3215 | max((unsigned long)1, usecs_to_jiffies(30)); | ||
3216 | 3230 | ||
3231 | /* Clear all the entries in the routing table. */ | ||
3232 | status = ql_clear_routing_entries(qdev); | ||
3233 | if (status) { | ||
3234 | QPRINTK(qdev, IFUP, ERR, "Failed to clear routing bits.\n"); | ||
3235 | return status; | ||
3236 | } | ||
3237 | |||
3238 | end_jiffies = jiffies + | ||
3239 | max((unsigned long)1, usecs_to_jiffies(30)); | ||
3217 | ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); | 3240 | ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR); |
3218 | 3241 | ||
3219 | do { | 3242 | do { |