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

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

?? cs8900網卡移植.txt

?? CS8900
?? TXT
?? 第 1 頁 / 共 3 頁
字號:
 
2007-6-7 linux2.6.14 cs8900網卡移植成功。cs8900, cs8900a
	開發板:成都博睿科技 MC2410.(三星的 s3c2410芯片, 網卡芯片cs8900a)
	cs8900.h, cs8900.c 這兩個文件我在網上搜索很久都沒有結果。最后在一個帖子里面別人貼出來了,所以我把代碼copy下來自己建立cs8900.h cs8900.c 
兩個文件自己整理。由于是帖子copy的里面的數千個多余的"+",只好用utraledit逐個替換,還得注意不能把本來的“+”弄沒了。其中在.c文件中
開始處添加(已經添加上)
//add by zsyddl
#define CONFIG_ARCH_SMDK2410 
//add end;
	1、按照別人的說法,將兩個文件放到 driver/net/arm下面。
	2、在makefile結尾添加 obj-$(CONFIG_CS8900)		+= cs8900.o
	3、在該目錄下的kconfig文件中開始或者其他合適的地方 添加
 config CS8900
	tristate "CS8900 support"
	depends on NET_ETHERNET && ARM 
	以便讓 上面的makefile語句有效,才能將信新的文件編譯。
	4、修改 cs8900.h文件
#include <linux/config.h> 
#include <asm-arm/arch-s3c2410/regs-mem.h>

#define SMDK2410_ETH_IO 0xe0000000 //這個是網卡的物理地址映射到linux系統下的虛擬地址的起始地址。該數字在我的開發板是linux2.4的,內核中是該地址為0xd0000000,但是該地址//在linux2.6內核不正確,不能正確映射,于是修改為此。
#define SMDK2410_ETH_IRQ IRQ_EINT8
//這個是網卡使用的中斷吧。我按照linux2.4的數字修改為該值,網上的原本代碼是 IRQ_EINT9

	5、修改 arch/arm/mach-s3c2410/mach-smdk2410.c,大概是 112行。這個是告訴內核對地址進行映射,把網卡的物理地址映射到虛擬地址。因為linux系統中都是采用虛擬地址訪問。
static struct map_desc smdk2410_iodesc[] __initdata = {
  /* nothing here yet */
	//add by zsyddl
	//虛擬地址    ,物理地址,   占用空間大小。
	{0xe0000000, 0x11000000, SZ_1M, MT_DEVICE},
	//add end
};
	其中的物理地址是根據我的開發版的2.4內核的設定得來。這個根據不同的開發板 數值有所不同。
	6、配置內核,選中driver->networking->ethernet (10 or 100Mbit)-> CS8900 support for s3c2410.以使cs8900配置生效。
	7、保存編譯
	8、啟動新的內核。在命令行設置:
	> ifconfig eth0 192.168.0.15
	再次使用
	>ifconfig
	應該得到如下信息。如果沒有則不正確。還有就是看啟動信息中eth0相關的字樣有無異常。如果不正常,建議修改:0x11000000數值,IRQ_EINT8,這個需要根據開發板的網卡芯片連接而定。
	>ping 192.168.0.186 //正常
# ping 192.168.0.186
PING 192.168.0.186 (192.168.0.186): 56 data bytes
64 bytes from 192.168.0.186: icmp_seq=0 ttl=64 time=2.8 ms
64 bytes from 192.168.0.186: icmp_seq=1 ttl=64 time=0.6 ms

--- 192.168.0.186 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.6/1.7/2.8 ms

	總結:linux下面的移植都是很痛苦的事情。就這個網卡的移植我也花了3天的時間,也許是我太笨。。。呵呵。其中找到源代碼就花掉了90%的時間。所以這次把代碼打包放上,希望能給大家一點幫助。
	怕找不到放置的地方,下面把代碼貼上。
///cs8900.h文件
#ifndef CS8900_H 
#define CS8900_H 
 
