Changeset 14614


Ignore:
Timestamp:
06/16/10 23:51:04 (3 years ago)
Author:
BrainSlayer
Message:

fix reset problems which could cause wds bridge problems

Location:
src/linux/pb42/linux-2.6.23/drivers/net
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/linux/pb42/linux-2.6.23/drivers/net/ag7100/ag7100.c

    r14586 r14614  
    15601560        if (ag7100_rx_owned_by_dma(ds)) 
    15611561        { 
     1562            break; 
     1563#if 0 
    15621564            if(quota == iquota) 
    15631565            { 
     
    15661568            } 
    15671569            break; 
     1570#endif 
    15681571        } 
    15691572        ag7100_intr_ack_rx(mac); 
     
    16721675        quota--; 
    16731676 
     1677#if defined(CONFIG_PHY_LAYER) 
    16741678        if (mac->rx) 
    16751679            mac->rx(skb); 
    16761680        else 
     1681#endif 
    16771682            { 
    16781683            skb->protocol       = eth_type_trans(skb, dev); 
     
    16841689    } 
    16851690 
     1691#if 0 
    16861692    if(quota == iquota) 
    16871693    { 
     
    16891695        return AG7100_RX_DMA_HANG; 
    16901696    } 
    1691  
     1697#endif 
    16921698    r->ring_head   =  head; 
    1693  
     1699#if 0 
    16941700    rep = ag7100_rx_replenish(mac); 
    16951701    if(rep < 0) 
     
    16981704        return AG7100_RX_DMA_HANG; 
    16991705    } 
     1706#endif 
    17001707    /* 
    17011708    * let's see what changed while we were slogging. 
  • src/linux/pb42/linux-2.6.23/drivers/net/ag7240/ag7240.c

    r14501 r14614  
    14121412} 
    14131413 
     1414void ag7240_dma_reset(ag7240_mac_t *mac) 
     1415{ 
     1416    uint32_t mask; 
     1417 
     1418    if(mac->mac_unit) 
     1419        mask = AR7240_RESET_GE1_MAC; 
     1420    else 
     1421        mask = AR7240_RESET_GE0_MAC; 
     1422 
     1423    ar7240_reg_rmw_set(AR7240_RESET, mask); 
     1424    mdelay(100); 
     1425    ar7240_reg_rmw_clear(AR7240_RESET, mask); 
     1426    mdelay(100); 
     1427 
     1428    ag7240_intr_disable_recv(mac); 
     1429    schedule_work(&mac->mac_tx_timeout); 
     1430} 
     1431 
     1432 
    14141433static int 
    14151434#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) 
     
    14441463    dev->quota  -= work_done; 
    14451464    *budget     -= work_done; 
    1446     netif_rx_complete(dev); 
    14471465    if (likely(ret == AG7240_RX_STATUS_DONE)) 
    14481466    { 
    1449         ag7240_intr_enable_recv(mac); 
    1450     } 
    1451 #endif 
     1467        netif_rx_complete(dev); 
     1468    } 
     1469#endif 
     1470    if(ret == AG7240_RX_DMA_HANG) 
     1471    { 
     1472        status = 0; 
     1473        ag7240_dma_reset(mac); 
     1474    } 
    14521475    if (likely(ret == AG7240_RX_STATUS_NOT_DONE)) 
    14531476    { 
     
    14921515    ag7240_trc(status,"status"); 
    14931516 
    1494     /* Dont assert these bits if the DMA check has passed. The DMA 
    1495      * check will clear these bits if a hang condition is detected 
    1496      * on resetting the MAC. 
    1497      */  
    1498 #ifdef CHECK_DMA_STATUS 
    1499     if(mac->dma_check == 0) { 
    1500         assert((status & AG7240_RX_STATUS_PKT_RCVD)); 
    1501         assert((status >> 16)); 
    1502     } 
    1503     else 
    1504         mac->dma_check = 0; 
    1505 #endif 
    15061517    /* 
    15071518    * Flush the DDR FIFOs for our gmac 
     
    15201531        if (ag7240_rx_owned_by_dma(ds)) 
    15211532        { 
    1522             assert(quota != iquota); /* WCL */ 
    1523             break; 
     1533            break; 
     1534/*            if(quota == iquota) 
     1535            { 
     1536                *work_done = quota = 0; 
     1537                return AG7240_RX_DMA_HANG; 
     1538            } 
     1539            break;*/ 
    15241540        } 
    15251541        ag7240_intr_ack_rx(mac); 
     
    16001616    } 
    16011617 
    1602     assert(iquota != quota); 
     1618/*    if(quota == iquota) 
     1619    { 
     1620        *work_done = quota = 0; 
     1621        return AG7240_RX_DMA_HANG; 
     1622    }*/ 
    16031623    r->ring_head   =  head; 
    16041624 
    16051625    rep = ag7240_rx_replenish(mac); 
     1626/*    if(rep < 0) 
     1627    { 
     1628        *work_done =0 ; 
     1629        return AG7240_RX_DMA_HANG; 
     1630    }*/ 
    16061631 
    16071632    /* 
     
    16871712        ag7240_trc(ds,"ds"); 
    16881713 
    1689         assert(!ag7240_rx_owned_by_dma(ds)); 
    1690  
     1714        if(ag7240_rx_owned_by_dma(ds)) 
     1715        { 
     1716            return -1; 
     1717        } 
    16911718        assert(!bf->buf_pkt); 
    16921719 
     
    19882015} 
    19892016 
    1990 #ifdef CHECK_DMA_STATUS 
    19912017static void 
    19922018ag7240_tx_timeout(struct net_device *dev) 
     
    20062032    ag7240_mac_t *mac = container_of(work, ag7240_mac_t, mac_tx_timeout); 
    20072033    ag7240_trc(mac,"mac"); 
    2008     check_for_dma_status(mac); 
    2009 } 
    2010 #endif 
     2034    ag7240_stop(mac->mac_dev); 
     2035    ag7240_open(mac->mac_dev); 
     2036} 
    20112037 
    20122038static void 
     
    21942220        */ 
    21952221 
    2196 #ifdef CHECK_DMA_STATUS 
    21972222        INIT_WORK(&mac->mac_tx_timeout, ag7240_tx_timeout_task); 
    2198 #endif 
    21992223 
    22002224        dev = alloc_etherdev(0); 
     
    22192243        dev->weight          =  AG7240_NAPI_WEIGHT; 
    22202244#endif 
    2221 #ifdef CHECK_DMA_STATUS 
    22222245        dev->tx_timeout      =  ag7240_tx_timeout; 
    2223 #endif 
    22242246        dev->priv            =  mac; 
    22252247 
  • src/linux/pb42/linux-2.6.23/drivers/net/ag7240/ag7240.h

    r14382 r14614  
    146146    spinlock_t              mac_lock; 
    147147    struct timer_list       mac_oom_timer; 
    148 #ifdef CHECK_DMA_STATUS 
    149148    struct work_struct      mac_tx_timeout; 
    150 #endif 
    151149    struct net_device_stats mac_net_stats; 
    152150    ag7240_phy_speed_t      mac_speed; 
     
    178176    AG7240_RX_STATUS_NOT_DONE, 
    179177    AG7240_RX_STATUS_OOM, 
    180 #ifdef CONFIG_AR9100 
    181178    AG7240_RX_DMA_HANG 
    182 #endif 
    183179}ag7240_rx_status_t; 
    184180 
Note: See TracChangeset for help on using the changeset viewer.