File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
drivers/net/ethernet/wangxun/libwx Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1912,7 +1912,6 @@ static void wx_configure_rx_ring(struct wx *wx,
19121912 struct wx_ring * ring )
19131913{
19141914 u16 reg_idx = ring -> reg_idx ;
1915- union wx_rx_desc * rx_desc ;
19161915 u64 rdba = ring -> dma ;
19171916 u32 rxdctl ;
19181917
@@ -1942,9 +1941,9 @@ static void wx_configure_rx_ring(struct wx *wx,
19421941 memset (ring -> rx_buffer_info , 0 ,
19431942 sizeof (struct wx_rx_buffer ) * ring -> count );
19441943
1945- /* initialize Rx descriptor 0 */
1946- rx_desc = WX_RX_DESC ( ring , 0 ) ;
1947- rx_desc -> wb . upper . length = 0 ;
1944+ /* reset ntu and ntc to place SW in sync with hardware */
1945+ ring -> next_to_clean = 0 ;
1946+ ring -> next_to_use = 0 ;
19481947
19491948 /* enable receive descriptor ring */
19501949 wr32m (wx , WX_PX_RR_CFG (reg_idx ),
Original file line number Diff line number Diff line change @@ -357,6 +357,8 @@ void wx_alloc_rx_buffers(struct wx_ring *rx_ring, u16 cleaned_count)
357357
358358 /* clear the status bits for the next_to_use descriptor */
359359 rx_desc -> wb .upper .status_error = 0 ;
360+ /* clear the length for the next_to_use descriptor */
361+ rx_desc -> wb .upper .length = 0 ;
360362
361363 cleaned_count -- ;
362364 } while (cleaned_count );
@@ -2438,6 +2440,9 @@ static void wx_clean_rx_ring(struct wx_ring *rx_ring)
24382440 }
24392441 }
24402442
2443+ /* Zero out the descriptor ring */
2444+ memset (rx_ring -> desc , 0 , rx_ring -> size );
2445+
24412446 rx_ring -> next_to_alloc = 0 ;
24422447 rx_ring -> next_to_clean = 0 ;
24432448 rx_ring -> next_to_use = 0 ;
You can’t perform that action at this time.
0 commit comments