/* 
 * linux/drivers/net/cs8900.h 
 * 
 * Author: Abraham van der Merwe <abraham at 2d3d.co.za> 
 * 
 * A Cirrus Logic CS8900A driver for Linux 
 * based on the cs89x0 driver written by Russell Nelson, 
 * Donald Becker, and others. 
 * 
 * This source code is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License 
 * version 2 as published by the Free Software Foundation. 
 */ 
 //add by zsyddl
#include <linux/config.h> 
#include <asm-arm/arch-s3c2410/regs-mem.h>

#define SMDK2410_ETH_IO 0xe0000000 
#define SMDK2410_ETH_IRQ IRQ_EINT8
//
/* 
 * Ports 
 */ 
 
#define PP_Address 0x0a /* PacketPage Pointer Port (Section 4.10.10) */ 
#define PP_Data 0x0c /* PacketPage Data Port (Section 4.10.10) */ 
 
/* 
 * Registers 
 */ 
 
#define PP_ProductID 0x0000 /* Section 4.3.1 Product Identification Code */ 
#define PP_MemBase 0x002c /* Section 4.9.2 Memory Base Address Register */ 
#define PP_IntNum 0x0022 /* Section 3.2.3 Interrupt Number */ 
#define PP_EEPROMCommand 0x0040 /* Section 4.3.11 EEPROM Command */ 
#define PP_EEPROMData 0x0042 /* Section 4.3.12 EEPROM Data */ 
#define PP_RxCFG 0x0102 /* Section 4.4.6 Receiver Configuration */ 
#define PP_RxCTL 0x0104 /* Section 4.4.8 Receiver Control */ 
#define PP_TxCFG 0x0106 /* Section 4.4.9 Transmit Configuration */ 
#define PP_BufCFG 0x010a /* Section 4.4.12 Buffer Configuration */ 
#define PP_LineCTL 0x0112 /* Section 4.4.16 Line Control */ 
#define PP_SelfCTL 0x0114 /* Section 4.4.18 Self Control */ 
#define PP_BusCTL 0x0116 /* Section 4.4.20 Bus Control */ 
#define PP_TestCTL 0x0118 /* Section 4.4.22 Test Control */ 
#define PP_ISQ 0x0120 /* Section 4.4.5 Interrupt Status Queue */ 
#define PP_TxEvent 0x0128 /* Section 4.4.10 Transmitter Event */ 
#define PP_BufEvent 0x012c /* Section 4.4.13 Buffer Event */ 
#define PP_RxMISS 0x0130 /* Section 4.4.14 Receiver Miss Counter */ 
#define PP_TxCOL 0x0132 /* Section 4.4.15 Transmit Collision Counter */ 
#define PP_SelfST 0x0136 /* Section 4.4.19 Self Status */ 
#define PP_BusST 0x0138 /* Section 4.4.21 Bus Status */ 
#define PP_TxCMD 0x0144 /* Section 4.4.11 Transmit Command */ 
#define PP_TxLength 0x0146 /* Section 4.5.2 Transmit Length */ 
#define PP_IA 0x0158 /* Section 4.6.2 Individual Address (IEEE Address) */ 
#define PP_RxStatus 0x0400 /* Section 4.7.1 Receive Status */ 
#define PP_RxLength 0x0402 /* Section 4.7.1 Receive Length (in bytes) */ 
#define PP_RxFrame 0x0404 /* Section 4.7.2 Receive Frame Location */ 
#define PP_TxFrame 0x0a00 /* Section 4.7.2 Transmit Frame Location */ 
 
/* 
 * Values 
 */ 
 
/* PP_IntNum */ 
#define INTRQ0 0x0000 
#define INTRQ1 0x0001 
#define INTRQ2 0x0002 
#define INTRQ3 0x0003 
 
/* PP_ProductID */ 
#define EISA_REG_CODE 0x630e 
#define REVISION(x) (((x) & 0x1f00) >> 8) 
#define VERSION(x) ((x) & ~0x1f00) 
 
#define CS8900A 0x0000 
#define REV_B 7 
#define REV_C 8 
#define REV_D 9 
 
