Changeset 14614
- Timestamp:
- 06/16/10 23:51:04 (3 years ago)
- Location:
- src/linux/pb42/linux-2.6.23/drivers/net
- Files:
-
- 3 edited
-
ag7100/ag7100.c (modified) (6 diffs)
-
ag7240/ag7240.c (modified) (10 diffs)
-
ag7240/ag7240.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/linux/pb42/linux-2.6.23/drivers/net/ag7100/ag7100.c
r14586 r14614 1560 1560 if (ag7100_rx_owned_by_dma(ds)) 1561 1561 { 1562 break; 1563 #if 0 1562 1564 if(quota == iquota) 1563 1565 { … … 1566 1568 } 1567 1569 break; 1570 #endif 1568 1571 } 1569 1572 ag7100_intr_ack_rx(mac); … … 1672 1675 quota--; 1673 1676 1677 #if defined(CONFIG_PHY_LAYER) 1674 1678 if (mac->rx) 1675 1679 mac->rx(skb); 1676 1680 else 1681 #endif 1677 1682 { 1678 1683 skb->protocol = eth_type_trans(skb, dev); … … 1684 1689 } 1685 1690 1691 #if 0 1686 1692 if(quota == iquota) 1687 1693 { … … 1689 1695 return AG7100_RX_DMA_HANG; 1690 1696 } 1691 1697 #endif 1692 1698 r->ring_head = head; 1693 1699 #if 0 1694 1700 rep = ag7100_rx_replenish(mac); 1695 1701 if(rep < 0) … … 1698 1704 return AG7100_RX_DMA_HANG; 1699 1705 } 1706 #endif 1700 1707 /* 1701 1708 * let's see what changed while we were slogging. -
src/linux/pb42/linux-2.6.23/drivers/net/ag7240/ag7240.c
r14501 r14614 1412 1412 } 1413 1413 1414 void 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 1414 1433 static int 1415 1434 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) … … 1444 1463 dev->quota -= work_done; 1445 1464 *budget -= work_done; 1446 netif_rx_complete(dev);1447 1465 if (likely(ret == AG7240_RX_STATUS_DONE)) 1448 1466 { 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 } 1452 1475 if (likely(ret == AG7240_RX_STATUS_NOT_DONE)) 1453 1476 { … … 1492 1515 ag7240_trc(status,"status"); 1493 1516 1494 /* Dont assert these bits if the DMA check has passed. The DMA1495 * check will clear these bits if a hang condition is detected1496 * on resetting the MAC.1497 */1498 #ifdef CHECK_DMA_STATUS1499 if(mac->dma_check == 0) {1500 assert((status & AG7240_RX_STATUS_PKT_RCVD));1501 assert((status >> 16));1502 }1503 else1504 mac->dma_check = 0;1505 #endif1506 1517 /* 1507 1518 * Flush the DDR FIFOs for our gmac … … 1520 1531 if (ag7240_rx_owned_by_dma(ds)) 1521 1532 { 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;*/ 1524 1540 } 1525 1541 ag7240_intr_ack_rx(mac); … … 1600 1616 } 1601 1617 1602 assert(iquota != quota); 1618 /* if(quota == iquota) 1619 { 1620 *work_done = quota = 0; 1621 return AG7240_RX_DMA_HANG; 1622 }*/ 1603 1623 r->ring_head = head; 1604 1624 1605 1625 rep = ag7240_rx_replenish(mac); 1626 /* if(rep < 0) 1627 { 1628 *work_done =0 ; 1629 return AG7240_RX_DMA_HANG; 1630 }*/ 1606 1631 1607 1632 /* … … 1687 1712 ag7240_trc(ds,"ds"); 1688 1713 1689 assert(!ag7240_rx_owned_by_dma(ds)); 1690 1714 if(ag7240_rx_owned_by_dma(ds)) 1715 { 1716 return -1; 1717 } 1691 1718 assert(!bf->buf_pkt); 1692 1719 … … 1988 2015 } 1989 2016 1990 #ifdef CHECK_DMA_STATUS1991 2017 static void 1992 2018 ag7240_tx_timeout(struct net_device *dev) … … 2006 2032 ag7240_mac_t *mac = container_of(work, ag7240_mac_t, mac_tx_timeout); 2007 2033 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 } 2011 2037 2012 2038 static void … … 2194 2220 */ 2195 2221 2196 #ifdef CHECK_DMA_STATUS2197 2222 INIT_WORK(&mac->mac_tx_timeout, ag7240_tx_timeout_task); 2198 #endif2199 2223 2200 2224 dev = alloc_etherdev(0); … … 2219 2243 dev->weight = AG7240_NAPI_WEIGHT; 2220 2244 #endif 2221 #ifdef CHECK_DMA_STATUS2222 2245 dev->tx_timeout = ag7240_tx_timeout; 2223 #endif2224 2246 dev->priv = mac; 2225 2247 -
src/linux/pb42/linux-2.6.23/drivers/net/ag7240/ag7240.h
r14382 r14614 146 146 spinlock_t mac_lock; 147 147 struct timer_list mac_oom_timer; 148 #ifdef CHECK_DMA_STATUS149 148 struct work_struct mac_tx_timeout; 150 #endif151 149 struct net_device_stats mac_net_stats; 152 150 ag7240_phy_speed_t mac_speed; … … 178 176 AG7240_RX_STATUS_NOT_DONE, 179 177 AG7240_RX_STATUS_OOM, 180 #ifdef CONFIG_AR9100181 178 AG7240_RX_DMA_HANG 182 #endif183 179 }ag7240_rx_status_t; 184 180
Note: See TracChangeset
for help on using the changeset viewer.
