亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? drivers_net_arm_ep93xx_eth_c_diff.htm

?? linux2.6.11.6drivers_net_arm_ep93xx_eth_c
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0086)http://members.inode.at/m.burian/ep93xx/patches/acme/drivers_net_arm_ep93xx_eth.c.diff -->
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3502.5390" name=GENERATOR></HEAD>
<BODY><XMP>--- linux-2.6.12/drivers/net/arm/ep93xx_eth.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.12-ep93xx-gao5-fix-ethernet-hang/drivers/net/arm/ep93xx_eth.c	2005-07-12 08:55:35.000000000 +0200
@@ -0,0 +1,1868 @@
+/*----------------------------------------------------------------------------
+ * ep93xx_eth.c
+ *  Ethernet Device Driver for Cirrus Logic EP93xx.
+ *
+ * Copyright (C) 2003 by Cirrus Logic www.cirrus.com 
+ * This software may be used and distributed according to the terms
+ * of the GNU Public License.
+ *
+ *   This driver was written based on skeleton.c by Donald Becker and
+ * smc9194.c by Erik Stahlman.  
+ *
+ * Theory of Operation
+ * Driver Configuration
+ *  - Getting MAC address from system
+ *     To setup identical MAC address for each target board, driver need
+ *      to get a MAC address from system.  Normally, system has a Serial 
+ *      EEPROM or other media to store individual MAC address when 
+ *      manufacturing.
+ *      The macro GET_MAC_ADDR is prepared to get the MAC address from 
+ *      system and one should supply a routine for this purpose.
+ * Driver Initialization
+ * DMA Operation
+ * Cache Coherence
+ *
+ * History:
+ * 07/19/01 0.1  Sungwook Kim  initial release
+ * 10/16/01 0.2  Sungwook Kim  add workaround for ignorance of Tx request while sending frame
+ *                             add some error stuations handling
+ *
+ * 03/25/03 Melody Lee Modified for EP93xx
+ *--------------------------------------------------------------------------*/
+
+static const char *version = "ep93xx_eth.c: V1.0 09/04/2003 Cirrus Logic\n";
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/fcntl.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/in.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <linux/dma-mapping.h>
+
+#include <asm/system.h>
+#include <asm/bitops.h>
+#include <asm/io.h>
+#include <asm/dma.h>
+#include <asm/irq.h>
+#include <asm/arch/hardware.h>
+
+#include "ep93xx_eth.h"
+
+/*----------------------------------------------------------------------------
+ * The name of the card.
+ * It is used for messages and in the requests for io regions, irqs and ...
+ * This device is not in a card but I used same name in skeleton.c file.
+ *--------------------------------------------------------------------------*/
+#define  cardname  "ep93xx_ethernet"
+
+/*----------------------------------------------------------------------------
+ * Macro to get MAC address from system
+ *
+ * Parameters:
+ *  - pD  : a pointer to the net device information, struct net_device.
+ *          one can get base address of device from pD->base_addr,
+ *          device instance ID (0 for 1st and so on) from netdev_priv(pD).
+ *  - pMac: a pointer to a 6 bytes length buffer to return device MAC address.
+ *          this buffer will be initialized with default_mac[] value before
+ *          calling.
+ * Return: none
+ *--------------------------------------------------------------------------*/
+#ifdef CONFIG_SENSORS_EEPROM
+
+#include <linux/i2c.h>
+
+static unsigned char ep93xx_mac_addr[8];
+static int ep93xx_mac_addr_valid = 0;
+
+int ep93xx_set_mac_addr(struct i2c_client *client)
+{
+	int i;
+
+	ep93xx_mac_addr[0] = i2c_smbus_read_byte_data(client, 0x00);
+
+	for (i=1; i<8; i++) {
+		ep93xx_mac_addr[i] = i2c_smbus_read_byte(client);
+	}
+
+	/* We use the "0x55-xx-xx-xx-xx-xx-xx-0xAA" as the signature. */
+	if (ep93xx_mac_addr[0] == 0x55 && ep93xx_mac_addr[7] == 0xaa) {
+		ep93xx_mac_addr_valid = 1;
+		return 1;
+	}
+	else {
+		return 0;
+	}
+}
+
+#define  GET_MAC_ADDR(pD, pMac) (ep93xx_mac_addr_valid && \
+				 memcpy(pMac, &(ep93xx_mac_addr[1]), 6) )
+#else
+#define  GET_MAC_ADDR(pD, pMac)
+#endif
+
+/****  default MAC address if GET_MAC_ADDR does not override  *************/
+/* static const u8  default_mac[6] = {0x00, 0xba, 0xd0, 0x0b, 0xad, 0x00}; */
+static const u8 default_mac[6] = { 0x78, 0x56, 0x34, 0x12, 0x1C, 0x32 };
+
+/*----------------------------------------------------------------------------
+ * A List of default device port configuration for auto probing.
+ * At this time, the CPU has only one Ethernet device,
+ * but better to support multiple device configuration.
+ * Keep in mind that the array must end in zero.
+ *--------------------------------------------------------------------------*/
+
+/* We get the MAC_BASE from include/asm-arm/arch-ep93xx/regmap.h */
+static struct {
+	unsigned int baseAddr;	/*base address, (0:end mark) */
+	int irq;		/*IRQ number, (0:auto detect) */
+} portList[] __initdata = {
+	{
+	MAC_BASE, 39}, {
+	0 /*end mark */ , 0}
+};
+
+/*----------------------------------------------------------------------------
+ * Some definitions belong to the operation of this driver.
+ * You should understand how it affect to driver before any modification.
+ *--------------------------------------------------------------------------*/
+
+/****  Interrupt Sources in Use  *******************************************/
+/*#define  Default_IntSrc  (IntEn_RxMIE|IntEn_RxSQIE|IntEn_TxLEIE|IntEn_TIE|IntEn_TxSQIE|IntEn_RxEOFIE|IntEn_RxEOBIE|IntEn_RxHDRIE)
+*/
+#define  Default_IntSrc  (IntEn_TxSQIE|IntEn_RxEOFIE|IntEn_RxEOBIE|IntEn_RxHDRIE)
+
+/****  Length of Device Queue in number of entries
+       (must be less than or equal to 255)  ********************************/
+#define  LEN_QueRxDesc  64	/*length of Rx Descriptor Queue (4 or bigger) Must be power of 2. */
+#define  LEN_QueRxSts   LEN_QueRxDesc	/*length of Rx Status Queue */
+#define  LEN_QueTxDesc  8	/*length of Tx Descriptor Queue (4 or bigger) Must be power of 2. */
+#define  LEN_QueTxSts   LEN_QueTxDesc	/*length of Tx Status Queue */
+
+/****  Tx Queue fill-up level control  *************************************/
+#define  LVL_TxStop    LEN_QueTxDesc - 2	/*level to ask the stack to stop Tx */
+#define  LVL_TxResume  2	/*level to ask the stack to resume Tx */
+
+/****  Rx Buffer length in bytes  ******************************************/
+#define  LEN_RxBuf  (1518+2+16)	/*length of Rx buffer, must be 4-byte aligned */
+#define  LEN_TxBuf   LEN_RxBuf
+
+/*----------------------------------------------------------------------------
+ * MACRO for ease
+ *--------------------------------------------------------------------------*/
+
+#define  Align32(a)  (((unsigned int)(a)+3)&~0x03)	/*32bit address alignment */
+#define  IdxNext(idxCur,len)  (((idxCur)+1)%(len))	/*calc next array index number */
+
+/****  malloc/free routine for DMA buffer  **********************************/
+ /*use non-cached DMA buffer */
+/* #define  MALLOC_DMA(size, pPhyAddr)  consistent_alloc(GFP_KERNEL|GFP_DMA, (size), (dma_addr_t*)(pPhyAddr), NULL) */
+#define MALLOC_DMA(size, pPhyAddr) dma_alloc_coherent(NULL, size, (dma_addr_t*)(pPhyAddr),  GFP_KERNEL|GFP_DMA)
+#define  FREE_DMA(vaddr)            consistent_free(vaddr)
+extern void cpu_arm920_dcache_clean_range(u32 va_bgn, u32 va_end);
+#define  dma_cache_wback(vaddr,size)  cpu_arm920_dcache_clean_range((u32)(vaddr),(u32)(vaddr)+(size)-1)
+
+/*----------------------------------------------------------------------------
+ * DEBUGGING LEVELS
+ *
+ * 0 for normal operation
+ * 1 for slightly more details
+ * >2 for various levels of increasingly useless information
+ *    2 for interrupt tracking, status flags
+ *    3 for packet dumps, etc.
+ *--------------------------------------------------------------------------*/
+#define  _DBG  0
+
+#if (_DBG > 2 )
+#define PRINTK3(x) printk x
+#else
+#define PRINTK3(x)
+#endif
+
+#if _DBG > 1
+#define PRINTK2(x) printk x
+#else
+#define PRINTK2(x)
+#endif
+
+#if _DBG > 0
+#define PRINTK1(x) printk x
+#else
+#define PRINTK1(x)
+#endif
+
+#ifdef _DBG
+#define PRINTK(x) printk x
+#else
+#define PRINTK(x)
+#endif
+
+#define  _PRTK_ENTRY      PRINTK2	/*to trace function entries */
+#define  _PRTK_SWERR      PRINTK	/*logical S/W error */
+#define  _PRTK_SYSFAIL    PRINTK	/*system service failure */
+#define  _PRTK_HWFAIL     PRINTK	/*H/W operation failure message */
+#define  _PRTK_WARN       PRINTK1	/*warning information */
+#define  _PRTK_INFO       PRINTK2	/*general information */
+#define  _PRTK_ENTRY_ISR  PRINTK3	/*to trace function entries belong to ISR */
+#define  _PRTK_WARN_ISR   PRINTK1	/*warning informations from ISR */
+#define  _PRTK_INFO_ISR   PRINTK3	/*general informations from ISR */
+#define  _PRTK_           PRINTK	/*for temporary print out */
+
+#if 0
+# define  _PRTK_DUMP       PRINTK1	/*to dump large amount of debug info */
+#endif
+
+/*----------------------------------------------------------------------------
+ * Custom Data Structures
+ *--------------------------------------------------------------------------*/
+
+/****  the information about the buffer passed to device.
+       there are matching bufferDescriptor informations 
+       for each Tx/Rx Descriptor Queue entry to trace 
+       the buffer within those queues.  ************************************/
+struct bufferDescriptor {
+	void *vaddr;		/*virtual address representing the buffer passed to device */
+	int (*pFreeRtn) (void *pBuf);	/*free routine */
+};
+
+/****  device privite informations
+       pointed by struct net_device::priv  *********************************/
+struct ep93xxEth_info {
+    /****  static device informations  **********************************/
+	struct {
+		int id;		/*device instance ID (0 for 1st and so on)
+				   must be first element of this structure */
+		union receiveDescriptor *pQueRxDesc;	/*pointer to Rx Descriptor Queue */
+		union receiveStatus *pQueRxSts;	/*pointer to Rx Status Queue */
+		union transmitDescriptor *pQueTxDesc;	/*pointer to Tx Descriptor Queue */
+		union transmitStatus *pQueTxSts;	/*pointer to Tx Status Queue */
+		unsigned char *pRxBuf;	/*base of Rx Buffer pool */
+		unsigned char *pTxBuf;	/*base of Tx Buffer pool */
+		unsigned long phyQueueBase;	/*physical address of device queues */
+		unsigned long phyQueRxDesc,	/*physical address of Rx Descriptor Queue */
+		 phyQueRxSts,	/*physical address of Rx Status Queue */
+		 phyQueTxDesc,	/*physical address of Tx Descriptor Queue */
+		 phyQueTxSts,	/*physical address of Tx Status Queue */
+		 phyRxBuf,	/*physical address of Rx Buffer pool */
+		 phyTxBuf;	/*physical address of Tx Buffer pool */
+		struct bufferDescriptor *pRxBufDesc,	/*info of Rx Buffers */
+		*pTxBufDesc;	/*info of Tx Buffers */
+		int miiIdPhy;	/*MII Bus ID of Ethernet PHY */
+	} s;
+    /****  dynamic information, subject to clear when device open  ******/
+	struct {
+		struct net_device_stats stats;	/*statistic data */
+		int idxQueRxDesc,	/*next processing index of device queues */
+		 idxQueRxSts, idxQueTxDescHead, idxQueTxDescTail, idxQueTxSts;
+		int txStopped;	/*flag for Tx condition */
+	} d;
+};
+
+/*----------------------------------------------------------------------------
+ * Global Variables
+ *--------------------------------------------------------------------------*/
+static int numOfInstance = 0;	/*total number of device instance, 0 means the 1st instance. */
+
+/*static struct sk_buff gTxSkb; */
+/*static char gTxBuff[LEN_TxBuf]; */
+
+static char gTxDataBuff[LEN_QueTxDesc][LEN_TxBuf];
+
+/* To know if PHY auto-negotiation has done? */
+static int gPhyAutoNegoDone = 0;
+
+/*----------------------------------------------------------------------------
+ * Function Proto-types
+ *--------------------------------------------------------------------------*/
+struct net_device *__init ep93xx_probe(int unit);
+static int do_ep93xx_probe(struct net_device *pD);
+static int ep93xxEth_open(struct net_device *pD);
+static int ep93xxEth_close(struct net_device *pD);
+static int ep93xxEth_hardStartXmit(struct sk_buff *pSkb, struct net_device *pD);
+static void ep93xxEth_txTimeout(struct net_device *pD);
+static void ep93xxEth_setMulticastList(struct net_device *pD);
+static struct net_device_stats *ep93xxEth_getStats(struct net_device *pD);
+
+static irqreturn_t ep93xxEth_isr(int irq, void *pDev, struct pt_regs *pRegs);
+
+/*============================================================================
+ *
+ * Internal Routines
+ *
+ *==========================================================================*/
+
+/*****************************************************************************
+* free_skb()
+*****************************************************************************/
+static int free_skb(void *pSkb)
+{
+	dev_kfree_skb_irq((struct sk_buff *)pSkb);
+	return 0;
+}				/*free_skb() */
+
+/*****************************************************************************
+* waitOnReg32()
+*****************************************************************************/
+static int waitOnReg32(struct net_device *pD, int reg,
+		       unsigned long mask, unsigned long expect, int tout)
+{
+	int i;
+	int dt;
+
+/*    _PRTK_ENTRY(("waitOnReg32(pD:0x%x,reg:0x%x,mask:0x%x,expect:0x%x,tout:%d)\n",
+                 pD,reg,mask,expect,tout));
+*/
+
+	for (i = 0; i < 10000;) {
+		dt = RegRd32(reg);
+		dt = (dt ^ expect) & mask;
+		if (0 == dt)
+			break;
+		if (tout)
+			i++;
+	}			/*for */
+	return dt;
+}				/*waitOnReg32() */
+
+#define  phy_wr(reg,dt)  _phy_write(pD, ((struct ep93xxEth_info*)netdev_priv(pD))->s.miiIdPhy, (reg), (dt))
+#define  phy_rd(reg)     _phy_read(pD, ((struct ep93xxEth_info*)netdev_priv(pD))->s.miiIdPhy, (reg))
+#define  phy_waitRdy()  waitOnReg32(pD, REG_MIISts,MIISts_Busy, ~MIISts_Busy, 1)
+
+/*****************************************************************************
+* _phy_write()
+*****************************************************************************/
+static void _phy_write(struct net_device *pD, int idPhy, int reg, u16 dt)
+{
+
+/*    _PRTK_ENTRY(("_phy_write(pD:0x%p,idPhy:%d,reg:0x%x,dt:0x%x)\n",pD,idPhy,reg,dt));*/
+
+	phy_waitRdy();
+	RegWr32(REG_MIIData, dt);
+	RegWr32(REG_MIICmd,
+		MIICmd_OP_WR | ((idPhy & 0x1f) << 5) | ((reg & 0x1f) << 0));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色狠狠色狠狠综合| 国产一区二区三区在线看麻豆| 成人黄色av网站在线| 亚洲国产精品精华液ab| 国产河南妇女毛片精品久久久| 久久老女人爱爱| 成人免费不卡视频| 亚洲欧洲99久久| 欧洲av在线精品| 免费成人在线观看视频| 国产视频在线观看一区二区三区| 成人综合婷婷国产精品久久 | 欧美日韩国产美| 日日噜噜夜夜狠狠视频欧美人| 91精品麻豆日日躁夜夜躁| 91精品国产欧美日韩| 亚洲女与黑人做爰| 国产91精品在线观看| 综合激情成人伊人| 在线播放欧美女士性生活| 亚洲成人精品影院| 亚洲精品一区二区三区蜜桃下载 | 亚洲精品一二三| 欧美日韩视频在线第一区 | 久久99精品网久久| 国产精品视频免费| 欧美性色欧美a在线播放| 精品一区二区免费在线观看| 国产精品对白交换视频| 欧美片网站yy| 粉嫩aⅴ一区二区三区四区五区 | 欧美精品 日韩| 国产精品中文欧美| 亚洲一区在线视频观看| 久久亚洲二区三区| 日本福利一区二区| 国内成人精品2018免费看| 亚洲丝袜美腿综合| 精品国产欧美一区二区| 一本色道久久综合精品竹菊| 免费欧美日韩国产三级电影| 中文字幕一区二区三| 欧美一区二区性放荡片| 色综合色狠狠天天综合色| 蜜桃视频在线观看一区| 亚洲美女视频在线观看| 欧美国产精品一区二区| 欧美精品久久99| 91丨九色丨尤物| 国产剧情一区二区| 亚洲成人在线网站| 国产精品久久久久永久免费观看 | 日韩一区二区免费在线电影| 99久久精品国产麻豆演员表| 韩国精品主播一区二区在线观看 | 中文字幕亚洲综合久久菠萝蜜| 精品久久国产老人久久综合| 欧美人与禽zozo性伦| 91美女视频网站| 成人午夜视频网站| 欧美日韩aaa| 亚洲免费av高清| 欧美日韩国产一二三| 欧美主播一区二区三区| 99re视频精品| 99麻豆久久久国产精品免费| 免费欧美日韩国产三级电影| 亚州成人在线电影| 亚洲尤物视频在线| 亚洲一区二区三区激情| 夜夜揉揉日日人人青青一国产精品| 国产精品视频免费看| 中文字幕二三区不卡| 欧美韩国日本不卡| 国产精品网站在线观看| 国产午夜精品理论片a级大结局| 久久久久综合网| 久久久99精品免费观看不卡| 国产丝袜在线精品| 国产精品亲子乱子伦xxxx裸| 国产欧美日韩精品a在线观看| 久久精品综合网| 国产精品久久久久久久久久免费看| 国产精品午夜春色av| 国产精品久久久久久一区二区三区 | 91丝袜呻吟高潮美腿白嫩在线观看| av不卡免费在线观看| 91丨porny丨中文| 欧美性受xxxx黑人xyx性爽| 欧美性生活大片视频| 91麻豆精品国产自产在线观看一区| 制服.丝袜.亚洲.另类.中文| 日韩美一区二区三区| 26uuu久久综合| 亚洲国产精品成人综合| 亚洲男同性恋视频| 五月天国产精品| 激情五月婷婷综合| 成人av综合在线| 欧美亚洲国产怡红院影院| 欧美一级免费大片| 久久精品人人做人人综合| 中文字幕一区三区| 亚洲一区在线视频观看| 久久精品国产免费| www.在线成人| 9191成人精品久久| 中文字幕第一区二区| 亚洲一级电影视频| 精品一区在线看| 成人av网站大全| 91精品福利在线一区二区三区| 精品电影一区二区| 亚洲男人的天堂在线观看| 日日嗨av一区二区三区四区| 国产91精品久久久久久久网曝门| 色呦呦国产精品| 精品国产乱码久久久久久老虎| 中文字幕永久在线不卡| 麻豆精品久久久| 99久久精品99国产精品| 欧美一卡二卡三卡四卡| 国产精品久线在线观看| 美女国产一区二区| 99精品久久久久久| 日韩欧美123| 有坂深雪av一区二区精品| 国产在线视频一区二区| 欧美影院一区二区三区| 国产精品乱人伦一区二区| 日本v片在线高清不卡在线观看| 成人精品国产一区二区4080| 日韩丝袜情趣美女图片| 亚洲另类中文字| 国产91综合网| 免费一级欧美片在线观看| 欧美日韩国产综合一区二区三区| 日韩欧美区一区二| 亚洲精品欧美激情| 国产精品自拍在线| 免费一级片91| 国产色综合久久| 亚洲综合一二三区| 成人亚洲一区二区一| 欧美一区中文字幕| 一区二区在线观看不卡| 国产激情视频一区二区在线观看| 欧美日韩mp4| 亚洲午夜久久久久久久久久久| 成人涩涩免费视频| 欧美α欧美αv大片| 日本在线不卡一区| 在线一区二区三区四区五区 | 丰满放荡岳乱妇91ww| 日韩一级欧美一级| 亚洲6080在线| 欧美这里有精品| 一片黄亚洲嫩模| 91在线观看污| 中文字幕一区二区日韩精品绯色| 国产精品一区二区你懂的| 欧美不卡一区二区| 日韩国产在线一| 欧美一区二区三区婷婷月色| 水蜜桃久久夜色精品一区的特点| 欧美午夜影院一区| 洋洋成人永久网站入口| 欧美在线一区二区| 亚洲成av人综合在线观看| 欧美亚州韩日在线看免费版国语版| 亚洲综合在线第一页| 欧美日韩国产欧美日美国产精品| 亚洲精品成人在线| 欧美丝袜丝交足nylons图片| 亚洲国产视频a| 欧美精选在线播放| 美女一区二区三区在线观看| 欧美一级欧美一级在线播放| 精品一区二区三区免费观看| 欧美变态口味重另类| 国产一区二区三区免费看| 国产欧美一区二区精品秋霞影院 | 亚洲丶国产丶欧美一区二区三区| 欧美中文字幕一区二区三区| 天天影视网天天综合色在线播放| 91精品免费在线| 国产一区二区三区免费看| 国产欧美综合在线观看第十页| 成人一二三区视频| 亚洲精品国产一区二区三区四区在线| 日本精品免费观看高清观看| 午夜激情一区二区三区| 日韩精品一区二区三区蜜臀| 国产精品资源网| 亚洲成a人片在线不卡一二三区| 欧美日韩日本视频| 精品亚洲成a人在线观看| 久久久电影一区二区三区| 91麻豆高清视频| 美女视频免费一区|