/* PP_RxCFG */ 
#define Skip_1 0x0040 
#define StreamE 0x0080 
#define RxOKiE 0x0100 
#define RxDMAonly 0x0200 
#define AutoRxDMAE 0x0400 
#define BufferCRC 0x0800 
#define CRCerroriE 0x1000 
#define RuntiE 0x2000 
#define ExtradataiE 0x4000 
 
/* PP_RxCTL */ 
#define IAHashA 0x0040 
#define PromiscuousA 0x0080 
#define RxOKA 0x0100 
#define MulticastA 0x0200 
#define IndividualA 0x0400 
#define BroadcastA 0x0800 
#define CRCerrorA 0x1000 
#define RuntA 0x2000 
#define ExtradataA 0x4000 
 
/* PP_TxCFG */ 
#define Loss_of_CRSiE 0x0040 
#define SQErroriE 0x0080 
#define TxOKiE 0x0100 
#define Out_of_windowiE 0x0200 
#define JabberiE 0x0400 
#define AnycolliE 0x0800 
#define T16colliE 0x8000 
 
/* PP_BufCFG */ 
#define SWint_X 0x0040 
#define RxDMAiE 0x0080 
#define Rdy4TxiE 0x0100 
#define TxUnderruniE 0x0200 
#define RxMissiE 0x0400 
#define Rx128iE 0x0800 
#define TxColOvfiE 0x1000 
#define MissOvfloiE 0x2000 
#define RxDestiE 0x8000 
 
/* PP_LineCTL */ 
#define SerRxON 0x0040 
#define SerTxON 0x0080 
#define AUIonly 0x0100 
#define AutoAUI_10BT 0x0200 
#define ModBackoffE 0x0800 
#define PolarityDis 0x1000 
#define L2_partDefDis 0x2000 
#define LoRxSquelch 0x4000 
 
/* PP_SelfCTL */ 
#define RESET 0x0040 
#define SWSuspend 0x0100 
#define HWSleepE 0x0200 
#define HWStandbyE 0x0400 
#define HC0E 0x1000 
#define HC1E 0x2000 
#define HCB0 0x4000 
#define HCB1 0x8000 
 
/* PP_BusCTL */ 
#define ResetRxDMA 0x0040 
#define DMAextend 0x0100 
#define UseSA 0x0200 
#define MemoryE 0x0400 
#define DMABurst 0x0800 
#define IOCHRDYE 0x1000 
#define RxDMAsize 0x2000 
#define EnableRQ 0x8000 
 
/* PP_TestCTL */ 
#define DisableLT 0x0080 
#define ENDECloop 0x0200 
#define AUIloop 0x0400 
#define DisableBackoff 0x0800 
#define FDX 0x4000 
 
/* PP_ISQ */ 
#define RegNum(x) ((x) & 0x3f) 
#define RegContent(x) ((x) & ~0x3d) 
 
#define RxEvent 0x0004 
#define TxEvent 0x0008 
#define BufEvent 0x000c 
#define RxMISS 0x0010 
#define TxCOL 0x0012 
 
/* PP_RxStatus */ 
#define IAHash 0x0040 
#define Dribblebits 0x0080 
#define RxOK 0x0100 
#define Hashed 0x0200 
#define IndividualAdr 0x0400 
#define Broadcast 0x0800 
#define CRCerror 0x1000 
#define Runt 0x2000 
#define Extradata 0x4000 
 
#define HashTableIndex(x) ((x) >> 0xa) 
 
/* PP_TxCMD */ 
#define After5 0 
#define After381 1 
#define After1021 2 
#define AfterAll 3 
#define TxStart(x) ((x) << 6) 
 
#define Force 0x0100 
#define Onecoll 0x0200 
#define InhibitCRC 0x1000 
#define TxPadDis 0x2000 
 
/* PP_BusST */ 
#define TxBidErr 0x0080 
#define Rdy4TxNOW 0x0100 
 
/* PP_TxEvent */ 
#define Loss_of_CRS 0x0040 
#define SQEerror 0x0080 
#define TxOK 0x0100 
#define Out_of_window 0x0200 
#define Jabber 0x0400 
#define T16coll 0x8000 
 
#define TX_collisions(x) (((x) >> 0xb) & ~0x8000) 
 
/* PP_BufEvent */ 
#define SWint 0x0040 
#define RxDMAFrame 0x0080 
#define Rdy4Tx 0x0100 
#define TxUnderrun 0x0200 
#define RxMiss 0x0400 
#define Rx128 0x0800 
#define RxDest 0x8000 
 
/* PP_RxMISS */ 
#define MissCount(x) ((x) >> 6) 
 
/* PP_TxCOL */ 
#define ColCount(x) ((x) >> 6) 
 
/* PP_SelfST */ 
#define T3VActive 0x0040 
#define INITD 0x0080 
#define SIBUSY 0x0100 
#define EEPROMpresent 0x0200 
#define EEPROMOK 0x0400 
#define ELpresent 0x0800 
#define EEsize 0x1000 
 
/* PP_EEPROMCommand */ 
#define EEWriteEnable 0x00F0 
#define EEWriteDisable 0x0000 
#define EEWriteRegister 0x0100 
#define EEReadRegister 0x0200 
#define EEEraseRegister 0x0300 
#define ELSEL 0x0400 
 
#endif /* #ifndef CS8900_H */ 
/////////////////////////////////////////
//////cs8900.c
/*
 * Author: Abraham van der Merwe <abraham at 2d3d.co.za> 
 * 
 * A Cirrus Logic CS8900A driver for Linux 
 * based on the cs89x0 driver written by Russell Nelson, 
 * Donald Becker, and others. 
 * 
 * This source code is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU General Public License 
 * version 2 as published by the Free Software Foundation. 
 * 
 * History: 
 * 22-May-2002 Initial version (Abraham vd Merwe) 
 * 30-May-2002 Added char device support for eeprom (Frank Becker) 
 * 24-Jan-2004 Fixups for 2.6 (Frank Becker) 
 * 15-July-2004 Modified for SMDK2410 (Roc Wu pwu at jadechip.com) 
 */ 
 
#define VERSION_STRING "Cirrus Logic CS8900A driver for Linux (Modified for SMDK2410)" 
//add by zsyddl
#define CONFIG_ARCH_SMDK2410 1 
//add end;
/* 
 * At the moment the driver does not support memory mode operation. 
 * It is trivial to implement this, but not worth the effort. 
 */ 
 
/* 
 * TODO: 
 * 
 * 1. Sort out ethernet checksum 
 * 2. If !ready in send_start(), queue buffer and send it in interrupt 
handler 
 * when we receive a BufEvent with Rdy4Tx, send it again. dangerous! 
 * 3. how do we prevent interrupt handler destroying integrity of get_stats()
? 
 * 4. Change reset code to check status. 
 * 5. Implement set_mac_address and remove fake mac address 
 * 7. Link status detection stuff 
 * 8. Write utility to write EEPROM, do self testing, etc. 
 * 9. Implement DMA routines (I need a board w/ DMA support for that) 
 * 10. Power management 
 * 11. Add support for multiple ethernet chips 
 */ 
 
// added BSt 
#include <linux/config.h> 
 
#include <linux/kernel.h> 
#include <linux/module.h> 
#include <linux/types.h> 
#include <linux/version.h> 
#include <linux/errno.h> 
#include <linux/init.h> 
#include <linux/delay.h> 
#include <linux/ioport.h> 
#include <asm/irq.h> 
#include <asm/hardware.h> 
#include <asm/io.h> 
#include <asm/uaccess.h> 
#include <linux/netdevice.h> 
#include <linux/etherdevice.h> 
#include <linux/skbuff.h> 
 
// Added BSt 
#include <asm/mach-types.h> 
 
#ifdef CONFIG_SA1100_CERF 
#include "asm/arch/cerf.h" 
#endif 
 
#ifdef CONFIG_ARCH_SMDK2410 
//#include "asm/arch/smdk2410.h" 
#endif 
 
#include "cs8900.h" 
 
//#define FULL_DUPLEX 
//#define DEBUG 
 
typedef struct { 
	struct net_device_stats stats; 
	u16 txlen; 
	int char_devnum; 
 
	spinlock_t lock; 
} cs8900_t; 
 
int cs8900_probe (struct net_device *dev); 
// static struct net_device cs8900_dev = 
// { 
// 	init: cs8900_probe 
// }; 
//  
static struct net_device cs8900_dev;

 
/* 
 * There seems to be no way to determine the exact size of the eeprom, 
 * so we use the largest size. 
 * FIXME: Verify it's safe to read/write past the end of a 64/128 
 * byte eeprom. 
 * 
 * Possible eeprom sizes: 
 * Cx46 - 64 bytes 
 * Cx56 - 128 bytes 
 * Cx66 - 256 bytes 
 */ 
#define MAX_EEPROM_SIZE 256 
 
static int cs8900_eeprom_fopen(struct inode *inode, struct file *file); 
static int cs8900_eeprom_frelease(struct inode *inode, struct file *file); 
static loff_t cs8900_eeprom_fllseek(struct file * file,loff_t offset, int 
		flags); 
static ssize_t cs8900_eeprom_fread(struct file *file, char *buf, size_t count
		, loff_t *f_pos); 
static ssize_t cs8900_eeprom_fwrite(struct file *file, const char *buf, 
				    size_t count, loff_t *f_pos); 
static struct file_operations cs8900_eeprom_fops = { 
	owner: THIS_MODULE, 
	open: cs8900_eeprom_fopen, 
	release: cs8900_eeprom_frelease, 
	llseek: cs8900_eeprom_fllseek, 
	read: cs8900_eeprom_fread, 
	write: cs8900_eeprom_fwrite, 
}; 
 
static u16 cs8900_eeprom_cache[MAX_EEPROM_SIZE/2]; 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久青草大香线综合精品| 麻豆成人免费电影| 久久国产福利国产秒拍| 91福利国产成人精品照片| 欧美国产精品v| 国产麻豆视频一区| 国产视频911| 精品一区二区三区免费| 欧美一级高清片在线观看| 丝袜亚洲另类欧美| 欧美日韩国产在线观看| 亚洲一区在线观看免费| 欧美在线免费播放| 中文字幕在线观看不卡视频| 不卡的av中国片| 中文字幕一区二| 色综合久久综合中文综合网| 《视频一区视频二区| 91亚洲国产成人精品一区二区三| 中文字幕在线不卡国产视频| 菠萝蜜视频在线观看一区| 国产精品久久久久久亚洲毛片| 91麻豆高清视频| 国产精品久久午夜| 色噜噜狠狠一区二区三区果冻| 亚洲精品国产精华液| 91在线看国产| 亚洲国产精品一区二区尤物区| 欧美日韩国产欧美日美国产精品| 麻豆久久一区二区| 久久免费电影网| 色综合久久久久综合体| 一区二区三区免费在线观看| 欧美精品乱码久久久久久按摩| 久久成人免费电影| 国产精品久久久久精k8| 欧美精品1区2区3区| 成人激情视频网站| 亚洲激情图片小说视频| 欧美猛男超大videosgay| 久久99精品久久只有精品| 国产欧美日韩在线| 欧美亚洲免费在线一区| 久久精品免费看| 国产精品电影院| 欧美日韩mp4| 国产成人在线视频网站| 一区二区在线免费观看| 精品久久久影院| 91亚洲国产成人精品一区二三 | 日韩在线一二三区| 日韩精品综合一本久道在线视频| 国产成人免费视频一区| 亚洲成人7777| 国产精品免费av| 欧美视频一区二区在线观看| 粉嫩一区二区三区在线看| 免费在线成人网| 国产精品久久久一本精品| 在线不卡一区二区| 成人小视频免费观看| 日本中文字幕不卡| 亚洲色图一区二区三区| 日韩欧美一级精品久久| 欧美综合色免费| 成人午夜在线播放| 蜜臀av性久久久久av蜜臀妖精| 久久久久久久综合狠狠综合| 欧美日韩久久不卡| 99视频一区二区| 国产一区欧美日韩| 亚洲国产另类av| 日韩理论电影院| 国产精品视频一二三区 | 欧美不卡一二三| 欧美撒尿777hd撒尿| 成人丝袜高跟foot| 国产一区二区三区香蕉| 视频一区国产视频| 亚洲午夜久久久久中文字幕久| 欧美激情一区二区三区蜜桃视频| 制服丝袜亚洲色图| 91九色最新地址| 一本大道久久精品懂色aⅴ| 国产成人亚洲综合a∨婷婷图片| 免费欧美高清视频| 五月激情六月综合| 一区二区三区**美女毛片| 亚洲国产精品二十页| 久久久五月婷婷| 精品国产乱码久久| 欧美色图在线观看| 91九色最新地址| 欧美性猛片aaaaaaa做受| 色综合色狠狠综合色| 色国产综合视频| 欧美无砖专区一中文字| 91国偷自产一区二区使用方法| 91在线观看高清| 色哟哟国产精品| 欧美性大战久久久久久久蜜臀| 色爱区综合激月婷婷| av动漫一区二区| 91蜜桃网址入口| 欧美亚洲综合网| 51精品国自产在线| 色综合中文字幕| 在线视频国内一区二区| 欧美日韩亚洲高清一区二区| 欧美性生活大片视频| 欧美欧美午夜aⅴ在线观看| 777色狠狠一区二区三区| 在线观看一区不卡| 欧美高清视频www夜色资源网| 91精品国产麻豆| 精品日韩一区二区三区| 中文字幕第一区二区| 亚洲桃色在线一区| 亚洲高清免费视频| 日韩av中文字幕一区二区三区| 久久精品国产网站| 国产精品1区2区| 精品视频在线看| 国产日韩欧美在线一区| 亚洲va欧美va国产va天堂影院| 国产真实乱对白精彩久久| 972aa.com艺术欧美| 777xxx欧美| 亚洲天堂a在线| 国产在线不卡视频| 欧美色倩网站大全免费| 日本一区二区免费在线观看视频 | 亚洲综合激情小说| 另类专区欧美蜜桃臀第一页| av在线一区二区三区| 欧美日韩一区视频| 国产精品白丝在线| 久久精品国产澳门| 欧美探花视频资源| 国产精品伦理在线| 精品一二三四在线| 欧美日韩中文另类| 亚洲天堂中文字幕| 国产成人免费高清| 日韩免费一区二区| 亚洲国产精品天堂| 不卡的av中国片| 中文字幕av一区二区三区免费看| 日韩精品久久理论片| 91年精品国产| 中文字幕一区免费在线观看| 久久66热re国产| 欧美一区二区三区四区久久| 一区二区三区四区在线免费观看| 国产成人精品网址| 久久人人超碰精品| 免费在线视频一区| 欧美性生交片4| 亚洲香肠在线观看| 色悠悠亚洲一区二区| 国产精品国产三级国产| 国产.欧美.日韩| 国产欧美日韩卡一| 成人中文字幕合集| 国产视频一区不卡| 国产经典欧美精品| wwwwxxxxx欧美| 久久99精品久久久久久久久久久久 | 六月丁香综合在线视频| 欧美日韩国产高清一区| 亚洲高清免费视频| 欧美日韩午夜在线视频| 一区二区三区不卡视频| 欧美综合天天夜夜久久| 一区二区三区中文字幕电影| 色又黄又爽网站www久久| 亚洲精品视频在线| 色综合久久天天综合网| 亚洲欧美日韩国产综合| 欧美性淫爽ww久久久久无| 亚洲国产婷婷综合在线精品| 欧美日韩亚洲另类| 日本不卡中文字幕| 日韩欧美中文一区二区| 精品一二三四区| 欧美经典一区二区三区| 99在线热播精品免费| 一区二区三国产精华液| 欧美美女bb生活片| 久久激情五月激情| 日本一区二区三区电影| 91在线视频免费观看| 亚洲一区二区av电影| 日韩一级精品视频在线观看| 韩国在线一区二区| 国产精品国产自产拍高清av王其| 色猫猫国产区一区二在线视频| 婷婷开心久久网| 欧美精品一区二区三区在线| 成人禁用看黄a在线|