diff -ruN linux-2.4.31/Makefile linux-2.4.31_linkstation/Makefile --- linux-2.4.31/Makefile 2005-05-31 20:56:56.000000000 -0400 +++ linux-2.4.31_linkstation/Makefile 2006-01-01 19:30:42.000000000 -0500 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 32 -EXTRAVERSION = +EXTRAVERSION = -kurobox KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) @@ -74,7 +74,7 @@ # images. Uncomment if you want to place them anywhere other than root. # -#export INSTALL_PATH=/boot +export INSTALL_PATH=/boot # # INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory diff -ruN linux-2.4.31/arch/ppc/config.in linux-2.4.31_linkstation/arch/ppc/config.in --- linux-2.4.31/arch/ppc/config.in 2004-08-07 19:26:04.000000000 -0400 +++ linux-2.4.31_linkstation/arch/ppc/config.in 2005-09-06 00:42:20.000000000 -0400 @@ -6,6 +6,7 @@ define_bool CONFIG_RWSEM_GENERIC_SPINLOCK n define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM y define_bool CONFIG_HAVE_DEC_LOCK y +define_bool CONFIG_GENERIC_ISA_DMA y mainmenu_name "Linux/PowerPC Kernel Configuration" @@ -129,16 +130,13 @@ IBM-Spruce CONFIG_SPRUCE \ Motorola-LoPEC CONFIG_LOPEC \ Motorola-Sandpoint CONFIG_SANDPOINT \ + Buffalo-Linkstation CONFIG_LINKSTATION \ Motorola-PowerPlus CONFIG_PPLUS \ Motorola-PrPMC750 CONFIG_PRPMC750 \ SBS-Palomar4 CONFIG_PAL4 \ Synergy-Gemini CONFIG_GEMINI" CHRP/PowerMac/PReP fi -if [ "$CONFIG_SANDPOINT" = "y" ]; then - bool 'Enable MPC10x store gathering' CONFIG_MPC10X_STORE_GATHERING -fi - if [ "$CONFIG_LOPEC" = "y" ]; then define_bool CONFIG_EPIC_SERIAL_MODE y define_bool CONFIG_GEN550 y @@ -155,6 +153,21 @@ if [ "$CONFIG_SANDPOINT" = "y" ]; then define_bool CONFIG_EPIC_SERIAL_MODE y define_bool CONFIG_GEN550 y + bool 'Enable MPC10x store gathering' CONFIG_MPC10X_STORE_GATHERING +fi + +if [ "$CONFIG_LINKSTATION" = "y" ]; then + define_bool CONFIG_GEN550 y +# define_bool CONFIG_EPIC_SERIAL_MODE y + bool 'Enable MPC10x store gathering' CONFIG_MPC10X_STORE_GATHERING + bool ' Use EPIC serial mode' CONFIG_EPIC_SERIAL_MODE + choice 'Model Type' \ + "HD-LAN CONFIG_LAN \ + HD-HLAN CONFIG_HLAN \ + KUROBOX CONFIG_KUROBOX \ + HD-HGLAN CONFIG_HGLAN \ + KUROBOXHG CONFIG_KUROBOXHG \ + HD-HTGL CONFIG_HTGL" HD-HTGL fi if [ "$CONFIG_SPRUCE" = "y" ]; then diff -ruN linux-2.4.31/arch/ppc/configs/kurobox_defconfig linux-2.4.31_linkstation/arch/ppc/configs/kurobox_defconfig --- linux-2.4.31/arch/ppc/configs/kurobox_defconfig 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/arch/ppc/configs/kurobox_defconfig 2006-01-01 19:33:38.000000000 -0500 @@ -0,0 +1,907 @@ +# +# Automatically generated by make menuconfig: don't edit +# +# CONFIG_UID16 is not set +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_HAVE_DEC_LOCK=y +CONFIG_GENERIC_ISA_DMA=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +# CONFIG_ADVANCED_OPTIONS is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODVERSIONS=y +CONFIG_KMOD=y + +# +# Platform support +# +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_6xx=y +# CONFIG_40x is not set +# CONFIG_44x is not set +# CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set +# CONFIG_8xx is not set +# CONFIG_8260 is not set +CONFIG_PPC_STD_MMU=y +# CONFIG_ALL_PPC is not set +# CONFIG_APUS is not set +# CONFIG_SPRUCE is not set +# CONFIG_LOPEC is not set +# CONFIG_SANDPOINT is not set +CONFIG_LINKSTATION=y +# CONFIG_PPLUS is not set +# CONFIG_PRPMC750 is not set +# CONFIG_PAL4 is not set +# CONFIG_GEMINI is not set +CONFIG_GEN550=y +CONFIG_MPC10X_STORE_GATHERING=y +# CONFIG_EPIC_SERIAL_MODE is not set +# CONFIG_LAN is not set +# CONFIG_HLAN is not set +CONFIG_KUROBOX=y +# CONFIG_HGLAN is not set +# CONFIG_KUROBOXHG is not set +# CONFIG_HTGL is not set +# CONFIG_SMP is not set +# CONFIG_ALTIVEC is not set +# CONFIG_TAU is not set +CONFIG_PPC_ISATIMER=y + +# +# General setup +# +# CONFIG_HIGHMEM is not set +CONFIG_HIGHMEM_START=0xfe000000 +CONFIG_LOWMEM_SIZE=0x30000000 +CONFIG_KERNEL_START=0xc0000000 +CONFIG_TASK_SIZE=0x80000000 +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_SBUS is not set +# CONFIG_MCA is not set +CONFIG_PCI=y +CONFIG_NET=y +CONFIG_SYSCTL=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_KCORE_ELF=y +CONFIG_BINFMT_ELF=y +CONFIG_KERNEL_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_OOM_KILLER is not set +# CONFIG_PCI_NAMES is not set +CONFIG_HOTPLUG=y + +# +# PCMCIA/CardBus support +# +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set +# CONFIG_GEN_RTC is not set +# CONFIG_PPC_RTC is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="root=/dev/hda1" + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +CONFIG_PNP=m +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set +# CONFIG_CISS_MONITOR_THREAD is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_LOOP=m +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=15000 +CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_STATS=y + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_IPX is not set +CONFIG_ATALK=y + +# +# Appletalk devices +# +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_DELKIN is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_IDEPCI_SHARE_IRQ is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set +# CONFIG_IDEDMA_PCI_AUTO is not set +# CONFIG_IDEDMA_ONLYDISK is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_BLK_DEV_ADMA100 is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_AMD74XX_OVERRIDE is not set +# CONFIG_BLK_DEV_ATIIXP is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_PDC202XX_BURST is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_SVWKS is not set +CONFIG_BLK_DEV_SIIMAGE=y +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_BLK_DEV_SL82C105 is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_IDEDMA_IVB is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set +# CONFIG_BLK_DEV_ATARAID_SII is not set + +# +# SCSI support +# +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +CONFIG_CHR_DEV_SG=y +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_MEGARAID2 is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_SATA_AHCI is not set +# CONFIG_SCSI_SATA_SVW is not set +# CONFIG_SCSI_ATA_PIIX is not set +# CONFIG_SCSI_SATA_NV is not set +# CONFIG_SCSI_SATA_QSTOR is not set +# CONFIG_SCSI_SATA_PROMISE is not set +# CONFIG_SCSI_SATA_SX4 is not set +# CONFIG_SCSI_SATA_SIL is not set +# CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set +# CONFIG_SCSI_SATA_VIA is not set +# CONFIG_SCSI_SATA_VITESSE is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_MACE is not set +# CONFIG_BMAC is not set +# CONFIG_GMAC is not set +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +CONFIG_NET_PCI=y +# CONFIG_PCNET32 is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_APRICOT is not set +# CONFIG_B44 is not set +# CONFIG_CS89x0 is not set +CONFIG_TULIP=y +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_DE4X5 is not set +# CONFIG_DGRS is not set +# CONFIG_DM9102 is not set +# CONFIG_EEPRO100 is not set +# CONFIG_EEPRO100_PIO is not set +# CONFIG_E100 is not set +# CONFIG_LNE390 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_FORCEDETH is not set +# CONFIG_NE3210 is not set +# CONFIG_ES3210 is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_8139TOO_PIO is not set +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139TOO_8129 is not set +# CONFIG_8139_OLD_RX_RESET is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_SUNDANCE_MMIO is not set +# CONFIG_TLAN is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_RHINE_MMIO is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Old CD-ROM drivers (not SCSI, not IDE) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Console drivers +# +# CONFIG_VGA_CONSOLE is not set + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_UINPUT is not set + +# +# Macintosh device drivers +# + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +CONFIG_I2C=y +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_ALGOPCF is not set +CONFIG_I2C_ALGO_8245=y +CONFIG_I2C_MPC8245=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_PROC=y + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set +# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_IPMI_PANIC_EVENT is not set +# CONFIG_IPMI_DEVICE_INTERFACE is not set +# CONFIG_IPMI_KCS is not set +# CONFIG_IPMI_WATCHDOG is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_SCx200 is not set +# CONFIG_SCx200_GPIO is not set +# CONFIG_AMD_PM768 is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_RS5C372_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set + +# +# Direct Rendering Manager (XFree86 DRI support) +# +# CONFIG_DRM is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_QFMT_V2 is not set +# CONFIG_AUTOFS_FS is not set +CONFIG_AUTOFS4_FS=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +CONFIG_HFS_FS=m +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BEFS_DEBUG is not set +# CONFIG_BFS_FS is not set +CONFIG_EXT3_FS=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FAT_FS=m +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=m +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +CONFIG_RAMFS=y +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +CONFIG_UDF_FS=m +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_FS=m +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_TRACE is not set +# CONFIG_XFS_DEBUG is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +CONFIG_NFSD_TCP=y +CONFIG_SUNRPC=m +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_SMB_UNIX=y +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_SMB_NLS=y +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=y +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m + +# +# Sound +# +CONFIG_SOUND=m +# CONFIG_SOUND_ALI5455 is not set +# CONFIG_SOUND_BT878 is not set +# CONFIG_SOUND_CMPCI is not set +# CONFIG_SOUND_EMU10K1 is not set +# CONFIG_MIDI_EMU10K1 is not set +# CONFIG_SOUND_FUSION is not set +# CONFIG_SOUND_CS4281 is not set +# CONFIG_SOUND_ES1370 is not set +# CONFIG_SOUND_ES1371 is not set +# CONFIG_SOUND_ESSSOLO1 is not set +# CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_FORTE is not set +# CONFIG_SOUND_ICH is not set +# CONFIG_SOUND_RME96XX is not set +# CONFIG_SOUND_SONICVIBES is not set +# CONFIG_SOUND_TRIDENT is not set +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_VIA82CXXX is not set +# CONFIG_MIDI_VIA82CXXX is not set +CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +# CONFIG_SOUND_DMAP is not set +# CONFIG_SOUND_AD1816 is not set +# CONFIG_SOUND_AD1889 is not set +# CONFIG_SOUND_SGALAXY is not set +# CONFIG_SOUND_ADLIB is not set +# CONFIG_SOUND_ACI_MIXER is not set +# CONFIG_SOUND_CS4232 is not set +# CONFIG_SOUND_SSCAPE is not set +# CONFIG_SOUND_GUS is not set +# CONFIG_SOUND_VMIDI is not set +# CONFIG_SOUND_TRIX is not set +# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_MPU401 is not set +# CONFIG_SOUND_NM256 is not set +# CONFIG_SOUND_MAD16 is not set +# CONFIG_SOUND_PAS is not set +# CONFIG_PAS_JOYSTICK is not set +# CONFIG_SOUND_PSS is not set +# CONFIG_SOUND_SB is not set +# CONFIG_SOUND_AWE32_SYNTH is not set +# CONFIG_SOUND_KAHLUA is not set +# CONFIG_SOUND_WAVEFRONT is not set +# CONFIG_SOUND_MAUI is not set +# CONFIG_SOUND_YM3812 is not set +# CONFIG_SOUND_OPL3SA1 is not set +# CONFIG_SOUND_OPL3SA2 is not set +# CONFIG_SOUND_YMFPCI is not set +# CONFIG_SOUND_YMFPCI_LEGACY is not set +# CONFIG_SOUND_UART6850 is not set +# CONFIG_SOUND_AEDSP16 is not set +# CONFIG_SOUND_TVMIXER is not set +# CONFIG_SOUND_AD1980 is not set +# CONFIG_SOUND_WM97XX is not set + +# +# USB support +# +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_BANDWIDTH is not set +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +CONFIG_USB_OHCI=y +CONFIG_USB_AUDIO=m +CONFIG_USB_EMI26=m +CONFIG_USB_MIDI=m +CONFIG_USB_STORAGE=y +CONFIG_USB_STORAGE_DEBUG=y +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_HP8200e=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +# CONFIG_USB_ACM is not set +CONFIG_USB_PRINTER=y +CONFIG_USB_HID=m +# CONFIG_USB_HIDINPUT is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_KBD is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +# CONFIG_USB_SERIAL_DEBUG is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_TIGL is not set +# CONFIG_USB_BRLVGER is not set +# CONFIG_USB_LCD is not set + +# +# Support for USB gadgets +# +# CONFIG_USB_GADGET is not set + +# +# Bluetooth support +# +CONFIG_BLUEZ=m +# CONFIG_BLUEZ_L2CAP is not set +# CONFIG_BLUEZ_SCO is not set +# CONFIG_BLUEZ_RFCOMM is not set +# CONFIG_BLUEZ_BNEP is not set + +# +# Bluetooth device drivers +# +CONFIG_BLUEZ_HCIUSB=m +# CONFIG_BLUEZ_HCIUSB_SCO is not set +# CONFIG_BLUEZ_HCIUART is not set +CONFIG_BLUEZ_HCIBFUSB=m +# CONFIG_BLUEZ_HCIDTL1 is not set +# CONFIG_BLUEZ_HCIBT3C is not set +# CONFIG_BLUEZ_HCIBLUECARD is not set +# CONFIG_BLUEZ_HCIBTUART is not set +# CONFIG_BLUEZ_HCIVHCI is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +# CONFIG_CRC32 is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +# CONFIG_FW_LOADER is not set + +# +# Kernel hacking +# +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_SERIAL_TEXT_DEBUG is not set +CONFIG_LOG_BUF_SHIFT=0 diff -ruN linux-2.4.31/arch/ppc/configs/kuroboxhg_defconfig linux-2.4.31_linkstation/arch/ppc/configs/kuroboxhg_defconfig --- linux-2.4.31/arch/ppc/configs/kuroboxhg_defconfig 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/arch/ppc/configs/kuroboxhg_defconfig 2006-01-01 19:34:30.000000000 -0500 @@ -0,0 +1,855 @@ +# +# Automatically generated by make menuconfig: don't edit +# +# CONFIG_UID16 is not set +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_HAVE_DEC_LOCK=y +CONFIG_GENERIC_ISA_DMA=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +# CONFIG_ADVANCED_OPTIONS is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODVERSIONS=y +CONFIG_KMOD=y + +# +# Platform support +# +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_6xx=y +# CONFIG_40x is not set +# CONFIG_44x is not set +# CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set +# CONFIG_8xx is not set +# CONFIG_8260 is not set +CONFIG_PPC_STD_MMU=y +# CONFIG_ALL_PPC is not set +# CONFIG_APUS is not set +# CONFIG_SPRUCE is not set +# CONFIG_LOPEC is not set +# CONFIG_SANDPOINT is not set +CONFIG_LINKSTATION=y +# CONFIG_PPLUS is not set +# CONFIG_PRPMC750 is not set +# CONFIG_PAL4 is not set +# CONFIG_GEMINI is not set +CONFIG_GEN550=y +CONFIG_MPC10X_STORE_GATHERING=y +# CONFIG_EPIC_SERIAL_MODE is not set +# CONFIG_LAN is not set +# CONFIG_HLAN is not set +# CONFIG_KUROBOX is not set +# CONFIG_HGLAN is not set +CONFIG_KUROBOXHG=y +# CONFIG_HTGL is not set +# CONFIG_SMP is not set +# CONFIG_ALTIVEC is not set +# CONFIG_TAU is not set +CONFIG_PPC_ISATIMER=y + +# +# General setup +# +# CONFIG_HIGHMEM is not set +CONFIG_HIGHMEM_START=0xfe000000 +CONFIG_LOWMEM_SIZE=0x30000000 +CONFIG_KERNEL_START=0xc0000000 +CONFIG_TASK_SIZE=0x80000000 +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_SBUS is not set +# CONFIG_MCA is not set +CONFIG_PCI=y +CONFIG_NET=y +CONFIG_SYSCTL=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_KCORE_ELF=y +CONFIG_BINFMT_ELF=y +CONFIG_KERNEL_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_OOM_KILLER is not set +# CONFIG_PCI_NAMES is not set +CONFIG_HOTPLUG=y + +# +# PCMCIA/CardBus support +# +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set +# CONFIG_GEN_RTC is not set +# CONFIG_PPC_RTC is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="root=/dev/hda1" + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +CONFIG_PNP=m +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set +# CONFIG_CISS_MONITOR_THREAD is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_LOOP=m +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=15000 +CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_STATS=y + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_IPX is not set +CONFIG_ATALK=y + +# +# Appletalk devices +# +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_DELKIN is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_IDEPCI_SHARE_IRQ is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set +# CONFIG_IDEDMA_PCI_AUTO is not set +# CONFIG_IDEDMA_ONLYDISK is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_BLK_DEV_ADMA100 is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_AMD74XX_OVERRIDE is not set +# CONFIG_BLK_DEV_ATIIXP is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_PDC202XX_BURST is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_SVWKS is not set +CONFIG_BLK_DEV_SIIMAGE=y +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_BLK_DEV_SL82C105 is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_IDEDMA_IVB is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set +# CONFIG_BLK_DEV_ATARAID_SII is not set + +# +# SCSI support +# +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +CONFIG_CHR_DEV_SG=y +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_MEGARAID2 is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_SATA_AHCI is not set +# CONFIG_SCSI_SATA_SVW is not set +# CONFIG_SCSI_ATA_PIIX is not set +# CONFIG_SCSI_SATA_NV is not set +# CONFIG_SCSI_SATA_QSTOR is not set +# CONFIG_SCSI_SATA_PROMISE is not set +# CONFIG_SCSI_SATA_SX4 is not set +# CONFIG_SCSI_SATA_SIL is not set +# CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set +# CONFIG_SCSI_SATA_VIA is not set +# CONFIG_SCSI_SATA_VITESSE is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +CONFIG_R8169=y +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Old CD-ROM drivers (not SCSI, not IDE) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Console drivers +# +# CONFIG_VGA_CONSOLE is not set + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_UINPUT is not set + +# +# Macintosh device drivers +# + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +CONFIG_I2C=y +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_ALGOPCF is not set +CONFIG_I2C_ALGO_8245=y +CONFIG_I2C_MPC8245=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_PROC=y + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set +# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_IPMI_PANIC_EVENT is not set +# CONFIG_IPMI_DEVICE_INTERFACE is not set +# CONFIG_IPMI_KCS is not set +# CONFIG_IPMI_WATCHDOG is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_SCx200 is not set +# CONFIG_SCx200_GPIO is not set +# CONFIG_AMD_PM768 is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_RS5C372_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set + +# +# Direct Rendering Manager (XFree86 DRI support) +# +# CONFIG_DRM is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_QFMT_V2 is not set +# CONFIG_AUTOFS_FS is not set +CONFIG_AUTOFS4_FS=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +CONFIG_HFS_FS=m +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BEFS_DEBUG is not set +# CONFIG_BFS_FS is not set +CONFIG_EXT3_FS=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FAT_FS=m +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=m +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +CONFIG_RAMFS=y +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +CONFIG_UDF_FS=m +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_FS=m +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_TRACE is not set +# CONFIG_XFS_DEBUG is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +CONFIG_NFSD_TCP=y +CONFIG_SUNRPC=m +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_SMB_UNIX=y +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_SMB_NLS=y +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=y +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m + +# +# Sound +# +CONFIG_SOUND=m +# CONFIG_SOUND_ALI5455 is not set +# CONFIG_SOUND_BT878 is not set +# CONFIG_SOUND_CMPCI is not set +# CONFIG_SOUND_EMU10K1 is not set +# CONFIG_MIDI_EMU10K1 is not set +# CONFIG_SOUND_FUSION is not set +# CONFIG_SOUND_CS4281 is not set +# CONFIG_SOUND_ES1370 is not set +# CONFIG_SOUND_ES1371 is not set +# CONFIG_SOUND_ESSSOLO1 is not set +# CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_FORTE is not set +# CONFIG_SOUND_ICH is not set +# CONFIG_SOUND_RME96XX is not set +# CONFIG_SOUND_SONICVIBES is not set +# CONFIG_SOUND_TRIDENT is not set +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_VIA82CXXX is not set +# CONFIG_MIDI_VIA82CXXX is not set +CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +# CONFIG_SOUND_DMAP is not set +# CONFIG_SOUND_AD1816 is not set +# CONFIG_SOUND_AD1889 is not set +# CONFIG_SOUND_SGALAXY is not set +# CONFIG_SOUND_ADLIB is not set +# CONFIG_SOUND_ACI_MIXER is not set +# CONFIG_SOUND_CS4232 is not set +# CONFIG_SOUND_SSCAPE is not set +# CONFIG_SOUND_GUS is not set +# CONFIG_SOUND_VMIDI is not set +# CONFIG_SOUND_TRIX is not set +# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_MPU401 is not set +# CONFIG_SOUND_NM256 is not set +# CONFIG_SOUND_MAD16 is not set +# CONFIG_SOUND_PAS is not set +# CONFIG_PAS_JOYSTICK is not set +# CONFIG_SOUND_PSS is not set +# CONFIG_SOUND_SB is not set +# CONFIG_SOUND_AWE32_SYNTH is not set +# CONFIG_SOUND_KAHLUA is not set +# CONFIG_SOUND_WAVEFRONT is not set +# CONFIG_SOUND_MAUI is not set +# CONFIG_SOUND_YM3812 is not set +# CONFIG_SOUND_OPL3SA1 is not set +# CONFIG_SOUND_OPL3SA2 is not set +# CONFIG_SOUND_YMFPCI is not set +# CONFIG_SOUND_YMFPCI_LEGACY is not set +# CONFIG_SOUND_UART6850 is not set +# CONFIG_SOUND_AEDSP16 is not set +# CONFIG_SOUND_TVMIXER is not set +# CONFIG_SOUND_AD1980 is not set +# CONFIG_SOUND_WM97XX is not set + +# +# USB support +# +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_BANDWIDTH is not set +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +CONFIG_USB_OHCI=y +CONFIG_USB_AUDIO=m +CONFIG_USB_EMI26=m +CONFIG_USB_MIDI=m +CONFIG_USB_STORAGE=y +CONFIG_USB_STORAGE_DEBUG=y +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_HP8200e=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +# CONFIG_USB_ACM is not set +CONFIG_USB_PRINTER=y +CONFIG_USB_HID=m +# CONFIG_USB_HIDINPUT is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_KBD is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +# CONFIG_USB_SERIAL_DEBUG is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_TIGL is not set +# CONFIG_USB_BRLVGER is not set +# CONFIG_USB_LCD is not set + +# +# Support for USB gadgets +# +# CONFIG_USB_GADGET is not set + +# +# Bluetooth support +# +CONFIG_BLUEZ=m +# CONFIG_BLUEZ_L2CAP is not set +# CONFIG_BLUEZ_SCO is not set +# CONFIG_BLUEZ_RFCOMM is not set +# CONFIG_BLUEZ_BNEP is not set + +# +# Bluetooth device drivers +# +CONFIG_BLUEZ_HCIUSB=m +# CONFIG_BLUEZ_HCIUSB_SCO is not set +# CONFIG_BLUEZ_HCIUART is not set +CONFIG_BLUEZ_HCIBFUSB=m +# CONFIG_BLUEZ_HCIDTL1 is not set +# CONFIG_BLUEZ_HCIBT3C is not set +# CONFIG_BLUEZ_HCIBLUECARD is not set +# CONFIG_BLUEZ_HCIBTUART is not set +# CONFIG_BLUEZ_HCIVHCI is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +# CONFIG_CRC32 is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +# CONFIG_FW_LOADER is not set + +# +# Kernel hacking +# +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_SERIAL_TEXT_DEBUG is not set +CONFIG_LOG_BUF_SHIFT=0 diff -ruN linux-2.4.31/arch/ppc/kernel/Makefile linux-2.4.31_linkstation/arch/ppc/kernel/Makefile --- linux-2.4.31/arch/ppc/kernel/Makefile 2004-04-14 09:05:27.000000000 -0400 +++ linux-2.4.31_linkstation/arch/ppc/kernel/Makefile 2005-09-05 19:44:05.000000000 -0400 @@ -88,6 +88,9 @@ pplus_common.o obj-$(CONFIG_SANDPOINT) += i8259.o open_pic.o mpc10x_common.o \ pci_auto.o indirect_pci.o todc_time.o +# __LS_COMMENT__ BUFFALO change 2004.8.28 +obj-$(CONFIG_LINKSTATION) += open_pic.o mpc10x_common.o \ + pci_auto.o indirect_pci.o obj-$(CONFIG_SPRUCE) += indirect_pci.o pci_auto.o todc_time.o obj-$(CONFIG_8260) += m8260_setup.o cpm2_pic.o obj-$(CONFIG_BOOTX_TEXT) += btext.o diff -ruN linux-2.4.31/arch/ppc/kernel/mpc10x_common.c linux-2.4.31_linkstation/arch/ppc/kernel/mpc10x_common.c --- linux-2.4.31/arch/ppc/kernel/mpc10x_common.c 2003-08-25 07:44:40.000000000 -0400 +++ linux-2.4.31_linkstation/arch/ppc/kernel/mpc10x_common.c 2005-08-13 14:30:32.000000000 -0400 @@ -247,6 +247,53 @@ mpc10x_disable_store_gathering(hose); #endif + /* + * 8240 erratum 26, 8241/8245 erratum 29, 107 erratum 23: speculative + * PCI reads may return stale data so turn off. + */ + if ((host_bridge == MPC10X_BRIDGE_8240) + || (host_bridge == MPC10X_BRIDGE_8245) + || (host_bridge == MPC10X_BRIDGE_107)) { + + early_read_config_dword(hose, + 0, + PCI_DEVFN(0,0), + MPC10X_CFG_PICR1_REG, + &picr1); + + picr1 &= ~MPC10X_CFG_PICR1_SPEC_PCI_RD; + + early_write_config_dword(hose, + 0, + PCI_DEVFN(0,0), + MPC10X_CFG_PICR1_REG, + picr1); + } + + /* + * 8241/8245 erratum 28: PCI reads from local memory may return + * stale data. Workaround by setting PICR2[0] to disable copyback + * optimization. Oddly, the latest available user manual for the + * 8245 (Rev 2., dated 10/2003) says PICR2[0] is reserverd. + */ + if (host_bridge == MPC10X_BRIDGE_8245) { + ulong picr2; + + early_read_config_dword(hose, + 0, + PCI_DEVFN(0,0), + MPC10X_CFG_PICR2_REG, + &picr2); + + picr2 |= MPC10X_CFG_PICR2_COPYBACK_OPT; + + early_write_config_dword(hose, + 0, + PCI_DEVFN(0,0), + MPC10X_CFG_PICR2_REG, + picr2); + } + if (ppc_md.progress) ppc_md.progress("mpc10x:exit", 0x100); return 0; } diff -ruN linux-2.4.31/arch/ppc/mm/init.c linux-2.4.31_linkstation/arch/ppc/mm/init.c --- linux-2.4.31/arch/ppc/mm/init.c 2003-11-28 13:26:19.000000000 -0500 +++ linux-2.4.31_linkstation/arch/ppc/mm/init.c 2005-08-08 21:21:30.000000000 -0400 @@ -353,7 +353,9 @@ #ifdef CONFIG_HIGHMEM ioremap_base = PKMAP_BASE; #else - ioremap_base = 0xfe000000UL; /* for now, could be 0xfffff000 */ +// __LS_COMMNET__ BUFFALO change 2004.8.31 EUMB +// ioremap_base = 0xfe000000UL; /* for now, could be 0xfffff000 */ + ioremap_base = 0x80100000UL; /* for now, could be 0xfffff000 */ #endif /* CONFIG_HIGHMEM */ ioremap_bot = ioremap_base; diff -ruN linux-2.4.31/arch/ppc/platforms/Makefile linux-2.4.31_linkstation/arch/ppc/platforms/Makefile --- linux-2.4.31/arch/ppc/platforms/Makefile 2004-08-07 19:26:04.000000000 -0400 +++ linux-2.4.31_linkstation/arch/ppc/platforms/Makefile 2006-01-01 19:39:17.000000000 -0500 @@ -58,6 +58,7 @@ obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o obj-$(CONFIG_PRPMC750) += prpmc750.o obj-$(CONFIG_SANDPOINT) += sandpoint.o +obj-$(CONFIG_LINKSTATION) += linkstation.o linkstation_hwctl.o obj-$(CONFIG_SPRUCE) += spruce_setup.o spruce_pci.o cpc700_pic.o ifeq ($(CONFIG_SMP),y) diff -ruN linux-2.4.31/arch/ppc/platforms/linkstation.c linux-2.4.31_linkstation/arch/ppc/platforms/linkstation.c --- linux-2.4.31/arch/ppc/platforms/linkstation.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/arch/ppc/platforms/linkstation.c 2006-01-01 19:40:21.000000000 -0500 @@ -0,0 +1,748 @@ +/* + * arch/ppc/platforms/linkstation.c + * Based on sandpoint.c + * + * Author: Mark A. Greer + * mgreer@mvista.com + * + * Copyright 2000-2002 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "linkstation_serial.h" + +#define BUFFALO_DBG + +// __LS_COMMENT__ BUFFALO add 2004.8.27 +#include "buffalo/linkstation_hwctl.h" + +#define BOTTOM_BLOCK 0x02 + +extern void gen550_progress(char *, unsigned short); +extern void gen550_init(int, struct serial_struct *); + +extern struct serial_state rs_table[]; + +unsigned char __res[sizeof(bd_t)]; + +static void linkstation_halt(void); + +static int linkstation_panic_handler(struct notifier_block *this, + unsigned long event, + void *unused); + +// 2005.5.17 : BUFFALO +int IsUseRevClock=0; + +/* + * Define all of the IRQ senses and polarities. Taken from the + * Sandpoint X3 User's manual. + */ +static u_char linkstation_openpic_initsenses[] __initdata = { + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* EPIC IRQ 0 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* EPIC IRQ 1 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* EPIC IRQ 2 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* EPIC IRQ 3 */ + (IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE) /* EPIC IRQ 4 */ +}; + +static struct notifier_block linkstation_panic_notifier = { + linkstation_panic_handler, + NULL, + 150 /* priority: INT_MAX >= x >= 0 */ +}; + +/* + * Buffalo linkstation interrupt routing. + */ +static inline int +linkstation_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) +{ + static char pci_irq_table[][4] = + /* + * PCI IDSEL/INTPIN->INTLINE + * A B C D + */ + { +// __LS_COMMENT__ BUFFALO change 2004.8.27 PCIIRQ + { 16, 17, 18, 19 }, /* IDSEL 11 - IRQ0 LAN Controller */ + { 17, 18, 19, 16 }, /* IDSEL 12 - IRQ1 IDE Controller1 */ + { 20, 16, 17, 18 }, /* IDSEL 13 - IRQ4 IDE Controllert2 */ + { 19, 19, 19, 19 }, /* IDSEL 14 - IRQ3 USB2.0 Controller */ + { 18, 19, 16, 17 }, /* -------- - IRQ2 FAN Controller */ + }; + + const long min_idsel = 11, max_idsel = 15, irqs_per_slot = 4; + return PCI_IRQ_TABLE_LOOKUP; +} + +void __init +linkstation_find_bridges(void) +{ + struct pci_controller *hose; + + hose = pcibios_alloc_controller(); + + if (!hose) + return; + + hose->first_busno = 0; + hose->last_busno = 0xff; + + if (mpc10x_bridge_init(hose, + MPC10X_MEM_MAP_B, + MPC10X_MEM_MAP_B, + MPC10X_MAPB_EUMB_BASE) == 0) { + + hose->last_busno = pciauto_bus_scan(hose, hose->first_busno); + + ppc_md.pcibios_fixup = NULL; + ppc_md.pcibios_fixup_bus = NULL; + ppc_md.pci_swizzle = common_swizzle; + ppc_md.pci_map_irq = linkstation_map_irq; + } + else { + if (ppc_md.progress) + ppc_md.progress("Bridge init failed", 0x100); + printk("Host bridge init failed\n"); + } + + return; +} + +#ifdef CONFIG_SERIAL +static void __init +linkstation_early_serial_map(void) +{ + struct serial_struct serial_req; + + /* Setup serial port access */ + memset(&serial_req, 0, sizeof(serial_req)); + serial_req.baud_base = BASE_BAUD; + serial_req.line = 0; + serial_req.port = 0; + serial_req.irq = 26; + serial_req.flags = STD_COM_FLAGS; + serial_req.io_type = SERIAL_IO_MEM; + serial_req.iomem_base = (u_char *)LINKSTATION_SERIAL_1; + serial_req.iomem_reg_shift = 0; + + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + gen550_init(0, &serial_req); +#endif + + if (early_serial_setup(&serial_req) != 0) + printk("Early serial init of port 0 failed\n"); + + /* Assume early_serial_setup() doesn't modify serial_req */ + serial_req.line = 1; + serial_req.port = 1; + serial_req.irq = 25; /* XXXX */ + serial_req.iomem_base = (u_char *)LINKSTATION_SERIAL_0; + + +} +#endif +static void __init +linkstation_setup_arch(void) +{ + loops_per_jiffy = 100000000 / HZ; + +#ifdef CONFIG_BLK_DEV_INITRD + if (initrd_start) + ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); + else +#endif +#ifdef CONFIG_ROOT_NFS + ROOT_DEV = to_kdev_t(0x00FF); /* /dev/nfs pseudo device */ +#else + ROOT_DEV = to_kdev_t(0x0301); /* /dev/hda1 IDE disk */ +#endif + + /* Lookup PCI host bridges */ + linkstation_find_bridges(); + +#ifdef CONFIG_SERIAL + linkstation_early_serial_map(); +#endif + +#ifdef CONFIG_DUMMY_CONSOLE + conswitchp = &dummy_con; +#endif + + + printk(KERN_INFO "BUFFALO Network Attached Storage Series\n"); + printk(KERN_INFO "(C) 2002-2005 BUFFALO INC.\n"); + + /* DINK32 12.3 and below do not correctly enable any caches. + * We will do this now with good known values. Future versions + * of DINK32 are supposed to get this correct. + */ + if (cur_cpu_spec[0]->cpu_features & CPU_FTR_SPEC7450) + /* 745x is different. We only want to pass along enable. */ + _set_L2CR(L2CR_L2E); + else if (cur_cpu_spec[0]->cpu_features & CPU_FTR_L2CR) + /* All modules have 1MB of L2. We also assume that an + * L2 divisor of 3 will work. + */ + _set_L2CR(L2CR_L2E | L2CR_L2SIZ_1MB | L2CR_L2CLK_DIV3 + | L2CR_L2RAM_PIPE | L2CR_L2OH_1_0 | L2CR_L2DF); +} + +/* + * Interrupt setup and service. + */ +static void __init +linkstation_init_IRQ(void) +{ + OpenPIC_InitSenses = linkstation_openpic_initsenses; + OpenPIC_NumInitSenses = sizeof(linkstation_openpic_initsenses); + + /* + * We need to tell openpic_set_sources where things actually are. + * mpc10x_common will setup OpenPIC_Addr at ioremap(EUMB phys base + + * EPIC offset (0x40000)); The EPIC IRQ Register Address Map - + * Interrupt Source Configuration Registers gives these numbers + * as offsets starting at 0x50200, we need to adjust occordinly. + */ + + /* Map serial interrupt 0 */ + openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200); + /* Map serial interrupts 2-5 */ + openpic_set_sources(5, 3, OpenPIC_Addr + 0x11040); + /* Skip reserved space and map Message Unit Interrupt (I2O) */ + openpic_set_sources(8, 1, OpenPIC_Addr + 0x110C0); + /* Map Internal Duart Ch 1 and Ch 2 */ + openpic_set_sources(9, 2, OpenPIC_Addr + 0x11120); + + openpic_init(NUM_8259_INTERRUPTS); +} + +/* + */ +static int +linkstation_get_irq(struct pt_regs *regs) +{ + int irq; + + irq = openpic_irq(); + + if (irq == OPENPIC_VEC_SPURIOUS + 16) + irq = -1; + + return irq; +} + +static u32 +linkstation_irq_cannonicalize(u32 irq) +{ + if (irq == 2) + return 9; + else + return irq; +} + +static unsigned long __init +linkstation_find_end_of_memory(void) +{ +#if defined(CONFIG_HGLAN) || defined(CONFIG_HTGL) || defined(CONFIG_KUROBOXHG) + return 128*1024*1024; +#elif defined(CONFIG_HLAN) || defined(CONFIG_LAN) || defined(CONFIG_KUROBOX) + return 64*1024*1024; +#else + return 128*1024*1024; +#endif + +} + +static void __init +linkstation_map_io(void) +{ + // PCI I/O, ROM area + io_block_mapping(0xfe000000, 0xfe000000, 0x02000000, _PAGE_IO); + // EUMB area + io_block_mapping(MPC10X_MAPB_EUMB_BASE, MPC10X_MAPB_EUMB_BASE, + MPC10X_EUMB_SIZE, _PAGE_IO); +} + +/* + * Due to mpc8241 X2 errata, the Port 92 will not work. + */ +static void +linkstation_restart(char *cmd) +{ + __cli(); + + /* Reset system via Port 92 */ + for(;;) /* Spin until reset happens */ + out_8((void *)AVR_PORT, 0x47); // send shutdown messages +} + +static void +linkstation_power_off(void) +{ + __cli(); + for(;;) /* No way to shut power off with software */ + out_8((void *)AVR_PORT, 0x47); // send shutdown messages + /* NOTREACHED */ +} + +static void +linkstation_halt(void) +{ + linkstation_power_off(); + /* NOTREACHED */ +} + +static int +linkstation_show_cpuinfo(struct seq_file *m) +{ + seq_printf(m, "vendor\t\t: Motorola SPS\n"); + seq_printf(m, "machine\t\t: MPC8241\n"); + return 0; +} + +void linkstation_calibrate_decr(void) +{ + ulong freq; + +#if defined(CONFIG_HGLAN) || defined(CONFIG_HTGL) || defined(CONFIG_KUROBOXHG) + const ulong rev_freq=32522240; /* {32.768MHz*(100% - 0.75%)} * 4 / 4 */ + freq=32768000; +#elif defined(CONFIG_HLAN) || defined(CONFIG_KUROBOX) + const ulong rev_freq=24391680; /* {24.576MHz*(100% - 0.75%)} * 3 / 4 */ + freq=24576000; +#else + #error "not defined" +#endif + + if (IsUseRevClock){ + freq = rev_freq; + } + + tb_ticks_per_jiffy = freq / HZ; + tb_to_us = mulhwu_scale_factor(freq, 1000000); + printk("decrementer frequency = %ld.%6ld MHz \n", freq / 1000000, freq % 1000000); + return; +} + +/* + * Set BAT 3 to map 0xf8000000 to end of physical memory space 1-to-1. + */ +static __inline__ void +linkstation_set_bat(void) +{ + unsigned long bat2u, bat2l; + unsigned long bat3u, bat3l; + + __asm__ __volatile__( + " lis %0,0x8000\n \ + ori %1,%0,0x002a\n \ + ori %0,%0,0x000e\n \ + mtspr 0x21c,%0\n \ + mtspr 0x21d,%1\n \ + isync\n \ + sync " + : "=r" (bat2u), "=r" (bat2l)); + __asm__ __volatile__( + " lis %0,0xf800\n \ + ori %1,%0,0x002a\n \ + ori %0,%0,0x0ffe\n \ + mtspr 0x21e,%0\n \ + mtspr 0x21f,%1\n \ + isync\n \ + sync " + : "=r" (bat3u), "=r" (bat3l)); + +} + +#define PARM_ADDR 0xfff70000 +//bootcode cmdline +void __init +parse_kernelparm(void) { + unsigned char *cmdparm = cmd_line; + unsigned char *addr; + unsigned int magic = 0, i; + const char emroot[]="root=/dev/ram0"; + const char revclock[]="revclock=1"; + + if (strstr(cmd_line, revclock)){ + // + IsUseRevClock = 1; + } + if (strstr(cmd_line, emroot)){ + // bootcoderam0 EM + printk("--- force EM mode\n"); + return; + } + + addr = (unsigned char *)PARM_ADDR; + + //printk("--- cmd=%s\n",cmd_line); + for (i = 0; i < 4; i++) { + magic += (unsigned int)*addr << (i*8); + addr++; + } + /* not found magic number */ + if (magic != 0x82410000) { + // 2005.3.31: new + /* compatibility fo 2.4.17 linkstation */ + if (magic != 0x4b4f4b4f){ // OKOK + strcpy(cmdparm, emroot); + printk("invalid magic: %08x\n", magic); + return; + } + } + + addr = (unsigned char *)PARM_ADDR + 0x10; + + for (;;) { + unsigned char tmp_parm[0x20], *parm = tmp_parm; + unsigned int terminate; + + terminate = 0; + memset(tmp_parm, (char)NULL, sizeof(tmp_parm)); + + /* read kernel parameter from flash */ + for (i = 0; i < 0x20; i++) { + if (i < 4) terminate += (unsigned int)*addr << (i*8); + tmp_parm[i] = *addr++; + } + + if (strncmp(tmp_parm, "bootparm", 8) == 0) { + parm += 9; + if (strncmp(parm, "root=/dev/ram0", 14) == 0) { + memcpy(cmdparm, parm, 14); + cmdparm += 14; + *cmdparm++ = ' '; + *cmdparm++ = '\0'; + } + else if (strncmp(parm, "root=/dev/hda1", 14) == 0) { + memcpy(cmdparm, parm, 14); + cmdparm += 14; + *cmdparm++ = ' '; + *cmdparm++ = '\0'; + } + else if (strncmp(parm, "root=/dev/md0", 13) == 0) { + memcpy(cmdparm, parm, 13); + cmdparm += 13; + *cmdparm++ = ' '; + *cmdparm++ = '\0'; + } + } + + if (terminate == 0xffffffff) + /* not written in flash */ + break; + } + + if (!strstr(cmd_line,"root=/dev/ram0")){ + // restore cmd_line from kernel arg if boot device is not initrd. + strcpy(cmd_line, CONFIG_CMDLINE); + } +#ifdef BUFFALO_DBG + printk("--- cmd=%s\n",cmd_line); +#endif +} + +void __init +platform_init(unsigned long r3, unsigned long r4, unsigned long r5, + unsigned long r6, unsigned long r7) +{ + parse_bootinfo(find_bootinfo()); + + /* ASSUMPTION: If both r3 (bd_t pointer) and r6 (cmdline pointer) + * are non-zero, then we should use the board info from the bd_t + * structure and the cmdline pointed to by r6 instead of the + * information from birecs, if any. Otherwise, use the information + * from birecs as discovered by the preceeding call to + * parse_bootinfo(). This rule should work with both PPCBoot, which + * uses a bd_t board info structure, and the kernel boot wrapper, + * which uses birecs. + */ + if (r6){ + printk("KERNELBASE=%x r6=%x r7=%x\n",KERNELBASE,r6,r7); + *(char *)(r7+KERNELBASE) = 0; + strcpy(cmd_line, (char *)(r6+KERNELBASE)); + printk("cmd_line=%s\n",cmd_line); + } + +#ifdef CONFIG_BLK_DEV_INITRD + /* take care of initrd if we have one */ + if ( r4 ) + { + initrd_start = r4 + KERNELBASE; + initrd_end = r5 + KERNELBASE; + } +#endif /* CONFIG_BLK_DEV_INITRD */ + + /* Map in board regs, etc. */ + linkstation_set_bat(); + + parse_kernelparm(); + + notifier_chain_register(&panic_notifier_list, &linkstation_panic_notifier); + + isa_io_base = MPC10X_MAPB_ISA_IO_BASE; + isa_mem_base = MPC10X_MAPB_ISA_MEM_BASE; + pci_dram_offset = MPC10X_MAPB_DRAM_OFFSET; + ISA_DMA_THRESHOLD = 0x00ffffff; + DMA_MODE_READ = 0x44; + DMA_MODE_WRITE = 0x48; + + ppc_md.setup_arch = linkstation_setup_arch; + ppc_md.show_cpuinfo = linkstation_show_cpuinfo; + ppc_md.irq_cannonicalize = linkstation_irq_cannonicalize; + ppc_md.init_IRQ = linkstation_init_IRQ; + ppc_md.get_irq = linkstation_get_irq; + + ppc_md.restart = linkstation_restart; + ppc_md.power_off = linkstation_power_off; + ppc_md.halt = linkstation_halt; + + ppc_md.find_end_of_memory = linkstation_find_end_of_memory; + ppc_md.setup_io_mappings = linkstation_map_io; + + ppc_md.calibrate_decr = linkstation_calibrate_decr; + + ppc_md.time_init = NULL; + ppc_md.set_rtc_time = NULL; + ppc_md.get_rtc_time = NULL; + + ppc_md.nvram_read_val = NULL; + ppc_md.nvram_write_val = NULL; + +#ifdef CONFIG_SERIAL +#ifdef CONFIG_SERIAL_TEXT_DEBUG + ppc_md.progress = gen550_progress; +#endif + ppc_md.early_serial_map = linkstation_early_serial_map; +#endif + + return; +} + +// flash funtions -------------------- + +#define ATTACH_FLASH_ADDRESS 0xFFC00000 + +#define FLASH_CMDA(x) \ + *(volatile char*)(ATTACH_FLASH_ADDRESS + 0xaaa) = x; +#define FLASH_CMD5(x) \ + *(volatile char*)(ATTACH_FLASH_ADDRESS + 0x555) = x; +#define FLASH_START (volatile char*)(ATTACH_FLASH_ADDRESS) + +#define FLASH_COMMAND_CLEAR FLASH_CMDA(0xf0) +#define FLASH_COMMAND_READY FLASH_CMDA(0xaa);FLASH_CMD5(0x55) + +// erase funtion -------------------- +#define BIT(x) 1< 0) { + // erase + FLASH_COMMAND_CLEAR; + FLASH_COMMAND_READY; + FLASH_CMDA(0x80); + FLASH_COMMAND_READY; + *(baddr) = 0x30; + if (flash_state(baddr,0xff)) { + printk("Flash Erase fail?!\n"); + } + FLASH_COMMAND_CLEAR; + + // verify + caddr = baddr; + for (i=0;i 0) + printk("Flash Verify %d times\n", verify_count); + + for(i=0;i +#include +#include + +// output BYTE data +inline void out_b(volatile unsigned char *addr, int val) +{ + __asm__ __volatile__("stb%U0%X0 %1,%0; eieio" : "=m" (*addr) : "r" (val)); +} + +// PWR,DISK_FULL/STATUS,DIAG LED controll +void blink_led(unsigned char state) +{ +#ifdef CONFIG_HTGL + switch (state) + { + case FLASH_CLEAR_START: + case FLASH_UPDATE_START: + out_b(AVR_PORT, 0x61); + out_b(AVR_PORT, 0x61); + out_b(AVR_PORT, 0x38); + out_b(AVR_PORT, 0x30); + out_b(AVR_PORT, 0x34); + out_b(AVR_PORT, 0x31); + mdelay(10); + out_b(AVR_PORT, 0x61); + out_b(AVR_PORT, 0x61); + out_b(AVR_PORT, 0x38); + out_b(AVR_PORT, 0x31); + out_b(AVR_PORT, 0x34); + out_b(AVR_PORT, 0x31); + mdelay(10); + out_b(AVR_PORT, 0x71); + out_b(AVR_PORT, 0x71); +// out_b(AVR_PORT, 0x71); +// out_b(AVR_PORT, 0x71); + mdelay(10); + out_b(AVR_PORT, 0x73); + out_b(AVR_PORT, 0x73); +// out_b(AVR_PORT, 0x73); +// out_b(AVR_PORT, 0x73); + mdelay(10); + break; + case FLASH_CLEAR_END: + case FLASH_UPDATE_END: + out_b(AVR_PORT, 0x70); + out_b(AVR_PORT, 0x70); +// out_b(AVR_PORT, 0x70); +// out_b(AVR_PORT, 0x70); + mdelay(10); + out_b(AVR_PORT, 0x72); + out_b(AVR_PORT, 0x72); +// out_b(AVR_PORT, 0x72); +// out_b(AVR_PORT, 0x72); + mdelay(10); + break; + case RAID_RESYNC_START: + break; + case RAID_RESYNC_END: + break; + default: + out_b(AVR_PORT, state); + out_b(AVR_PORT, state); + out_b(AVR_PORT, state); + out_b(AVR_PORT, state); + break; + } +#else + out_b(AVR_PORT, state); + out_b(AVR_PORT, state); + out_b(AVR_PORT, state); + out_b(AVR_PORT, state); +#endif + +} + +// 2005.5.10 BUFFALO add +//-------------------------------------------------------------- +static inline void miconCntl_SendUart(unsigned char dat) +{ + out_b(AVR_PORT, dat); + mdelay(1); // + // wait +} + +//-------------------------------------------------------------- +static void miconCntl_SendCmd(unsigned char dat) +{ + int i; + + /* + static int ddd=0; + if (ddd++==0){ + printk("UDMB=%02x UFCR=%02x UMCR=%02x ULSR=%02x\n" + ,readb(0x80004500+1) + ,readb(0x80004500+2) + ,readb(0x80004500+4) + ,readb(0x80004500+5) + ); + printk("UMSR=%02x UDSR=%02x UDCR=%02x\n" + ,readb(0x80004500+6) + ,readb(0x80004500+10) + ,readb(0x80004500+11)); + } + */ + + for (i=0; i<4; i++){ + miconCntl_SendUart(dat); + } +} + +//-------------------------------------------------------------- +//FAN +void miconCntl_FanLow(void) +{ +#ifdef MICONMSG + printk(">%s\n",__FUNCTION__); +#endif +#ifdef CONFIG_HTGL + miconCntl_SendCmd(0x5C); +#endif +} +//-------------------------------------------------------------- +//FAN +void miconCntl_FanHigh(void) +{ +#ifdef MICONMSG + printk(">%s\n",__FUNCTION__); +#endif +#ifdef CONFIG_HTGL + miconCntl_SendCmd(0x5D); +#endif +} +//-------------------------------------------------------------- +//1000Mbps +void miconCntl_Eth1000M(int up) +{ +#ifdef MICONMSG + printk(">%s (%d)\n",__FUNCTION__,up); +#endif +#ifdef CONFIG_HTGL + if (up){ + miconCntl_SendCmd(0x93); + }else{ + miconCntl_SendCmd(0x92); + } +#else + if (up){ + miconCntl_SendCmd(0x5D); + }else{ + miconCntl_SendCmd(0x5C); + } +#endif +} +//-------------------------------------------------------------- +//100Mbps +void miconCntl_Eth100M(int up) +{ +#ifdef MICONMSG + printk(">%s (%d)\n",__FUNCTION__,up); +#endif +#ifdef CONFIG_HTGL + if (up){ + miconCntl_SendCmd(0x91); + }else{ + miconCntl_SendCmd(0x90); + } +#else + if (up){ + miconCntl_SendCmd(0x5C); + } +#endif +} +//-------------------------------------------------------------- +//10Mbps +void miconCntl_Eth10M(int up) +{ +#ifdef MICONMSG + printk(">%s (%d)\n",__FUNCTION__,up); +#endif +#ifdef CONFIG_HTGL + if (up){ + miconCntl_SendCmd(0x8F); + }else{ + miconCntl_SendCmd(0x8E); + } +#else + if (up){ + miconCntl_SendCmd(0x5C); + } +#endif +} +//-------------------------------------------------------------- +// +void miconCntl_5f(void) +{ +#ifdef MICONMSG + printk(">%s\n",__FUNCTION__); +#endif + miconCntl_SendCmd(0x5F); + mdelay(100); +} +//-------------------------------------------------------------- +// "reboot start" signal +void miconCntl_Rebooting(void) +{ +#ifdef MICONMSG + printk(">%s\n",__FUNCTION__); +#endif + miconCntl_SendCmd(0x43); +} +//-------------------------------------------------------------- +// "reboot start" signal +void miconCntl_RadiRecovery(void) +{ +#ifdef MICONMSG + printk(">%s\n",__FUNCTION__); +#endif +#ifdef CONFIG_HTGL + miconCntl_SendUart(0x61); // a + miconCntl_SendUart(0x61); // a + miconCntl_SendUart(0x38); // 8 + miconCntl_SendUart(0x30); // 0 + miconCntl_SendUart(0x34); // 4 + miconCntl_SendUart(0x31); // 1 + miconCntl_SendCmd(0x71); // q +#endif +} +//-------------------------------------------------------------- +// "reboot start" signal +void miconCntl_RadiRecoveryFin(void) +{ +#ifdef MICONMSG + printk(">%s\n",__FUNCTION__); +#endif +#ifdef CONFIG_HTGL + miconCntl_SendCmd(0x70); +#endif +} + + +// --------------------------------------------------------------- diff -ruN linux-2.4.31/arch/ppc/platforms/linkstation_serial.h linux-2.4.31_linkstation/arch/ppc/platforms/linkstation_serial.h --- linux-2.4.31/arch/ppc/platforms/linkstation_serial.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/arch/ppc/platforms/linkstation_serial.h 2006-01-01 20:16:18.000000000 -0500 @@ -0,0 +1,57 @@ +/* + * include/asm-ppc/sandpoint_serial.h + * + * Definitions for Motorola SPS Sandpoint Test Platform + * + * Author: Mark A. Greer + * mgreer@mvista.com + * + * Copyright 2001 MontaVista Software Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#ifndef __ASMPPC_LINKSTATION_SERIAL_H +#define __ASMPPC_LINKSTATION_SERIAL_H + +#include + +#define LINKSTATION_SERIAL_0 0x80004500 +#define LINKSTATION_SERIAL_1 0x80004600 + +#ifdef CONFIG_SERIAL_MANY_PORTS +#define RS_TABLE_SIZE 64 +#else +#define RS_TABLE_SIZE 2 +#endif + +/* Rate for the 1.8432 Mhz clock for the onboard serial chip */ +#if defined(CONFIG_HGLAN) || defined(CONFIG_HTGL) || defined(CONFIG_KUROBOXHG) +#define BASE_BAUD ( 133000000 / 16) +#elif defined(CONFIG_HLAN) || defined(CONFIG_LAN) || defined(CONFIG_KUROBOX) +#define BASE_BAUD ( 100000000 / 16) +#else +#define BASE_BAUD ( 1843200 / 16 ) +#endif + +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST) + +#define STD_SERIAL_PORT_DFNS \ + { 0, BASE_BAUD, LINKSTATION_SERIAL_1, 26, STD_COM_FLAGS,/* ttyS0 */ \ + type: PORT_16550A, \ + xmit_fifo_size: 16, \ + iomem_base: (u8 *)LINKSTATION_SERIAL_1, \ + io_type: SERIAL_IO_MEM }, \ + { 0, BASE_BAUD, LINKSTATION_SERIAL_0, 25, STD_COM_FLAGS,/* ttyS1 */ \ + type: PORT_16550A, \ + xmit_fifo_size: 16, \ + iomem_base: (u8 *)LINKSTATION_SERIAL_0, \ + io_type: SERIAL_IO_MEM }, + +#define SERIAL_PORT_DFNS \ + STD_SERIAL_PORT_DFNS + +#endif /* __ASMPPC_LINKSTATION_SERIAL_H */ diff -ruN linux-2.4.31/config_kurobox linux-2.4.31_linkstation/config_kurobox --- linux-2.4.31/config_kurobox 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/config_kurobox 2006-01-01 19:33:19.000000000 -0500 @@ -0,0 +1,907 @@ +# +# Automatically generated by make menuconfig: don't edit +# +# CONFIG_UID16 is not set +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_HAVE_DEC_LOCK=y +CONFIG_GENERIC_ISA_DMA=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +# CONFIG_ADVANCED_OPTIONS is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODVERSIONS=y +CONFIG_KMOD=y + +# +# Platform support +# +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_6xx=y +# CONFIG_40x is not set +# CONFIG_44x is not set +# CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set +# CONFIG_8xx is not set +# CONFIG_8260 is not set +CONFIG_PPC_STD_MMU=y +# CONFIG_ALL_PPC is not set +# CONFIG_APUS is not set +# CONFIG_SPRUCE is not set +# CONFIG_LOPEC is not set +# CONFIG_SANDPOINT is not set +CONFIG_LINKSTATION=y +# CONFIG_PPLUS is not set +# CONFIG_PRPMC750 is not set +# CONFIG_PAL4 is not set +# CONFIG_GEMINI is not set +CONFIG_GEN550=y +CONFIG_MPC10X_STORE_GATHERING=y +# CONFIG_EPIC_SERIAL_MODE is not set +# CONFIG_LAN is not set +# CONFIG_HLAN is not set +CONFIG_KUROBOX=y +# CONFIG_HGLAN is not set +# CONFIG_KUROBOXHG is not set +# CONFIG_HTGL is not set +# CONFIG_SMP is not set +# CONFIG_ALTIVEC is not set +# CONFIG_TAU is not set +CONFIG_PPC_ISATIMER=y + +# +# General setup +# +# CONFIG_HIGHMEM is not set +CONFIG_HIGHMEM_START=0xfe000000 +CONFIG_LOWMEM_SIZE=0x30000000 +CONFIG_KERNEL_START=0xc0000000 +CONFIG_TASK_SIZE=0x80000000 +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_SBUS is not set +# CONFIG_MCA is not set +CONFIG_PCI=y +CONFIG_NET=y +CONFIG_SYSCTL=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_KCORE_ELF=y +CONFIG_BINFMT_ELF=y +CONFIG_KERNEL_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_OOM_KILLER is not set +# CONFIG_PCI_NAMES is not set +CONFIG_HOTPLUG=y + +# +# PCMCIA/CardBus support +# +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set +# CONFIG_GEN_RTC is not set +# CONFIG_PPC_RTC is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="root=/dev/hda1" + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +CONFIG_PNP=m +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set +# CONFIG_CISS_MONITOR_THREAD is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_LOOP=m +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=15000 +CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_STATS=y + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_IPX is not set +CONFIG_ATALK=y + +# +# Appletalk devices +# +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_DELKIN is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_IDEPCI_SHARE_IRQ is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set +# CONFIG_IDEDMA_PCI_AUTO is not set +# CONFIG_IDEDMA_ONLYDISK is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_BLK_DEV_ADMA100 is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_AMD74XX_OVERRIDE is not set +# CONFIG_BLK_DEV_ATIIXP is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_PDC202XX_BURST is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_SVWKS is not set +CONFIG_BLK_DEV_SIIMAGE=y +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_BLK_DEV_SL82C105 is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_IDEDMA_IVB is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set +# CONFIG_BLK_DEV_ATARAID_SII is not set + +# +# SCSI support +# +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +CONFIG_CHR_DEV_SG=y +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_MEGARAID2 is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_SATA_AHCI is not set +# CONFIG_SCSI_SATA_SVW is not set +# CONFIG_SCSI_ATA_PIIX is not set +# CONFIG_SCSI_SATA_NV is not set +# CONFIG_SCSI_SATA_QSTOR is not set +# CONFIG_SCSI_SATA_PROMISE is not set +# CONFIG_SCSI_SATA_SX4 is not set +# CONFIG_SCSI_SATA_SIL is not set +# CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set +# CONFIG_SCSI_SATA_VIA is not set +# CONFIG_SCSI_SATA_VITESSE is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +# CONFIG_MACE is not set +# CONFIG_BMAC is not set +# CONFIG_GMAC is not set +# CONFIG_SUNLANCE is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNBMAC is not set +# CONFIG_SUNQE is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_LANCE is not set +# CONFIG_NET_VENDOR_SMC is not set +# CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_HP100 is not set +# CONFIG_NET_ISA is not set +CONFIG_NET_PCI=y +# CONFIG_PCNET32 is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_APRICOT is not set +# CONFIG_B44 is not set +# CONFIG_CS89x0 is not set +CONFIG_TULIP=y +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_DE4X5 is not set +# CONFIG_DGRS is not set +# CONFIG_DM9102 is not set +# CONFIG_EEPRO100 is not set +# CONFIG_EEPRO100_PIO is not set +# CONFIG_E100 is not set +# CONFIG_LNE390 is not set +# CONFIG_FEALNX is not set +# CONFIG_NATSEMI is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_FORCEDETH is not set +# CONFIG_NE3210 is not set +# CONFIG_ES3210 is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_8139TOO_PIO is not set +# CONFIG_8139TOO_TUNE_TWISTER is not set +# CONFIG_8139TOO_8129 is not set +# CONFIG_8139_OLD_RX_RESET is not set +# CONFIG_SIS900 is not set +# CONFIG_EPIC100 is not set +# CONFIG_SUNDANCE is not set +# CONFIG_SUNDANCE_MMIO is not set +# CONFIG_TLAN is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_RHINE_MMIO is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_NET_POCKET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Old CD-ROM drivers (not SCSI, not IDE) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Console drivers +# +# CONFIG_VGA_CONSOLE is not set + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_UINPUT is not set + +# +# Macintosh device drivers +# + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +CONFIG_I2C=y +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_ALGOPCF is not set +CONFIG_I2C_ALGO_8245=y +CONFIG_I2C_MPC8245=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_PROC=y + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set +# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_IPMI_PANIC_EVENT is not set +# CONFIG_IPMI_DEVICE_INTERFACE is not set +# CONFIG_IPMI_KCS is not set +# CONFIG_IPMI_WATCHDOG is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_SCx200 is not set +# CONFIG_SCx200_GPIO is not set +# CONFIG_AMD_PM768 is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_RS5C372_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set + +# +# Direct Rendering Manager (XFree86 DRI support) +# +# CONFIG_DRM is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_QFMT_V2 is not set +# CONFIG_AUTOFS_FS is not set +CONFIG_AUTOFS4_FS=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +CONFIG_HFS_FS=m +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BEFS_DEBUG is not set +# CONFIG_BFS_FS is not set +CONFIG_EXT3_FS=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FAT_FS=m +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=m +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +CONFIG_RAMFS=y +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +CONFIG_UDF_FS=m +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_FS=m +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_TRACE is not set +# CONFIG_XFS_DEBUG is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +CONFIG_NFSD_TCP=y +CONFIG_SUNRPC=m +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_SMB_UNIX=y +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_SMB_NLS=y +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=y +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m + +# +# Sound +# +CONFIG_SOUND=m +# CONFIG_SOUND_ALI5455 is not set +# CONFIG_SOUND_BT878 is not set +# CONFIG_SOUND_CMPCI is not set +# CONFIG_SOUND_EMU10K1 is not set +# CONFIG_MIDI_EMU10K1 is not set +# CONFIG_SOUND_FUSION is not set +# CONFIG_SOUND_CS4281 is not set +# CONFIG_SOUND_ES1370 is not set +# CONFIG_SOUND_ES1371 is not set +# CONFIG_SOUND_ESSSOLO1 is not set +# CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_FORTE is not set +# CONFIG_SOUND_ICH is not set +# CONFIG_SOUND_RME96XX is not set +# CONFIG_SOUND_SONICVIBES is not set +# CONFIG_SOUND_TRIDENT is not set +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_VIA82CXXX is not set +# CONFIG_MIDI_VIA82CXXX is not set +CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +# CONFIG_SOUND_DMAP is not set +# CONFIG_SOUND_AD1816 is not set +# CONFIG_SOUND_AD1889 is not set +# CONFIG_SOUND_SGALAXY is not set +# CONFIG_SOUND_ADLIB is not set +# CONFIG_SOUND_ACI_MIXER is not set +# CONFIG_SOUND_CS4232 is not set +# CONFIG_SOUND_SSCAPE is not set +# CONFIG_SOUND_GUS is not set +# CONFIG_SOUND_VMIDI is not set +# CONFIG_SOUND_TRIX is not set +# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_MPU401 is not set +# CONFIG_SOUND_NM256 is not set +# CONFIG_SOUND_MAD16 is not set +# CONFIG_SOUND_PAS is not set +# CONFIG_PAS_JOYSTICK is not set +# CONFIG_SOUND_PSS is not set +# CONFIG_SOUND_SB is not set +# CONFIG_SOUND_AWE32_SYNTH is not set +# CONFIG_SOUND_KAHLUA is not set +# CONFIG_SOUND_WAVEFRONT is not set +# CONFIG_SOUND_MAUI is not set +# CONFIG_SOUND_YM3812 is not set +# CONFIG_SOUND_OPL3SA1 is not set +# CONFIG_SOUND_OPL3SA2 is not set +# CONFIG_SOUND_YMFPCI is not set +# CONFIG_SOUND_YMFPCI_LEGACY is not set +# CONFIG_SOUND_UART6850 is not set +# CONFIG_SOUND_AEDSP16 is not set +# CONFIG_SOUND_TVMIXER is not set +# CONFIG_SOUND_AD1980 is not set +# CONFIG_SOUND_WM97XX is not set + +# +# USB support +# +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_BANDWIDTH is not set +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +CONFIG_USB_OHCI=y +CONFIG_USB_AUDIO=m +CONFIG_USB_EMI26=m +CONFIG_USB_MIDI=m +CONFIG_USB_STORAGE=y +CONFIG_USB_STORAGE_DEBUG=y +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_HP8200e=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +# CONFIG_USB_ACM is not set +CONFIG_USB_PRINTER=y +CONFIG_USB_HID=m +# CONFIG_USB_HIDINPUT is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_KBD is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +# CONFIG_USB_SERIAL_DEBUG is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_TIGL is not set +# CONFIG_USB_BRLVGER is not set +# CONFIG_USB_LCD is not set + +# +# Support for USB gadgets +# +# CONFIG_USB_GADGET is not set + +# +# Bluetooth support +# +CONFIG_BLUEZ=m +# CONFIG_BLUEZ_L2CAP is not set +# CONFIG_BLUEZ_SCO is not set +# CONFIG_BLUEZ_RFCOMM is not set +# CONFIG_BLUEZ_BNEP is not set + +# +# Bluetooth device drivers +# +CONFIG_BLUEZ_HCIUSB=m +# CONFIG_BLUEZ_HCIUSB_SCO is not set +# CONFIG_BLUEZ_HCIUART is not set +CONFIG_BLUEZ_HCIBFUSB=m +# CONFIG_BLUEZ_HCIDTL1 is not set +# CONFIG_BLUEZ_HCIBT3C is not set +# CONFIG_BLUEZ_HCIBLUECARD is not set +# CONFIG_BLUEZ_HCIBTUART is not set +# CONFIG_BLUEZ_HCIVHCI is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +# CONFIG_CRC32 is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +# CONFIG_FW_LOADER is not set + +# +# Kernel hacking +# +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_SERIAL_TEXT_DEBUG is not set +CONFIG_LOG_BUF_SHIFT=0 diff -ruN linux-2.4.31/config_kuroboxhg linux-2.4.31_linkstation/config_kuroboxhg --- linux-2.4.31/config_kuroboxhg 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/config_kuroboxhg 2006-01-01 19:34:18.000000000 -0500 @@ -0,0 +1,855 @@ +# +# Automatically generated by make menuconfig: don't edit +# +# CONFIG_UID16 is not set +# CONFIG_RWSEM_GENERIC_SPINLOCK is not set +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_HAVE_DEC_LOCK=y +CONFIG_GENERIC_ISA_DMA=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +# CONFIG_ADVANCED_OPTIONS is not set + +# +# Loadable module support +# +CONFIG_MODULES=y +CONFIG_MODVERSIONS=y +CONFIG_KMOD=y + +# +# Platform support +# +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_6xx=y +# CONFIG_40x is not set +# CONFIG_44x is not set +# CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set +# CONFIG_8xx is not set +# CONFIG_8260 is not set +CONFIG_PPC_STD_MMU=y +# CONFIG_ALL_PPC is not set +# CONFIG_APUS is not set +# CONFIG_SPRUCE is not set +# CONFIG_LOPEC is not set +# CONFIG_SANDPOINT is not set +CONFIG_LINKSTATION=y +# CONFIG_PPLUS is not set +# CONFIG_PRPMC750 is not set +# CONFIG_PAL4 is not set +# CONFIG_GEMINI is not set +CONFIG_GEN550=y +CONFIG_MPC10X_STORE_GATHERING=y +# CONFIG_EPIC_SERIAL_MODE is not set +# CONFIG_LAN is not set +# CONFIG_HLAN is not set +# CONFIG_KUROBOX is not set +# CONFIG_HGLAN is not set +CONFIG_KUROBOXHG=y +# CONFIG_HTGL is not set +# CONFIG_SMP is not set +# CONFIG_ALTIVEC is not set +# CONFIG_TAU is not set +CONFIG_PPC_ISATIMER=y + +# +# General setup +# +# CONFIG_HIGHMEM is not set +CONFIG_HIGHMEM_START=0xfe000000 +CONFIG_LOWMEM_SIZE=0x30000000 +CONFIG_KERNEL_START=0xc0000000 +CONFIG_TASK_SIZE=0x80000000 +# CONFIG_ISA is not set +# CONFIG_EISA is not set +# CONFIG_SBUS is not set +# CONFIG_MCA is not set +CONFIG_PCI=y +CONFIG_NET=y +CONFIG_SYSCTL=y +CONFIG_SYSVIPC=y +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_KCORE_ELF=y +CONFIG_BINFMT_ELF=y +CONFIG_KERNEL_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_OOM_KILLER is not set +# CONFIG_PCI_NAMES is not set +CONFIG_HOTPLUG=y + +# +# PCMCIA/CardBus support +# +# CONFIG_PCMCIA is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set +# CONFIG_GEN_RTC is not set +# CONFIG_PPC_RTC is not set +CONFIG_CMDLINE_BOOL=y +CONFIG_CMDLINE="root=/dev/hda1" + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Plug and Play configuration +# +CONFIG_PNP=m +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set +# CONFIG_CISS_MONITOR_THREAD is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_LOOP=m +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_SIZE=15000 +CONFIG_BLK_DEV_INITRD=y +CONFIG_BLK_STATS=y + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set +# CONFIG_BLK_DEV_MD is not set +# CONFIG_MD_LINEAR is not set +# CONFIG_MD_RAID0 is not set +# CONFIG_MD_RAID1 is not set +# CONFIG_MD_RAID5 is not set +# CONFIG_MD_MULTIPATH is not set +# CONFIG_BLK_DEV_LVM is not set + +# +# Networking options +# +CONFIG_PACKET=y +CONFIG_PACKET_MMAP=y +# CONFIG_NETLINK_DEV is not set +# CONFIG_NETFILTER is not set +# CONFIG_FILTER is not set +CONFIG_UNIX=y +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +# CONFIG_IP_PNP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_INET_ECN is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_IPV6 is not set +# CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_IPX is not set +CONFIG_ATALK=y + +# +# Appletalk devices +# +# CONFIG_DEV_APPLETALK is not set +# CONFIG_DECNET is not set +# CONFIG_BRIDGE is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_LLC is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_NET_FASTROUTE is not set +# CONFIG_NET_HW_FLOWCONTROL is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set + +# +# ATA/IDE/MFM/RLL support +# +CONFIG_IDE=y + +# +# IDE, ATA and ATAPI Block devices +# +CONFIG_BLK_DEV_IDE=y +# CONFIG_BLK_DEV_HD_IDE is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_IDEDISK=y +# CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_DELKIN is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDEFLOPPY is not set +# CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD640_ENHANCED is not set +# CONFIG_BLK_DEV_ISAPNP is not set +CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_IDEPCI_SHARE_IRQ is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set +# CONFIG_IDEDMA_PCI_AUTO is not set +# CONFIG_IDEDMA_ONLYDISK is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_BLK_DEV_ADMA100 is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_WDC_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_AMD74XX_OVERRIDE is not set +# CONFIG_BLK_DEV_ATIIXP is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_HPT34X_AUTODMA is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_PDC202XX_BURST is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_SVWKS is not set +CONFIG_BLK_DEV_SIIMAGE=y +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_BLK_DEV_SL82C105 is not set +# CONFIG_IDE_CHIPSETS is not set +# CONFIG_IDEDMA_AUTO is not set +# CONFIG_IDEDMA_IVB is not set +# CONFIG_DMA_NONPCI is not set +# CONFIG_BLK_DEV_ATARAID is not set +# CONFIG_BLK_DEV_ATARAID_PDC is not set +# CONFIG_BLK_DEV_ATARAID_HPT is not set +# CONFIG_BLK_DEV_ATARAID_MEDLEY is not set +# CONFIG_BLK_DEV_ATARAID_SII is not set + +# +# SCSI support +# +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_SD_EXTRA_DEVS=40 +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_BLK_DEV_SR is not set +CONFIG_CHR_DEV_SG=y +# CONFIG_SCSI_DEBUG_QUEUES is not set +# CONFIG_SCSI_MULTI_LUN is not set +CONFIG_SCSI_CONSTANTS=y +# CONFIG_SCSI_LOGGING is not set + +# +# SCSI low-level drivers +# +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AHA1740 is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_MEGARAID is not set +# CONFIG_SCSI_MEGARAID2 is not set +# CONFIG_SCSI_SATA is not set +# CONFIG_SCSI_SATA_AHCI is not set +# CONFIG_SCSI_SATA_SVW is not set +# CONFIG_SCSI_ATA_PIIX is not set +# CONFIG_SCSI_SATA_NV is not set +# CONFIG_SCSI_SATA_QSTOR is not set +# CONFIG_SCSI_SATA_PROMISE is not set +# CONFIG_SCSI_SATA_SX4 is not set +# CONFIG_SCSI_SATA_SIL is not set +# CONFIG_SCSI_SATA_SIS is not set +# CONFIG_SCSI_SATA_ULI is not set +# CONFIG_SCSI_SATA_VIA is not set +# CONFIG_SCSI_SATA_VITESSE is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CPQFCTS is not set +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_EATA_DMA is not set +# CONFIG_SCSI_EATA_PIO is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NCR53C7xx is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_NCR53C8XX is not set +# CONFIG_SCSI_SYM53C8XX is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PCI2000 is not set +# CONFIG_SCSI_PCI2220I is not set +# CONFIG_SCSI_PSI240I is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_QLOGIC_ISP is not set +# CONFIG_SCSI_QLOGIC_FC is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_SIM710 is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_DC390T is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_DEBUG is not set + +# +# IEEE 1394 (FireWire) support (EXPERIMENTAL) +# +# CONFIG_IEEE1394 is not set + +# +# Network device support +# +CONFIG_NETDEVICES=y + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_ETHERTAP is not set + +# +# Ethernet (10 or 100Mbit) +# +# CONFIG_NET_ETHERNET is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_MYRI_SBUS is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +CONFIG_R8169=y +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PLIP is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set +# CONFIG_NET_FC is not set +# CONFIG_RCPCI is not set +# CONFIG_SHAPER is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set + +# +# Amateur Radio support +# +# CONFIG_HAMRADIO is not set + +# +# IrDA (infrared) support +# +# CONFIG_IRDA is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Old CD-ROM drivers (not SCSI, not IDE) +# +# CONFIG_CD_NO_IDESCSI is not set + +# +# Console drivers +# +# CONFIG_VGA_CONSOLE is not set + +# +# Frame-buffer support +# +# CONFIG_FB is not set + +# +# Input core support +# +# CONFIG_INPUT is not set +# CONFIG_INPUT_KEYBDEV is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_UINPUT is not set + +# +# Macintosh device drivers +# + +# +# Character devices +# +# CONFIG_VT is not set +CONFIG_SERIAL=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 + +# +# I2C support +# +CONFIG_I2C=y +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_ALGOPCF is not set +CONFIG_I2C_ALGO_8245=y +CONFIG_I2C_MPC8245=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_PROC=y + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set +# CONFIG_QIC02_TAPE is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_IPMI_PANIC_EVENT is not set +# CONFIG_IPMI_DEVICE_INTERFACE is not set +# CONFIG_IPMI_KCS is not set +# CONFIG_IPMI_WATCHDOG is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_SCx200 is not set +# CONFIG_SCx200_GPIO is not set +# CONFIG_AMD_PM768 is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +CONFIG_RS5C372_RTC=y +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set + +# +# Direct Rendering Manager (XFree86 DRI support) +# +# CONFIG_DRM is not set + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_QFMT_V2 is not set +# CONFIG_AUTOFS_FS is not set +CONFIG_AUTOFS4_FS=y +CONFIG_REISERFS_FS=m +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +CONFIG_HFS_FS=m +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BEFS_DEBUG is not set +# CONFIG_BFS_FS is not set +CONFIG_EXT3_FS=y +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FAT_FS=m +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +CONFIG_VFAT_FS=m +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +CONFIG_TMPFS=y +CONFIG_RAMFS=y +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +# CONFIG_ZISOFS is not set +CONFIG_JFS_FS=m +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +CONFIG_NTFS_FS=m +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +CONFIG_DEVPTS_FS=y +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +# CONFIG_ROMFS_FS is not set +CONFIG_EXT2_FS=y +# CONFIG_SYSV_FS is not set +CONFIG_UDF_FS=m +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +CONFIG_XFS_FS=m +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_TRACE is not set +# CONFIG_XFS_DEBUG is not set + +# +# Network File Systems +# +# CONFIG_CODA_FS is not set +# CONFIG_INTERMEZZO_FS is not set +CONFIG_NFS_FS=m +CONFIG_NFS_V3=y +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_ROOT_NFS is not set +CONFIG_NFSD=m +CONFIG_NFSD_V3=y +CONFIG_NFSD_TCP=y +CONFIG_SUNRPC=m +CONFIG_LOCKD=m +CONFIG_LOCKD_V4=y +CONFIG_SMB_FS=m +CONFIG_SMB_NLS_DEFAULT=y +CONFIG_SMB_NLS_REMOTE="cp437" +CONFIG_SMB_UNIX=y +# CONFIG_NCP_FS is not set +# CONFIG_NCPFS_PACKET_SIGNING is not set +# CONFIG_NCPFS_IOCTL_LOCKING is not set +# CONFIG_NCPFS_STRONG is not set +# CONFIG_NCPFS_NFS_NS is not set +# CONFIG_NCPFS_OS2_NS is not set +# CONFIG_NCPFS_SMALLDOS is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_NCPFS_EXTRAS is not set +# CONFIG_ZISOFS_FS is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +CONFIG_SMB_NLS=y +CONFIG_NLS=y + +# +# Native Language Support +# +CONFIG_NLS_DEFAULT="utf8" +CONFIG_NLS_CODEPAGE_437=m +CONFIG_NLS_CODEPAGE_737=m +CONFIG_NLS_CODEPAGE_775=m +CONFIG_NLS_CODEPAGE_850=m +CONFIG_NLS_CODEPAGE_852=m +CONFIG_NLS_CODEPAGE_855=m +CONFIG_NLS_CODEPAGE_857=m +CONFIG_NLS_CODEPAGE_860=m +CONFIG_NLS_CODEPAGE_861=m +CONFIG_NLS_CODEPAGE_862=m +CONFIG_NLS_CODEPAGE_863=m +CONFIG_NLS_CODEPAGE_864=m +CONFIG_NLS_CODEPAGE_865=m +CONFIG_NLS_CODEPAGE_866=m +CONFIG_NLS_CODEPAGE_869=m +CONFIG_NLS_CODEPAGE_936=m +CONFIG_NLS_CODEPAGE_950=m +CONFIG_NLS_CODEPAGE_932=y +CONFIG_NLS_CODEPAGE_949=m +CONFIG_NLS_CODEPAGE_874=m +CONFIG_NLS_ISO8859_8=m +CONFIG_NLS_CODEPAGE_1250=m +CONFIG_NLS_CODEPAGE_1251=m +CONFIG_NLS_ISO8859_1=m +CONFIG_NLS_ISO8859_2=m +CONFIG_NLS_ISO8859_3=m +CONFIG_NLS_ISO8859_4=m +CONFIG_NLS_ISO8859_5=m +CONFIG_NLS_ISO8859_6=m +CONFIG_NLS_ISO8859_7=m +CONFIG_NLS_ISO8859_9=m +CONFIG_NLS_ISO8859_13=m +CONFIG_NLS_ISO8859_14=m +CONFIG_NLS_ISO8859_15=m +CONFIG_NLS_KOI8_R=m +CONFIG_NLS_KOI8_U=m +CONFIG_NLS_UTF8=m + +# +# Sound +# +CONFIG_SOUND=m +# CONFIG_SOUND_ALI5455 is not set +# CONFIG_SOUND_BT878 is not set +# CONFIG_SOUND_CMPCI is not set +# CONFIG_SOUND_EMU10K1 is not set +# CONFIG_MIDI_EMU10K1 is not set +# CONFIG_SOUND_FUSION is not set +# CONFIG_SOUND_CS4281 is not set +# CONFIG_SOUND_ES1370 is not set +# CONFIG_SOUND_ES1371 is not set +# CONFIG_SOUND_ESSSOLO1 is not set +# CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_FORTE is not set +# CONFIG_SOUND_ICH is not set +# CONFIG_SOUND_RME96XX is not set +# CONFIG_SOUND_SONICVIBES is not set +# CONFIG_SOUND_TRIDENT is not set +# CONFIG_SOUND_MSNDCLAS is not set +# CONFIG_SOUND_MSNDPIN is not set +# CONFIG_SOUND_VIA82CXXX is not set +# CONFIG_MIDI_VIA82CXXX is not set +CONFIG_SOUND_OSS=m +# CONFIG_SOUND_TRACEINIT is not set +# CONFIG_SOUND_DMAP is not set +# CONFIG_SOUND_AD1816 is not set +# CONFIG_SOUND_AD1889 is not set +# CONFIG_SOUND_SGALAXY is not set +# CONFIG_SOUND_ADLIB is not set +# CONFIG_SOUND_ACI_MIXER is not set +# CONFIG_SOUND_CS4232 is not set +# CONFIG_SOUND_SSCAPE is not set +# CONFIG_SOUND_GUS is not set +# CONFIG_SOUND_VMIDI is not set +# CONFIG_SOUND_TRIX is not set +# CONFIG_SOUND_MSS is not set +# CONFIG_SOUND_MPU401 is not set +# CONFIG_SOUND_NM256 is not set +# CONFIG_SOUND_MAD16 is not set +# CONFIG_SOUND_PAS is not set +# CONFIG_PAS_JOYSTICK is not set +# CONFIG_SOUND_PSS is not set +# CONFIG_SOUND_SB is not set +# CONFIG_SOUND_AWE32_SYNTH is not set +# CONFIG_SOUND_KAHLUA is not set +# CONFIG_SOUND_WAVEFRONT is not set +# CONFIG_SOUND_MAUI is not set +# CONFIG_SOUND_YM3812 is not set +# CONFIG_SOUND_OPL3SA1 is not set +# CONFIG_SOUND_OPL3SA2 is not set +# CONFIG_SOUND_YMFPCI is not set +# CONFIG_SOUND_YMFPCI_LEGACY is not set +# CONFIG_SOUND_UART6850 is not set +# CONFIG_SOUND_AEDSP16 is not set +# CONFIG_SOUND_TVMIXER is not set +# CONFIG_SOUND_AD1980 is not set +# CONFIG_SOUND_WM97XX is not set + +# +# USB support +# +CONFIG_USB=y +# CONFIG_USB_DEBUG is not set +CONFIG_USB_DEVICEFS=y +# CONFIG_USB_BANDWIDTH is not set +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_UHCI is not set +# CONFIG_USB_UHCI_ALT is not set +CONFIG_USB_OHCI=y +CONFIG_USB_AUDIO=m +CONFIG_USB_EMI26=m +CONFIG_USB_MIDI=m +CONFIG_USB_STORAGE=y +CONFIG_USB_STORAGE_DEBUG=y +CONFIG_USB_STORAGE_DATAFAB=y +CONFIG_USB_STORAGE_FREECOM=y +CONFIG_USB_STORAGE_ISD200=y +CONFIG_USB_STORAGE_DPCM=y +CONFIG_USB_STORAGE_HP8200e=y +CONFIG_USB_STORAGE_SDDR09=y +CONFIG_USB_STORAGE_SDDR55=y +CONFIG_USB_STORAGE_JUMPSHOT=y +# CONFIG_USB_ACM is not set +CONFIG_USB_PRINTER=y +CONFIG_USB_HID=m +# CONFIG_USB_HIDINPUT is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_KBD is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_AIPTEK is not set +# CONFIG_USB_WACOM is not set +# CONFIG_USB_KBTAB is not set +# CONFIG_USB_POWERMATE is not set +# CONFIG_USB_DC2XX is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_SCANNER is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_HPUSBSCSI is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDCETHER is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_USS720 is not set + +# +# USB Serial Converter support +# +CONFIG_USB_SERIAL=m +# CONFIG_USB_SERIAL_DEBUG is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +CONFIG_USB_SERIAL_PL2303=m +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_TIGL is not set +# CONFIG_USB_BRLVGER is not set +# CONFIG_USB_LCD is not set + +# +# Support for USB gadgets +# +# CONFIG_USB_GADGET is not set + +# +# Bluetooth support +# +CONFIG_BLUEZ=m +# CONFIG_BLUEZ_L2CAP is not set +# CONFIG_BLUEZ_SCO is not set +# CONFIG_BLUEZ_RFCOMM is not set +# CONFIG_BLUEZ_BNEP is not set + +# +# Bluetooth device drivers +# +CONFIG_BLUEZ_HCIUSB=m +# CONFIG_BLUEZ_HCIUSB_SCO is not set +# CONFIG_BLUEZ_HCIUART is not set +CONFIG_BLUEZ_HCIBFUSB=m +# CONFIG_BLUEZ_HCIDTL1 is not set +# CONFIG_BLUEZ_HCIBT3C is not set +# CONFIG_BLUEZ_HCIBLUECARD is not set +# CONFIG_BLUEZ_HCIBTUART is not set +# CONFIG_BLUEZ_HCIVHCI is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Library routines +# +# CONFIG_CRC32 is not set +CONFIG_ZLIB_INFLATE=m +CONFIG_ZLIB_DEFLATE=m +# CONFIG_FW_LOADER is not set + +# +# Kernel hacking +# +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_SERIAL_TEXT_DEBUG is not set +CONFIG_LOG_BUF_SHIFT=0 diff -ruN linux-2.4.31/drivers/char/Config.in linux-2.4.31_linkstation/drivers/char/Config.in --- linux-2.4.31/drivers/char/Config.in 2004-08-07 19:26:04.000000000 -0400 +++ linux-2.4.31_linkstation/drivers/char/Config.in 2005-09-05 22:45:32.000000000 -0400 @@ -325,6 +325,9 @@ if [ "$CONFIG_TOSHIBA_RBTX4927" = "y" -o "$CONFIG_TOSHIBA_JMR3927" = "y" ]; then tristate 'Dallas DS1742 RTC support' CONFIG_DS1742 fi +if [ "$CONFIG_I2C" = "y" ]; then + tristate 'I2C RS5C372 RTC support' CONFIG_RS5C372_RTC +fi tristate 'Double Talk PC internal speech card support' CONFIG_DTLK tristate 'Siemens R3964 line discipline' CONFIG_R3964 diff -ruN linux-2.4.31/drivers/char/Makefile linux-2.4.31_linkstation/drivers/char/Makefile --- linux-2.4.31/drivers/char/Makefile 2004-08-07 19:26:04.000000000 -0400 +++ linux-2.4.31_linkstation/drivers/char/Makefile 2005-09-05 22:46:03.000000000 -0400 @@ -254,6 +254,7 @@ obj-$(CONFIG_SGI_DS1286) += ds1286.o obj-$(CONFIG_MIPS_RTC) += mips_rtc.o obj-$(CONFIG_SGI_IP27_RTC) += ip27-rtc.o +obj-$(CONFIG_RS5C372_RTC) += rs5c372.o ifeq ($(CONFIG_PPC),) obj-$(CONFIG_NVRAM) += nvram.o endif diff -ruN linux-2.4.31/drivers/char/rs5c372.c linux-2.4.31_linkstation/drivers/char/rs5c372.c --- linux-2.4.31/drivers/char/rs5c372.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/drivers/char/rs5c372.c 2006-01-01 00:32:58.000000000 -0500 @@ -0,0 +1,458 @@ +/* + * rs5c372.c + * + * Device driver for Real Time Controller's rs5c372 chips + * + * Copyright (C) 2005 Pavel Mironchik pmironchik@optifacio.net + * + * This program 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. + * + * This driver is adapted from the m41st85w driver + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define RS5C372_DEBUG 0 + +#define RS5C372_I2C_SLAVE_ADDR 0x32 +#define RS5C372_RAM_ADDR_START 0x00 +#define RS5C372_RAM_ADDR_END 0x0F +#define RS5C372_RAM_SIZE 0x10 +#define I2C_DRIVERID_RS5C372 0xF6 + +#define RS5C372_GETDATETIME 0 +#define RS5C372_SETTIME 1 +#define RS5C372_SETDATETIME 2 + +#define RTC_SECONDS 0 +#define RTC_MINUTES 1 +#define RTC_HOURS 2 +#define RTC_WEEKDAYS 3 +#define RTC_DAYS 4 +#define RTC_MONTHS 5 +#define RTC_YEARS 6 +#define RTC_TIMETRIMM 7 + +// ALARM A registers +#define RTC_AM 8 +#define RTC_AH 9 +#define RTC_AW 10 + +// ALARM B registers +#define RTC_BM 11 +#define RTC_BH 12 +#define RTC_BW 13 + +// Control registers +#define RTC_CR1 14 +#define RTC_CR2 15 + + +#define BCD_TO_BIN(val) (((val)&15) + ((val)>>4)*10) +#define BIN_TO_BCD(val) ((((val)/10)<<4) + (val)%10) +#define HOURS_24(n) BCD_TO_BIN((n)&0x3F) + +extern void to_tm(int tim, struct rtc_time * tm); + +struct i2c_driver rs5c372_driver; +struct i2c_client *rs5c372_i2c_client = NULL; + +static int rs5c372_rtc_ioctl(struct inode *, struct file *, unsigned int, + unsigned long); +static int rs5c372_rtc_open(struct inode *inode, struct file *file); +static int rs5c372_rtc_release(struct inode *inode, struct file *file); +/*RTC related staff*/ +static unsigned long rs5c372_get_rtc_time(void); +static int rs5c372_set_rtc_time(unsigned long); + +static struct file_operations rtc_fops = { + owner:THIS_MODULE, + llseek:no_llseek, + ioctl:rs5c372_rtc_ioctl, + open:rs5c372_rtc_open, + release:rs5c372_rtc_release, +}; + + +static struct miscdevice rs5c372_dev = { + RTC_MINOR, + "rtc", + &rtc_fops +}; + +static int rs5c372_attach_adapter(struct i2c_adapter *adap); +static int rs5c372_detach(struct i2c_client *client); +static int rs5c372_command(struct i2c_client *client, unsigned int cmd, + void *arg); +struct i2c_driver rs5c372_driver = { + name:"rs5c372", + id:I2C_DRIVERID_RS5C372, + flags:I2C_DF_NOTIFY, + attach_adapter:rs5c372_attach_adapter, + detach_client:rs5c372_detach, + command:rs5c372_command +}; + +extern struct machdep_calls ppc_md; + + +/*Pointers to get/set time via rs5c372 chip to substitute undefined (yet) + fields in struct ppc_md. we'll save current pointers concerning RTC from + ppc_md and will restore them in cleanup_module + */ +static int (*old_set_rtc_time)(unsigned long nowtime); +static unsigned long (*old_get_rtc_time)(void); + +static DECLARE_MUTEX (mutex); + +static int rs5c372_read(char *buf, int len) +{ + struct i2c_msg msgs[1] = { + {rs5c372_i2c_client->addr, I2C_M_RD, len, buf} + }; + int ret; + + if (down_interruptible (&mutex)) + return (-ERESTARTSYS); + ret = i2c_transfer(rs5c372_i2c_client->adapter, msgs, 1); + up (&mutex); + return ret; +} + +static int rs5c372_write(char *buf, int len) +{ + // warning refer of the format of the first byte + // in rs5c372a-e datasheet + + struct i2c_msg msgs[1] = { + {rs5c372_i2c_client->addr, 0, len, buf} + }; + int ret; + + if (down_interruptible (&mutex)) + return (-ERESTARTSYS); + ret = i2c_transfer(rs5c372_i2c_client->adapter, msgs, 1); + up (&mutex); + return ret; +} + +static int rs5c372_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind) +{ + unsigned char buf[2]; + struct i2c_msg msgs[1] = { + {addr, 0, 2, buf} + }; + int ret = 0; + struct i2c_client *c; + + if (!(c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL))) { + return -ENOMEM; + } + + memset(c, 0, sizeof(struct i2c_client)); + strncpy(c->name, "rs5c372", 0x20); + + c->id = rs5c372_driver.id; + c->flags = I2C_CLIENT_ALLOW_USE | I2C_DF_NOTIFY; + c->addr = addr; + c->adapter = adap; + c->driver = &rs5c372_driver; + + ret = i2c_attach_client(c); + rs5c372_i2c_client = c; + + if (ret < 0) { + printk(KERN_ERR "rs5c372: Attach was not ok!\n"); + kfree(c); + } + else + { + /* set 24h time */ + buf[0] = 0xf0; + buf[1] = 0x20; + i2c_transfer(adap, msgs, 1); + /* accuracy correction */ + buf[0] = 0x70; +#if defined(CONFIG_HTGL) + buf[1] = 0x77; // -9 +#else + buf[1] = 0x15; +#endif + i2c_transfer(adap, msgs, 1); + old_get_rtc_time=ppc_md.get_rtc_time; + old_set_rtc_time=ppc_md.set_rtc_time; + + ppc_md.get_rtc_time=rs5c372_get_rtc_time; + ppc_md.set_rtc_time=rs5c372_set_rtc_time; + + time_t sec = rs5c372_get_rtc_time(); + xtime.tv_usec = 0; + if (sec > 0) + xtime.tv_sec = sec; + } + return ret; +} + +static int rs5c372_attach_adapter(struct i2c_adapter *adap) +{ + return rs5c372_attach(adap, RS5C372_I2C_SLAVE_ADDR, 0, 0); +} + +static int rs5c372_detach(struct i2c_client *client) +{ + if (client) { + /*restore old handlers */ + ppc_md.get_rtc_time=old_get_rtc_time; + ppc_md.set_rtc_time=old_set_rtc_time; + i2c_detach_client(client); + kfree(client); + client = rs5c372_i2c_client = NULL; + } + return 0; +} + + +static void rs5c372_convert_to_time(struct rtc_time *dt, char *buf) +{ + dt->tm_sec = BCD_TO_BIN(buf[1] & 0x7f); + dt->tm_min = BCD_TO_BIN(buf[2] & 0x7f); + + /* 24 hour mode only */ + dt->tm_hour = HOURS_24(buf[3]); + + dt->tm_wday = BCD_TO_BIN(buf[4] & 0x07); + dt->tm_mday = BCD_TO_BIN(buf[5] & 0x3f); + + /* dt->tm_mon is zero-based */ + dt->tm_mon = BCD_TO_BIN(buf[6] & 0x1f) - 1; + /* year is 1900 dt->tm_year */ + dt->tm_year = BCD_TO_BIN(buf[7]); + + if (dt->tm_year < 70) { + dt->tm_year += 100; + } + +#if RS5C372_DEBUG + printk("rs5c372_get_datetime: year = %d\n", dt->tm_year); + printk("rs5c372_get_datetime: mon = %d\n", dt->tm_mon); + printk("rs5c372_get_datetime: mday = %d\n", dt->tm_mday); + printk("rs5c372_get_datetime: hour = %d\n", dt->tm_hour); + printk("rs5c372_get_datetime: min = %d\n", dt->tm_min); + printk("rs5c372_get_datetime: sec = %d\n", dt->tm_sec); +#endif +} + +static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *dt) +{ + unsigned char buf[8]; + int ret = -EIO; + + ret = rs5c372_read(buf,8); + if (ret >= 0) { + rs5c372_convert_to_time(dt, buf); + ret = 0; + } else + printk("rs5c372_get_datetime(), i2c_transfer() returned %d\n", + ret); + return ret; +} + + +static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *dt,int datetoo) +{ + unsigned char buf[7]; + int ret, len = 4; + +#if RS5C372_DEBUG + printk("rs5c372_set_datetime: tm_year = %d\n", dt->tm_year); + printk("rs5c372_set_datetime: tm_mon = %d\n", dt->tm_mon); + printk("rs5c372_set_datetime: tm_mday = %d\n", dt->tm_mday); + printk("rs5c372_set_datetime: tm_hour = %d\n", dt->tm_hour); + printk("rs5c372_set_datetime: tm_min = %d\n", dt->tm_min); + printk("rs5c372_set_datetime: tm_sec = %d\n", dt->tm_sec); +#endif + + buf[0] = 0; + buf[1] = (BIN_TO_BCD(dt->tm_sec)); + buf[2] = (BIN_TO_BCD(dt->tm_min)); + buf[3] = (BIN_TO_BCD(dt->tm_hour)); + + if (datetoo) { + len = 8; + buf[4] = (BIN_TO_BCD(dt->tm_wday)); + buf[5] = (BIN_TO_BCD(dt->tm_mday)); + buf[6] = (BIN_TO_BCD(dt->tm_mon + 1)); + buf[7] = (BIN_TO_BCD(dt->tm_year % 100)); + } + + ret = rs5c372_write(buf,len); + if (ret >= 0) + ret = 0; + else + printk + ("rs5c372_set_datetime(), i2c_master_send() returned %d\n", + ret); + return ret; +} + +static int rs5c372_command(struct i2c_client *client, unsigned int cmd, void *arg) +{ + switch (cmd) { + case RS5C372_GETDATETIME: + return rs5c372_get_datetime(client, arg); + case RS5C372_SETTIME: + return rs5c372_set_datetime(client, arg, 0); + case RS5C372_SETDATETIME: + return rs5c372_set_datetime(client, arg, 1); + default: + return -EINVAL; + } + return 0; +} + +static int rs5c372_rtc_open(struct inode *inode, struct file *file) +{ + return 0; +} + + +static int rs5c372_rtc_release(struct inode *inode, struct file *file) +{ + return 0; +} + +static int rs5c372_rtc_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ +// unsigned long flags; + struct rtc_time wtime; + int status = 0; + + switch (cmd) { + default: + case RTC_UIE_ON: + case RTC_UIE_OFF: + case RTC_PIE_ON: + case RTC_PIE_OFF: + case RTC_AIE_ON: + case RTC_AIE_OFF: + case RTC_ALM_SET: + case RTC_ALM_READ: + case RTC_IRQP_READ: + case RTC_IRQP_SET: + case RTC_EPOCH_SET: + case RTC_EPOCH_READ: + case RTC_WKALM_SET: + case RTC_WKALM_RD: + status = -EINVAL; + break; + case RTC_RD_TIME: +// spin_lock_irqsave(&rs5c372_rtc_lock, flags); + rs5c372_command(rs5c372_i2c_client, RS5C372_GETDATETIME, + &wtime); +// spin_unlock_irqrestore(&rs5c372_rtc_lock, flags); + if (copy_to_user((void *)arg, &wtime, sizeof(struct rtc_time))) + status = -EFAULT; + break; + + case RTC_SET_TIME: + if (!capable(CAP_SYS_TIME)) { + status = -EACCES; + break; + } + + if (copy_from_user + (&wtime, (struct rtc_time *)arg, sizeof(struct rtc_time))) { + status = -EFAULT; + break; + } + +// spin_lock_irqsave(&rs5c372_rtc_lock, flags); + rs5c372_command(rs5c372_i2c_client, RS5C372_SETDATETIME, + &wtime); +// spin_unlock_irqrestore(&rs5c372_rtc_lock, flags); + break; + } + + return status; +} + +/* + * Read the current RTC time and date + */ +static unsigned long rs5c372_get_rtc_time(void) +{ + int ret; + struct rtc_time tm; + if(!rs5c372_i2c_client) + { + printk("No client!!\n"); + return -EIO; + } + ret=rs5c372_command(rs5c372_i2c_client,RS5C372_GETDATETIME,&tm); + if(ret) + { + printk("%s:Command returned %d\n",__FUNCTION__,ret); + return ret;/*Something wrong */ + } + tm.tm_year += 1900; + tm.tm_mon += 1; + return mktime(tm.tm_year,tm.tm_mon,tm.tm_mday, + tm.tm_hour,tm.tm_min,tm.tm_sec); +} +/* + * Set the current RTC time and date + */ +static int rs5c372_set_rtc_time(unsigned long now) +{ + struct rtc_time tm; + to_tm(now,&tm); + /* convert from rtc_time to struct tm conventions */ + tm.tm_year -= 1900; + tm.tm_mon -= 1; + return rs5c372_command(rs5c372_i2c_client,RS5C372_SETDATETIME,&tm); +} + +static int __init rs5c372_init(void) +{ + int retval = 0; + retval = i2c_add_driver(&rs5c372_driver); + if (retval == 0) { + misc_register(&rs5c372_dev); + printk("I2C: rs5c372 RTC driver successfully loaded\n"); + } + else { + printk("I2C: rs5c372 RTC driver failed loading\n"); + } + return retval; +} + +static void __exit rs5c372_exit(void) +{ + misc_deregister(&rs5c372_dev); + i2c_del_driver(&rs5c372_driver); +} + +module_init(rs5c372_init); +module_exit(rs5c372_exit); + + +MODULE_AUTHOR("Pavel Mironchik pmironchik@optifacio.net"); +MODULE_LICENSE("GPL"); diff -ruN linux-2.4.31/drivers/char/serial.c linux-2.4.31_linkstation/drivers/char/serial.c --- linux-2.4.31/drivers/char/serial.c 2005-01-19 09:09:50.000000000 -0500 +++ linux-2.4.31_linkstation/drivers/char/serial.c 2005-12-29 02:54:54.000000000 -0500 @@ -5457,8 +5457,13 @@ serial_driver.type = TTY_DRIVER_TYPE_SERIAL; serial_driver.subtype = SERIAL_TYPE_NORMAL; serial_driver.init_termios = tty_std_termios; +#ifdef CONFIG_LINKSTATION + serial_driver.init_termios.c_cflag = + B9600 | CS8 | CREAD | CLOCAL | CSTOPB | PARENB; +#else serial_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; +#endif serial_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS; serial_driver.refcount = &serial_refcount; serial_driver.table = serial_table; @@ -5897,7 +5902,11 @@ static struct async_struct *info; struct serial_state *state; unsigned cval; +#ifdef CONFIG_LINKSTATION + int baud = 57600; +#else int baud = 9600; +#endif int bits = 8; int parity = 'n'; int doflow = 0; @@ -6013,7 +6022,6 @@ */ if (serial_in(info, UART_LSR) == 0xff) return -1; - return 0; } diff -ruN linux-2.4.31/drivers/i2c/Config.in linux-2.4.31_linkstation/drivers/i2c/Config.in --- linux-2.4.31/drivers/i2c/Config.in 2004-04-14 09:05:29.000000000 -0400 +++ linux-2.4.31_linkstation/drivers/i2c/Config.in 2006-01-01 01:25:00.000000000 -0500 @@ -57,7 +57,13 @@ if [ "$CONFIG_SGI_IP22" = "y" ]; then dep_tristate 'I2C SGI interfaces' CONFIG_I2C_ALGO_SGI $CONFIG_I2C fi - + + # Configuration for the 8245 I2C driver + dep_tristate 'I2C 8245 interface' CONFIG_I2C_ALGO_8245 $CONFIG_I2C + if [ "$CONFIG_I2C_ALGO_8245" != "n" ]; then + dep_tristate 'I2C MPC8245' CONFIG_I2C_MPC8245 $CONFIG_I2C_ALGO_8245 + fi + # This is needed for automatic patch generation: sensors code starts here # This is needed for automatic patch generation: sensors code ends here diff -ruN linux-2.4.31/drivers/i2c/Makefile linux-2.4.31_linkstation/drivers/i2c/Makefile --- linux-2.4.31/drivers/i2c/Makefile 2004-02-18 08:36:31.000000000 -0500 +++ linux-2.4.31_linkstation/drivers/i2c/Makefile 2006-01-01 01:44:43.000000000 -0500 @@ -6,7 +6,7 @@ export-objs := i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \ i2c-algo-ite.o i2c-algo-sibyte.o i2c-algo-sgi.o \ - i2c-proc.o + i2c-proc.o i2c-algo-8245.o i2c-mpc8245.o obj-$(CONFIG_I2C) += i2c-core.o obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o @@ -25,6 +25,8 @@ obj-$(CONFIG_I2C_ALGO_SIBYTE) += i2c-algo-sibyte.o i2c-sibyte.o obj-$(CONFIG_I2C_MAX1617) += i2c-max1617.o obj-$(CONFIG_I2C_ALGO_SGI) += i2c-algo-sgi.o +obj-$(CONFIG_I2C_ALGO_8245) += i2c-algo-8245.o +obj-$(CONFIG_I2C_MPC8245) += i2c-mpc8245.o # This is needed for automatic patch generation: sensors code starts here # This is needed for automatic patch generation: sensors code ends here diff -ruN linux-2.4.31/drivers/i2c/i2c-algo-8245.c linux-2.4.31_linkstation/drivers/i2c/i2c-algo-8245.c --- linux-2.4.31/drivers/i2c/i2c-algo-8245.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/drivers/i2c/i2c-algo-8245.c 2005-12-29 16:39:10.000000000 -0500 @@ -0,0 +1,523 @@ +/*********************************************************************** + * + * (C) Copyright 2005 + * DENX Software Engineering + * Wolfgang Denk, wd@denx.de + * All rights reserved. + ************************************************************************/ + +/* ------------------------------------------------------------------------- */ +/* i2c-algo-8245.c i2c driver algorithms for the MPC8245 I2C Interface */ +/* ------------------------------------------------------------------------- */ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* ------------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#define DEB(x) if (i2c_debug >= 1) x +#define DEB2(x) if (i2c_debug >= 2) x +#define DEB3(x) if (i2c_debug >= 3) x +#define DEBPROTO(x) if (i2c_debug >= 9) x + + +#define DEF_TIMEOUT 100 + + +static int i2c_debug = 0; +static int m8245_scan = 0; + +static wait_queue_head_t iic_wait; + +static int m8245_i2c_poll = 1; + + +static u_int m8245_iic_read(volatile u_int * addr) +{ + u_int val; + + val = in_le32(addr); + asm volatile ("sync"); + return val; +} + +static void m8245_iic_write(volatile u_int * addr, u_int val, u_int mask) +{ + u_int tmp; + + if (! mask) { + out_le32(addr, val); + } else { + tmp = m8245_iic_read(addr); + asm volatile ("sync"); + out_le32(addr, (tmp & ~mask) | (val & mask)); + } + asm volatile ("sync"); +} + +static void +m8245_iic_interrupt(int irq, void *dev_id, struct pt_regs * regs) +{ + volatile i2c_8245_t *i2c = (i2c_8245_t *)dev_id; + + if (i2c_debug > 1) { + printk(KERN_DEBUG "m8245_iic_interrupt(dev_id=%p)\n", dev_id); + } + + m8245_iic_write(&i2c->i2csr, ~M8245_I2CSR_MIF, M8245_I2CSR_MIF); + + wake_up_interruptible(&iic_wait); +} + +static void i2c_start(struct i2c_algo_8245_data *adap) +{ + volatile i2c_8245_t *i2c = (i2c_8245_t *)adap->i2c; + + DEBPROTO(printk("S ")); + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MSTA, M8245_I2CCR_MSTA); +} + + +static void i2c_stop(struct i2c_algo_8245_data *adap) +{ + volatile i2c_8245_t *i2c = (i2c_8245_t *)adap->i2c; + + DEBPROTO(printk("P\n")); + m8245_iic_write(&i2c->i2ccr, 0, M8245_I2CCR_MSTA); +} + + +static int wait_for_bb(struct i2c_algo_8245_data *adap) +{ + volatile i2c_8245_t *i2c = (i2c_8245_t *)adap->i2c; + int timeout = DEF_TIMEOUT; + int status; + status = m8245_iic_read(&i2c->i2csr); +#ifndef STUB_I2C + while (timeout-- && (status & M8245_I2CSR_MBB)) { + udelay(1000); + status = m8245_iic_read(&i2c->i2csr); + } +#endif + if (timeout <= 0) { + printk(KERN_INFO "Timeout waiting for Bus Busy\n"); + } + + return (timeout <= 0); +} + + +static inline void m8245_sleep(unsigned long timeout) +{ + schedule_timeout( timeout * HZ); +} + + +static inline int wait_for_pin(struct i2c_algo_8245_data *adap, int *status) +{ + int timeout = DEF_TIMEOUT; + int res = -1; + volatile i2c_8245_t *i2c = (i2c_8245_t *)adap->i2c; + + if (! m8245_i2c_poll) { + interruptible_sleep_on(&iic_wait); + *status = m8245_iic_read(&i2c->i2csr); + res = 0; + goto Done; + } + + *status = m8245_iic_read(&i2c->i2csr); +#ifndef STUB_I2C + while (timeout-- && !(*status & M8245_I2CSR_MIF)) { + udelay(1000); + *status = m8245_iic_read(&i2c->i2csr); + } +#endif + + if (!(*status & M8245_I2CSR_MIF)) { + goto Done; + } + + m8245_iic_write(&i2c->i2csr, ~M8245_I2CSR_MIF, M8245_I2CSR_MIF); + + res = 0; + +Done: + return res; +} + + +static void +m8245_iic_init(struct i2c_algo_8245_data *adap) +{ + volatile i2c_8245_t *i2c = adap->i2c; + + if (i2c_debug) { + printk(KERN_DEBUG "m8245_iic_init() - I2C registers at %p\n", i2c); + } + + /* Select an arbitrary address. Just make sure it is unique. + */ + m8245_iic_write(&i2c->i2cadr, 0x34, M8245_I2CADR_ADDR_MASK); + + /* Make clock run maximum slow. + */ + m8245_iic_write(&i2c->i2cfdr, 0x3f, M8245_I2CFDR_FDR_MASK); + + /* Enable module and disable interrupts. + */ + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MEN, M8245_I2CCR_INIT_MASK); + + m8245_iic_write(&i2c->i2csr, ~M8245_I2CSR_MIF, M8245_I2CSR_MIF); + + init_waitqueue_head(&iic_wait); + + /* Install interrupt handler. + */ + if (i2c_debug) { + printk (KERN_DEBUG "%s[%d] Install ISR for IRQ %d\n", + __func__,__LINE__, M8245_IRQ_I2C); + } + printk ("i2c-algo-8245: Using IRQ %d\n", + M8245_IRQ_I2C); + + if (request_irq(M8245_IRQ_I2C, m8245_iic_interrupt, 0, "I2C", (void *)i2c)) { + printk(KERN_WARNING "Failed to install an interrupt handler " + " for MPC8245 I2C controller IRQ%d\n", M8245_IRQ_I2C); + m8245_i2c_poll = 1; + } else { + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MIEN, + M8245_I2CCR_MIEN); + } +} + + +static int try_address(struct i2c_algo_8245_data *adap, + unsigned char addr, int retries) +{ + volatile i2c_8245_t *i2c = adap->i2c; + int i, status, ret = -1; + + for (i = 0; i < retries; i++) { + i2c_start(adap); + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MTX, M8245_I2CCR_MTX); + m8245_iic_write(&i2c->i2cdr, addr, 0); + + if (wait_for_pin(adap, &status) >= 0) { + if (!(status & M8245_I2CSR_RXAK)) { + printk("(0x%02x)", addr >> 1); + i2c_stop(adap); + ret = 0; + goto Done; + } else { + printk("."); + } + } + i2c_stop(adap); + udelay(500); + } +Done: + DEB2(if (i < retries) + printk(KERN_DEBUG "i2c-algo-8245.o: needed %d retries for %d\n",i, + addr)); + return ret; +} + + +static int m8245_sendbytes(struct i2c_adapter *i2c_adap, const char *buf, + int count) +{ + struct i2c_algo_8245_data *adap = i2c_adap->algo_data; + volatile i2c_8245_t *i2c = adap->i2c; + int status, timeout; + int i; + + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MEN | M8245_I2CCR_MSTA | M8245_I2CCR_MTX, 0); + + for (i = 0; i < count; i++) { + m8245_iic_write(&i2c->i2cdr, buf[i], 0); + + timeout = wait_for_pin(adap, &status); + if (timeout) { + i2c_stop(adap); + printk(KERN_INFO "i2c-algo-8245.o: i2c_write: " + "i2c_inb timed out.\n"); + return -EREMOTEIO; + } + } + return i; +} + + +static int m8245_readbytes(struct i2c_adapter *i2c_adap, char *buf, int count) +{ + int rdcount = 0, status, timeout; + struct i2c_algo_8245_data *adap = i2c_adap->algo_data; + volatile i2c_8245_t *i2c = adap->i2c; + + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MEN | M8245_I2CCR_MSTA | ((count == 1) ? M8245_I2CCR_TXAK : 0), 0); + + /* dummy read */ + m8245_iic_read(&i2c->i2cdr); + + for (rdcount = 0; rdcount < count; rdcount++) { + timeout = wait_for_pin(adap, &status); + if (timeout) { + i2c_stop(adap); + printk(KERN_INFO "i2c-algo-8245.o: i2c_read: " + "i2c_inb timed out.\n"); + return -EREMOTEIO; + } + + /* Generate ack on last next to last byte */ + if (rdcount == count - 2) + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MEN | M8245_I2CCR_MSTA | M8245_I2CCR_TXAK, 0); + + /* Generate stop on last byte */ + if (rdcount == count - 1) + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MEN | M8245_I2CCR_TXAK, 0); + + buf[rdcount] = m8245_iic_read(&i2c->i2cdr); + } + + return rdcount; +} + + +static inline void m8245_doAddress(struct i2c_algo_8245_data *adap, + struct i2c_msg *msg, int retries) +{ + volatile i2c_8245_t *i2c = (i2c_8245_t *)adap->i2c; + unsigned short flags = msg->flags; + unsigned char addr; + + addr = ( msg->addr << 1 ); + if (flags & I2C_M_RD ) { + addr |= 1; + } + if (flags & I2C_M_REV_DIR_ADDR ) { + addr ^= 1; + } + + m8245_iic_write(&i2c->i2ccr, M8245_I2CCR_MTX, M8245_I2CCR_MTX); + m8245_iic_write(&i2c->i2cdr, addr, 0); +} + +static int m8245_xfer(struct i2c_adapter *i2c_adap, + struct i2c_msg msgs[], + int num) +{ + struct i2c_algo_8245_data * adap = i2c_adap->algo_data; + struct i2c_msg * pmsg; + int i, ret; + int timeout, status; + + for (i = 0; i < num; i++) { + pmsg = &msgs[i]; + + DEB3(printk(KERN_DEBUG "i2c-algo-8245.o: Msg %d, addr=0x%x, flags=0x%x, " + "len=%d\n", + i, msgs[i].addr, msgs[i].flags, msgs[i].len);) + + /* Check for bus busy. + */ + timeout = wait_for_bb(adap); + if (timeout) { + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: " + "Timeout waiting for BB in m8245_xfer\n");) + ret = -EIO; + goto Done; + } + + i2c_start(adap); + + m8245_doAddress(adap, pmsg, i2c_adap->retries); + + timeout = wait_for_pin(adap, &status); + if (timeout) { + i2c_stop(adap); + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: Timeout waiting " + "for PIN(1) in m8245_xfer\n");) + ret = EREMOTEIO; + goto Done; + } + +#ifndef STUB_I2C + if (status & M8245_I2CSR_RXAK) { + i2c_stop(adap); + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: " + "No RXAK in m8245_xfer\n");) + ret = -EREMOTEIO; + goto Done; + } +#endif + + if (pmsg->flags & I2C_M_RD) { + ret = m8245_readbytes(i2c_adap, pmsg->buf, pmsg->len); + + if (ret != pmsg->len) { + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: fail: " + "only read %d bytes.\n", ret)); + ret = (ret < 0) ? ret : -EREMOTEIO; + goto Done; + } else { + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: read %d bytes.\n", + ret)); + } + } else { + ret = m8245_sendbytes(i2c_adap, pmsg->buf, pmsg->len); + + if (ret != pmsg->len) { + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: fail: " + "only wrote %d bytes.\n", ret)); + ret = (ret < 0) ? ret : -EREMOTEIO; + goto Done; + } else { + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: wrote %d " + "bytes.\n", ret)); + } + } + + i2c_stop(adap); + } + ret = num; +Done: + return ret; +} + +static int algo_control(struct i2c_adapter *adapter, + unsigned int cmd, unsigned long arg) +{ + return 0; +} + +static u32 m8245_func(struct i2c_adapter *adap) +{ + return I2C_FUNC_SMBUS_EMUL; +} + +#ifndef I2C_ALGO_MPC8245 +#define I2C_ALGO_MPC8245 0x0d0000 +#endif + + +/* -----exported algorithm data: ------------------------------------- */ + +static struct i2c_algorithm m8245_algo = { + "MPC8245 algorithm", + I2C_ALGO_MPC8245, + m8245_xfer, + NULL, + NULL, /* slave_xmit */ + NULL, /* slave_recv */ + algo_control, /* ioctl */ + m8245_func, /* functionality */ +}; + +/* + * registering functions to load algorithms at runtime + */ +int i2c_8245_add_bus(struct i2c_adapter *adap) +{ + int i; + struct i2c_algo_8245_data *m8245_adap = adap->algo_data; + + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: hw routines for %s registered.\n", + adap->name)); + + adap->id |= m8245_algo.id; + adap->algo = &m8245_algo; + + adap->timeout = 100; + adap->retries = 3; + +#ifdef MODULE + MOD_INC_USE_COUNT; +#endif + + i2c_add_adapter(adap); + m8245_iic_init(m8245_adap); + + if (m8245_scan) { + printk(KERN_INFO " i2c-algo-8245.o: scanning bus %s.\n", + adap->name); + for (i = 0x00; i < 0xff; i+=2) { + try_address(m8245_adap, i, 1); + udelay(500); + } + printk("\n"); + } + return 0; +} + + +int i2c_8245_del_bus(struct i2c_adapter *adap) +{ + int res; + if ((res = i2c_del_adapter(adap)) < 0) + return res; + DEB2(printk(KERN_DEBUG "i2c-algo-8245.o: adapter unregistered: %s\n",adap->name)); + +#ifdef MODULE + MOD_DEC_USE_COUNT; +#endif + return 0; +} + +int __init i2c_algo_8245_init (void) +{ + printk(KERN_INFO "i2c-algo-8245.o: i2c MPC8245 algorithm module\n"); + return 0; +} + + +EXPORT_SYMBOL(i2c_8245_add_bus); +EXPORT_SYMBOL(i2c_8245_del_bus); + +#ifdef MODULE +MODULE_AUTHOR("Wolfgang Denk "); +MODULE_DESCRIPTION("I2C-Bus MPC8245 algorithm"); + +MODULE_PARM(m8245_scan, "i"); +MODULE_PARM(i2c_debug,"i"); + +MODULE_PARM_DESC(m8245_scan, "Scan for active chips on the bus"); +MODULE_PARM_DESC(i2c_debug, + "debug level - 0 off; 1 normal; 2,3 more verbose; 9 m8245-protocol"); + + +int init_module(void) +{ + return i2c_algo_8245_init(); +} + +void cleanup_module(void) +{ +} +#endif diff -ruN linux-2.4.31/drivers/i2c/i2c-core.c linux-2.4.31_linkstation/drivers/i2c/i2c-core.c --- linux-2.4.31/drivers/i2c/i2c-core.c 2005-05-31 20:56:56.000000000 -0400 +++ linux-2.4.31_linkstation/drivers/i2c/i2c-core.c 2006-01-01 01:26:12.000000000 -0500 @@ -1246,6 +1246,9 @@ #ifdef CONFIG_I2C_ALGOBIT extern int i2c_algo_bit_init(void); #endif +#ifdef CONFIG_I2C_ALGO_8245 + extern int i2c_algo_8245_init(void); +#endif #ifdef CONFIG_I2C_PHILIPSPAR extern int i2c_bitlp_init(void); #endif @@ -1280,6 +1283,9 @@ #ifdef CONFIG_I2C_MAX1617 extern int i2c_max1617_init(void); #endif +#ifdef CONFIG_I2C_MPC8245 + extern int i2c_mpc8245_init(void); +#endif #ifdef CONFIG_I2C_PROC extern int sensors_init(void); @@ -1300,6 +1306,9 @@ #ifdef CONFIG_I2C_ALGOBIT i2c_algo_bit_init(); #endif +#ifdef CONFIG_I2C_ALGO_8245 + i2c_algo_8245_init(); +#endif #ifdef CONFIG_I2C_PHILIPSPAR i2c_bitlp_init(); #endif @@ -1334,6 +1343,9 @@ #ifdef CONFIG_I2C_MAX1617 i2c_max1617_init(); #endif +#ifdef CONFIG_I2C_MPC8245 + i2c_mpc8245_init(); +#endif /* -------------- proc interface ---- */ #ifdef CONFIG_I2C_PROC diff -ruN linux-2.4.31/drivers/i2c/i2c-mpc8245.c linux-2.4.31_linkstation/drivers/i2c/i2c-mpc8245.c --- linux-2.4.31/drivers/i2c/i2c-mpc8245.c 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/drivers/i2c/i2c-mpc8245.c 2006-01-01 01:59:46.000000000 -0500 @@ -0,0 +1,122 @@ +/*********************************************************************** + * + * (C) Copyright 2005 + * DENX Software Engineering + * Wolfgang Denk, wd@denx.de + * All rights reserved. + ***********************************************************************/ + +/* ------------------------------------------------------------------------- */ +/* i2c-mpc8245.c I2C Interface driver module for the mpc8245 board */ +/* ------------------------------------------------------------------------- */ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* ------------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +static int mpc8245_i2c_reg(struct i2c_client *client) +{ + return 0; +} + + +static int mpc8245_i2c_unreg(struct i2c_client *client) +{ + return 0; +} + +static void mpc8245_i2c_inc_use(struct i2c_adapter *adap) +{ +#ifdef MODULE + MOD_INC_USE_COUNT; +#endif +} + +static void mpc8245_i2c_dec_use(struct i2c_adapter *adap) +{ +#ifdef MODULE + MOD_DEC_USE_COUNT; +#endif +} + + +static struct i2c_algo_8245_data mpc8245_i2c_data = { + NULL +}; + +#ifndef I2C_HW_MPC8245 +#define I2C_HW_MPC8245 0x00 +#endif + +static struct i2c_adapter mpc8245_i2c_ops = { + "mpc8245 I2C Interface", + I2C_HW_MPC8245, + NULL, + &mpc8245_i2c_data, + mpc8245_i2c_inc_use, + mpc8245_i2c_dec_use, + mpc8245_i2c_reg, + mpc8245_i2c_unreg, +}; + +int __init i2c_mpc8245_init(void) +{ + int res = -ENODEV; + + printk(KERN_INFO "i2c-mpc8245.o: i2c mpc8245 module\n"); + + mpc8245_i2c_data.i2c = ioremap(0x80000000 + M8245_I2C_OFFSET, M8245_I2C_SIZE); + if (i2c_8245_add_bus(&mpc8245_i2c_ops) < 0) { + goto Done; + } + + printk(KERN_INFO "i2c-mpc8245.o: found device at 0x%08x.\n", + (unsigned int)mpc8245_i2c_data.i2c); + + res = 0; +Done: + return res; +} + +EXPORT_NO_SYMBOLS; + +#ifdef MODULE +MODULE_AUTHOR("Wolfgang Denk "); +MODULE_DESCRIPTION("I2C-Bus driver routines for the mpc8245 board"); + +int init_module(void) +{ + return i2c_mpc8245_init(); +} + +void cleanup_module(void) +{ + i2c_8245_del_bus(&mpc8245_i2c_ops); +} + +#endif diff -ruN linux-2.4.31/drivers/ide/pci/siimage.c linux-2.4.31_linkstation/drivers/ide/pci/siimage.c --- linux-2.4.31/drivers/ide/pci/siimage.c 2004-11-17 06:54:21.000000000 -0500 +++ linux-2.4.31_linkstation/drivers/ide/pci/siimage.c 2005-12-28 23:27:06.000000000 -0500 @@ -904,11 +904,15 @@ pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (class_rev) ? 1 : 255); pci_read_config_byte(dev, 0x8A, &BA5_EN); +#ifndef CONFIG_LINKSTATION if ((BA5_EN & 0x01) || (pci_resource_start(dev, 5))) { if (setup_mmio_siimage(dev, name)) { return 0; } } +#else + printk(KERN_WARNING "siimage: IDE controller MMIO ports not available.\n"); +#endif pci_write_config_byte(dev, 0x80, 0x00); pci_write_config_byte(dev, 0x84, 0x00); diff -ruN linux-2.4.31/drivers/net/r8169.c linux-2.4.31_linkstation/drivers/net/r8169.c --- linux-2.4.31/drivers/net/r8169.c 2004-08-07 19:26:05.000000000 -0400 +++ linux-2.4.31_linkstation/drivers/net/r8169.c 2006-01-01 00:55:58.000000000 -0500 @@ -1,1716 +1,2014 @@ -/* -========================================================================= - r8169.c: A RealTek RTL-8169 Gigabit Ethernet driver for Linux kernel 2.4.x. - -------------------------------------------------------------------- - - History: - Feb 4 2002 - created initially by ShuChen . - May 20 2002 - Add link status force-mode and TBI mode support. -========================================================================= - 1. The media can be forced in 5 modes. - Command: 'insmod r8169 media = SET_MEDIA' - Ex: 'insmod r8169 media = 0x04' will force PHY to operate in 100Mpbs Half-duplex. - - SET_MEDIA can be: - _10_Half = 0x01 - _10_Full = 0x02 - _100_Half = 0x04 - _100_Full = 0x08 - _1000_Full = 0x10 - - 2. Support TBI mode. -========================================================================= -VERSION 1.1 <2002/10/4> - - The bit4:0 of MII register 4 is called "selector field", and have to be - 00001b to indicate support of IEEE std 802.3 during NWay process of - exchanging Link Code Word (FLP). - -VERSION 1.2 <2002/11/30> - - - Large style cleanup - - Use ether_crc in stock kernel (linux/crc32.h) - - Copy mc_filter setup code from 8139cp - (includes an optimization, and avoids set_bit use) - - <2003/11/30> - - - Add new rtl8169_{suspend/resume}() support -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define DMA_64BIT_MASK 0xffffffffffffffffULL -#define DMA_32BIT_MASK 0x00000000ffffffffULL - -#define RTL8169_VERSION "1.2" -#define MODULENAME "r8169" -#define RTL8169_DRIVER_NAME MODULENAME " Gigabit Ethernet driver " RTL8169_VERSION -#define PFX MODULENAME ": " - -#ifdef RTL8169_DEBUG -#define assert(expr) \ - if(!(expr)) { \ - printk( "Assertion failed! %s,%s,%s,line=%d\n", \ - #expr,__FILE__,__FUNCTION__,__LINE__); \ - } -#define dprintk(fmt, args...) do { printk(PFX fmt, ## args) } while (0) -#else -#define assert(expr) do {} while (0) -#define dprintk(fmt, args...) do {} while (0) -#endif /* RTL8169_DEBUG */ - -/* media options */ -#define MAX_UNITS 8 -static int media[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1 }; - -/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ -static int max_interrupt_work = 20; - -/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). - The RTL chips use a 64 element hash table based on the Ethernet CRC. */ -static int multicast_filter_limit = 32; - -/* MAC address length*/ -#define MAC_ADDR_LEN 6 - -/* max supported gigabit ethernet frame size -- must be at least (dev->mtu+14+4).*/ -#define MAX_ETH_FRAME_SIZE 1536 - -#define TX_FIFO_THRESH 256 /* In bytes */ - -#define RX_FIFO_THRESH 7 /* 7 means NO threshold, Rx buffer level before first PCI xfer. */ -#define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ -#define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ -#define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ -#define RxPacketMaxSize 0x0800 /* Maximum size supported is 16K-1 */ -#define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ - -#define NUM_TX_DESC 64 /* Number of Tx descriptor registers */ -#define NUM_RX_DESC 64 /* Number of Rx descriptor registers */ -#define RX_BUF_SIZE 1536 /* Rx Buffer size */ -#define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) -#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) - -#define RTL_MIN_IO_SIZE 0x80 -#define RTL8169_TX_TIMEOUT (6*HZ) -#define RTL8169_PHY_TIMEOUT (HZ) - -/* write/read MMIO register */ -#define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) -#define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg)) -#define RTL_W32(reg, val32) writel ((val32), ioaddr + (reg)) -#define RTL_R8(reg) readb (ioaddr + (reg)) -#define RTL_R16(reg) readw (ioaddr + (reg)) -#define RTL_R32(reg) ((unsigned long) readl (ioaddr + (reg))) - -enum mac_version { - RTL_GIGA_MAC_VER_B = 0x00, - /* RTL_GIGA_MAC_VER_C = 0x03, */ - RTL_GIGA_MAC_VER_D = 0x01, - RTL_GIGA_MAC_VER_E = 0x02 -}; - -enum phy_version { - RTL_GIGA_PHY_VER_C = 0x03, /* PHY Reg 0x03 bit0-3 == 0x0000 */ - RTL_GIGA_PHY_VER_D = 0x04, /* PHY Reg 0x03 bit0-3 == 0x0000 */ - RTL_GIGA_PHY_VER_E = 0x05, /* PHY Reg 0x03 bit0-3 == 0x0000 */ - RTL_GIGA_PHY_VER_F = 0x06, /* PHY Reg 0x03 bit0-3 == 0x0001 */ - RTL_GIGA_PHY_VER_G = 0x07, /* PHY Reg 0x03 bit0-3 == 0x0002 */ -}; - - -#define _R(NAME,MAC,MASK) \ - { .name = NAME, .mac_version = MAC, .RxConfigMask = MASK } - -const static struct { - const char *name; - u8 mac_version; - u32 RxConfigMask; /* Clears the bits supported by this chip */ -} rtl_chip_info[] = { - _R("RTL8169", RTL_GIGA_MAC_VER_B, 0xff7e1880), - _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_D, 0xff7e1880), - _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_E, 0xff7e1880) -}; -#undef _R - -static struct pci_device_id rtl8169_pci_tbl[] = { - {0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {0,}, -}; - -MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl); - -static int rx_copybreak = 200; - -enum RTL8169_registers { - MAC0 = 0, /* Ethernet hardware address. */ - MAR0 = 8, /* Multicast filter. */ - TxDescStartAddrLow = 0x20, - TxDescStartAddrHigh = 0x24, - TxHDescStartAddrLow = 0x28, - TxHDescStartAddrHigh = 0x2c, - FLASH = 0x30, - ERSR = 0x36, - ChipCmd = 0x37, - TxPoll = 0x38, - IntrMask = 0x3C, - IntrStatus = 0x3E, - TxConfig = 0x40, - RxConfig = 0x44, - RxMissed = 0x4C, - Cfg9346 = 0x50, - Config0 = 0x51, - Config1 = 0x52, - Config2 = 0x53, - Config3 = 0x54, - Config4 = 0x55, - Config5 = 0x56, - MultiIntr = 0x5C, - PHYAR = 0x60, - TBICSR = 0x64, - TBI_ANAR = 0x68, - TBI_LPAR = 0x6A, - PHYstatus = 0x6C, - RxMaxSize = 0xDA, - CPlusCmd = 0xE0, - RxDescAddrLow = 0xE4, - RxDescAddrHigh = 0xE8, - EarlyTxThres = 0xEC, - FuncEvent = 0xF0, - FuncEventMask = 0xF4, - FuncPresetState = 0xF8, - FuncForceEvent = 0xFC, -}; - -enum RTL8169_register_content { - /*InterruptStatusBits */ - SYSErr = 0x8000, - PCSTimeout = 0x4000, - SWInt = 0x0100, - TxDescUnavail = 0x80, - RxFIFOOver = 0x40, - RxUnderrun = 0x20, - RxOverflow = 0x10, - TxErr = 0x08, - TxOK = 0x04, - RxErr = 0x02, - RxOK = 0x01, - - /*RxStatusDesc */ - RxRES = 0x00200000, - RxCRC = 0x00080000, - RxRUNT = 0x00100000, - RxRWT = 0x00400000, - - /*ChipCmdBits */ - CmdReset = 0x10, - CmdRxEnb = 0x08, - CmdTxEnb = 0x04, - RxBufEmpty = 0x01, - - /*Cfg9346Bits */ - Cfg9346_Lock = 0x00, - Cfg9346_Unlock = 0xC0, - - /*rx_mode_bits */ - AcceptErr = 0x20, - AcceptRunt = 0x10, - AcceptBroadcast = 0x08, - AcceptMulticast = 0x04, - AcceptMyPhys = 0x02, - AcceptAllPhys = 0x01, - - /*RxConfigBits */ - RxCfgFIFOShift = 13, - RxCfgDMAShift = 8, - - /*TxConfigBits */ - TxInterFrameGapShift = 24, - TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */ - - /* CPlusCmd p.31 */ - RxVlan = (1 << 6), - RxChkSum = (1 << 5), - PCIDAC = (1 << 4), - PCIMulRW = (1 << 3), - - /*rtl8169_PHYstatus */ - TBI_Enable = 0x80, - TxFlowCtrl = 0x40, - RxFlowCtrl = 0x20, - _1000bpsF = 0x10, - _100bps = 0x08, - _10bps = 0x04, - LinkStatus = 0x02, - FullDup = 0x01, - - /*GIGABIT_PHY_registers */ - PHY_CTRL_REG = 0, - PHY_STAT_REG = 1, - PHY_AUTO_NEGO_REG = 4, - PHY_1000_CTRL_REG = 9, - - /*GIGABIT_PHY_REG_BIT */ - PHY_Restart_Auto_Nego = 0x0200, - PHY_Enable_Auto_Nego = 0x1000, - - //PHY_STAT_REG = 1; - PHY_Auto_Neco_Comp = 0x0020, - - //PHY_AUTO_NEGO_REG = 4; - PHY_Cap_10_Half = 0x0020, - PHY_Cap_10_Full = 0x0040, - PHY_Cap_100_Half = 0x0080, - PHY_Cap_100_Full = 0x0100, - - //PHY_1000_CTRL_REG = 9; - PHY_Cap_1000_Full = 0x0200, - - PHY_Cap_Null = 0x0, - - /*_MediaType*/ - _10_Half = 0x01, - _10_Full = 0x02, - _100_Half = 0x04, - _100_Full = 0x08, - _1000_Full = 0x10, - - /*_TBICSRBit*/ - TBILinkOK = 0x02000000, -}; - -enum _DescStatusBit { - OWNbit = 0x80000000, - EORbit = 0x40000000, - FSbit = 0x20000000, - LSbit = 0x10000000, -}; - -#define RsvdMask 0x3fffc000 - -struct TxDesc { - u32 status; - u32 vlan_tag; - u64 addr; -}; - -struct RxDesc { - u32 status; - u32 vlan_tag; - u64 addr; -}; - -struct rtl8169_private { - void *mmio_addr; /* memory map physical address */ - struct pci_dev *pci_dev; /* Index of PCI device */ - struct net_device_stats stats; /* statistics of net device */ - spinlock_t lock; /* spin lock flag */ - int chipset; - int mac_version; - int phy_version; - u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */ - u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ - u32 dirty_rx; - u32 dirty_tx; - struct TxDesc *TxDescArray; /* Index of 256-alignment Tx Descriptor buffer */ - struct RxDesc *RxDescArray; /* Index of 256-alignment Rx Descriptor buffer */ - dma_addr_t TxPhyAddr; - dma_addr_t RxPhyAddr; - struct sk_buff *Rx_skbuff[NUM_RX_DESC]; /* Rx data buffers */ - struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ - struct timer_list timer; - unsigned long phy_link_down_cnt; - u16 cp_cmd; -}; - -MODULE_AUTHOR("Realtek"); -MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); -MODULE_PARM(media, "1-" __MODULE_STRING(MAX_UNITS) "i"); -MODULE_PARM(rx_copybreak, "i"); -MODULE_LICENSE("GPL"); - -static int rtl8169_open(struct net_device *dev); -static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev); -static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance, - struct pt_regs *regs); -static int rtl8169_init_ring(struct net_device *dev); -static void rtl8169_hw_start(struct net_device *dev); -static int rtl8169_close(struct net_device *dev); -static void rtl8169_set_rx_mode(struct net_device *dev); -static void rtl8169_tx_timeout(struct net_device *dev); -static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); - -static const u16 rtl8169_intr_mask = - RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK; -static const unsigned int rtl8169_rx_config = - (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); - -#define PHY_Cap_10_Half_Or_Less PHY_Cap_10_Half -#define PHY_Cap_10_Full_Or_Less PHY_Cap_10_Full | PHY_Cap_10_Half_Or_Less -#define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less -#define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less - -static void mdio_write(void *ioaddr, int RegAddr, int value) -{ - int i; - - RTL_W32(PHYAR, 0x80000000 | (RegAddr & 0xFF) << 16 | value); - udelay(1000); - - for (i = 2000; i > 0; i--) { - // Check if the RTL8169 has completed writing to the specified MII register - if (!(RTL_R32(PHYAR) & 0x80000000)) { - break; - } else { - udelay(100); - } - } -} - -static int mdio_read(void *ioaddr, int RegAddr) -{ - int i, value = -1; - - RTL_W32(PHYAR, 0x0 | (RegAddr & 0xFF) << 16); - udelay(1000); - - for (i = 2000; i > 0; i--) { - // Check if the RTL8169 has completed retrieving data from the specified MII register - if (RTL_R32(PHYAR) & 0x80000000) { - value = (int) (RTL_R32(PHYAR) & 0xFFFF); - break; - } - udelay(100); - } - return value; -} - -static void rtl8169_get_drvinfo(struct net_device *dev, - struct ethtool_drvinfo *info) -{ - struct rtl8169_private *tp = dev->priv; - - strcpy(info->driver, RTL8169_DRIVER_NAME); - strcpy(info->version, RTL8169_VERSION ); - strcpy(info->bus_info, pci_name(tp->pci_dev)); -} - -static struct ethtool_ops rtl8169_ethtool_ops = { - .get_drvinfo = rtl8169_get_drvinfo, -}; - -static void rtl8169_write_gmii_reg_bit(void *ioaddr, int reg, int bitnum, - int bitval) -{ - int val; - - val = mdio_read(ioaddr, reg); - val = (bitval == 1) ? - val | (bitval << bitnum) : val & ~(0x0001 << bitnum); - mdio_write(ioaddr, reg, val & 0xffff); -} - -static void rtl8169_get_mac_version(struct rtl8169_private *tp, void *ioaddr) -{ - const struct { - u32 mask; - int mac_version; - } mac_info[] = { - { 0x1 << 26, RTL_GIGA_MAC_VER_E }, - { 0x1 << 23, RTL_GIGA_MAC_VER_D }, - { 0x00000000, RTL_GIGA_MAC_VER_B } /* Catch-all */ - }, *p = mac_info; - u32 reg; - - reg = RTL_R32(TxConfig) & 0x7c800000; - while ((reg & p->mask) != p->mask) - p++; - tp->mac_version = p->mac_version; -} - -static void rtl8169_print_mac_version(struct rtl8169_private *tp) -{ - struct { - int version; - char *msg; - } mac_print[] = { - { RTL_GIGA_MAC_VER_E, "RTL_GIGA_MAC_VER_E" }, - { RTL_GIGA_MAC_VER_D, "RTL_GIGA_MAC_VER_D" }, - { RTL_GIGA_MAC_VER_B, "RTL_GIGA_MAC_VER_B" }, - { 0, NULL } - }, *p; - - for (p = mac_print; p->msg; p++) { - if (tp->mac_version == p->version) { - dprintk("mac_version == %s (%04d)\n", p->msg, - p->version); - return; - } - } - dprintk("mac_version == Unknown\n"); -} - -static void rtl8169_get_phy_version(struct rtl8169_private *tp, void *ioaddr) -{ - const struct { - u16 mask; - u16 set; - int phy_version; - } phy_info[] = { - { 0x000f, 0x0002, RTL_GIGA_PHY_VER_G }, - { 0x000f, 0x0001, RTL_GIGA_PHY_VER_F }, - { 0x000f, 0x0000, RTL_GIGA_PHY_VER_E }, - { 0x0000, 0x0000, RTL_GIGA_PHY_VER_D } /* Catch-all */ - }, *p = phy_info; - u16 reg; - - reg = mdio_read(ioaddr, 3) & 0xffff; - while ((reg & p->mask) != p->set) - p++; - tp->phy_version = p->phy_version; -} - -static void rtl8169_print_phy_version(struct rtl8169_private *tp) -{ - struct { - int version; - char *msg; - u32 reg; - } phy_print[] = { - { RTL_GIGA_PHY_VER_G, "RTL_GIGA_PHY_VER_G", 0x0002 }, - { RTL_GIGA_PHY_VER_F, "RTL_GIGA_PHY_VER_F", 0x0001 }, - { RTL_GIGA_PHY_VER_E, "RTL_GIGA_PHY_VER_E", 0x0000 }, - { RTL_GIGA_PHY_VER_D, "RTL_GIGA_PHY_VER_D", 0x0000 }, - { 0, NULL, 0x0000 } - }, *p; - - for (p = phy_print; p->msg; p++) { - if (tp->phy_version == p->version) { - dprintk("phy_version == %s (%04x)\n", p->msg, p->reg); - return; - } - } - dprintk("phy_version == Unknown\n"); -} - -static void rtl8169_hw_phy_config(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - void *ioaddr = tp->mmio_addr; - struct { - u16 regs[5]; /* Beware of bit-sign propagation */ - } phy_magic[5] = { { - { 0x0000, //w 4 15 12 0 - 0x00a1, //w 3 15 0 00a1 - 0x0008, //w 2 15 0 0008 - 0x1020, //w 1 15 0 1020 - 0x1000 } },{ //w 0 15 0 1000 - { 0x7000, //w 4 15 12 7 - 0xff41, //w 3 15 0 ff41 - 0xde60, //w 2 15 0 de60 - 0x0140, //w 1 15 0 0140 - 0x0077 } },{ //w 0 15 0 0077 - { 0xa000, //w 4 15 12 a - 0xdf01, //w 3 15 0 df01 - 0xdf20, //w 2 15 0 df20 - 0xff95, //w 1 15 0 ff95 - 0xfa00 } },{ //w 0 15 0 fa00 - { 0xb000, //w 4 15 12 b - 0xff41, //w 3 15 0 ff41 - 0xde20, //w 2 15 0 de20 - 0x0140, //w 1 15 0 0140 - 0x00bb } },{ //w 0 15 0 00bb - { 0xf000, //w 4 15 12 f - 0xdf01, //w 3 15 0 df01 - 0xdf20, //w 2 15 0 df20 - 0xff95, //w 1 15 0 ff95 - 0xbf00 } //w 0 15 0 bf00 - } - }, *p = phy_magic; - int i; - - rtl8169_print_mac_version(tp); - rtl8169_print_phy_version(tp); - - if (tp->mac_version <= RTL_GIGA_MAC_VER_B) - return; - if (tp->phy_version >= RTL_GIGA_PHY_VER_F) - return; - - dprintk("MAC version != 0 && PHY version == 0 or 1\n"); - dprintk("Do final_reg2.cfg\n"); - - /* Shazam ! */ - - // phy config for RTL8169s mac_version C chip - mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 - mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 - mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 - rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 - - for (i = 0; i < ARRAY_SIZE(phy_magic); i++, p++) { - int val, pos = 4; - - val = (mdio_read(ioaddr, pos) & 0x0fff) | (p->regs[0] & 0xffff); - mdio_write(ioaddr, pos, val); - while (--pos >= 0) - mdio_write(ioaddr, pos, p->regs[4 - pos] & 0xffff); - rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 1); //w 4 11 11 1 - rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 - } - mdio_write(ioaddr, 31, 0x0000); //w 31 2 0 0 -} - -static void rtl8169_hw_phy_reset(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - void *ioaddr = tp->mmio_addr; - int i, val; - - printk(KERN_WARNING PFX "%s: Reset RTL8169s PHY\n", dev->name); - - val = (mdio_read(ioaddr, 0) | 0x8000) & 0xffff; - mdio_write(ioaddr, 0, val); - - for (i = 50; i >= 0; i--) { - if (!(mdio_read(ioaddr, 0) & 0x8000)) - break; - udelay(100); /* Gross */ - } - - if (i < 0) { - printk(KERN_WARNING PFX "%s: no PHY Reset ack. Giving up.\n", - dev->name); - } -} - -static void rtl8169_phy_timer(unsigned long __opaque) -{ - struct net_device *dev = (struct net_device *)__opaque; - struct rtl8169_private *tp = dev->priv; - struct timer_list *timer = &tp->timer; - void *ioaddr = tp->mmio_addr; - - assert(tp->mac_version > RTL_GIGA_MAC_VER_B); - assert(tp->phy_version < RTL_GIGA_PHY_VER_G); - - if (RTL_R8(PHYstatus) & LinkStatus) - tp->phy_link_down_cnt = 0; - else { - tp->phy_link_down_cnt++; - if (tp->phy_link_down_cnt >= 12) { - int reg; - - // If link on 1000, perform phy reset. - reg = mdio_read(ioaddr, PHY_1000_CTRL_REG); - if (reg & PHY_Cap_1000_Full) - rtl8169_hw_phy_reset(dev); - - tp->phy_link_down_cnt = 0; - } - } - - mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT); -} - -static inline void rtl8169_delete_timer(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - struct timer_list *timer = &tp->timer; - - if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || - (tp->phy_version >= RTL_GIGA_PHY_VER_G)) - return; - - del_timer_sync(timer); - - tp->phy_link_down_cnt = 0; -} - -static inline void rtl8169_request_timer(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - struct timer_list *timer = &tp->timer; - - if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || - (tp->phy_version >= RTL_GIGA_PHY_VER_G)) - return; - - tp->phy_link_down_cnt = 0; - - init_timer(timer); - timer->expires = jiffies + RTL8169_PHY_TIMEOUT; - timer->data = (unsigned long)(dev); - timer->function = rtl8169_phy_timer; - add_timer(timer); -} - -static int __devinit -rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, - void **ioaddr_out) -{ - void *ioaddr = NULL; - struct net_device *dev; - struct rtl8169_private *tp; - unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; - int rc, i, acpi_idle_state = 0, pm_cap; - - - assert(pdev != NULL); - assert(ioaddr_out != NULL); - - *ioaddr_out = NULL; - *dev_out = NULL; - - // dev zeroed in alloc_etherdev - dev = alloc_etherdev(sizeof (*tp)); - if (dev == NULL) { - printk(KERN_ERR PFX "unable to alloc new ethernet\n"); - return -ENOMEM; - } - - SET_MODULE_OWNER(dev); - SET_NETDEV_DEV(dev, &pdev->dev); - tp = dev->priv; - - // enable device (incl. PCI PM wakeup and hotplug setup) - rc = pci_enable_device(pdev); - if (rc) { - printk(KERN_ERR PFX "%s: unable to enable device\n", pdev->slot_name); - goto err_out; - } - - /* save power state before pci_enable_device overwrites it */ - pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); - if (pm_cap) { - u16 pwr_command; - - pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command); - acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK; - } else { - printk(KERN_ERR PFX "Cannot find PowerManagement capability, aborting.\n"); - goto err_out_free_res; - } - - mmio_start = pci_resource_start(pdev, 1); - mmio_end = pci_resource_end(pdev, 1); - mmio_flags = pci_resource_flags(pdev, 1); - mmio_len = pci_resource_len(pdev, 1); - - // make sure PCI base addr 1 is MMIO - if (!(mmio_flags & IORESOURCE_MEM)) { - printk(KERN_ERR PFX - "region #1 not an MMIO resource, aborting\n"); - rc = -ENODEV; - goto err_out_disable; - } - // check for weird/broken PCI region reporting - if (mmio_len < RTL_MIN_IO_SIZE) { - printk(KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); - rc = -ENODEV; - goto err_out_disable; - } - - rc = pci_request_regions(pdev, dev->name); - if (rc) { - printk(KERN_ERR PFX "%s: Could not request regions.\n", pdev->slot_name); - goto err_out_disable; - } - - tp->cp_cmd = PCIMulRW | RxChkSum; - - if ((sizeof(dma_addr_t) > 32) && - !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) - tp->cp_cmd |= PCIDAC; - else { - rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); - if (rc < 0) { - printk(KERN_ERR PFX "DMA configuration failed.\n"); - goto err_out_free_res; - } - } - - - // enable PCI bus-mastering - pci_set_master(pdev); - - // ioremap MMIO region - ioaddr = ioremap(mmio_start, mmio_len); - if (ioaddr == NULL) { - printk(KERN_ERR PFX "cannot remap MMIO, aborting\n"); - rc = -EIO; - goto err_out_free_res; - } - - // Soft reset the chip. - RTL_W8(ChipCmd, CmdReset); - - // Check that the chip has finished the reset. - for (i = 1000; i > 0; i--) { - if ((RTL_R8(ChipCmd) & CmdReset) == 0) - break; - udelay(10); - } - - // Identify chip attached to board - rtl8169_get_mac_version(tp, ioaddr); - rtl8169_get_phy_version(tp, ioaddr); - - rtl8169_print_mac_version(tp); - rtl8169_print_phy_version(tp); - - for (i = ARRAY_SIZE(rtl_chip_info) - 1; i >= 0; i--) { - if (tp->mac_version == rtl_chip_info[i].mac_version) - break; - } - if (i < 0) { - /* Unknown chip: assume array element #0, original RTL-8169 */ - printk(KERN_DEBUG PFX - "PCI device %s: unknown chip version, assuming %s\n", - pci_name(pdev), rtl_chip_info[0].name); - i++; - } - tp->chipset = i; - - *ioaddr_out = ioaddr; - *dev_out = dev; - return 0; - -err_out_free_res: - pci_release_regions(pdev); - -err_out_disable: - pci_disable_device(pdev); - -err_out: - free_netdev(dev); - return rc; -} - -static int __devinit -rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) -{ - struct net_device *dev = NULL; - struct rtl8169_private *tp = NULL; - void *ioaddr = NULL; - static int board_idx = -1; - static int printed_version = 0; - int i, rc; - int option = -1, Cap10_100 = 0, Cap1000 = 0; - - assert(pdev != NULL); - assert(ent != NULL); - - board_idx++; - - if (!printed_version) { - printk(KERN_INFO RTL8169_DRIVER_NAME " loaded\n"); - printed_version = 1; - } - - rc = rtl8169_init_board(pdev, &dev, &ioaddr); - if (rc) - return rc; - - tp = dev->priv; - assert(ioaddr != NULL); - assert(dev != NULL); - assert(tp != NULL); - - // Get MAC address. FIXME: read EEPROM - for (i = 0; i < MAC_ADDR_LEN; i++) - dev->dev_addr[i] = RTL_R8(MAC0 + i); - - dev->open = rtl8169_open; - dev->hard_start_xmit = rtl8169_start_xmit; - dev->get_stats = rtl8169_get_stats; - dev->ethtool_ops = &rtl8169_ethtool_ops; - dev->stop = rtl8169_close; - dev->tx_timeout = rtl8169_tx_timeout; - dev->set_multicast_list = rtl8169_set_rx_mode; - dev->watchdog_timeo = RTL8169_TX_TIMEOUT; - dev->irq = pdev->irq; - dev->base_addr = (unsigned long) ioaddr; -// dev->do_ioctl = mii_ioctl; - - tp = dev->priv; // private data // - tp->pci_dev = pdev; - tp->mmio_addr = ioaddr; - - spin_lock_init(&tp->lock); - - rc = register_netdev(dev); - if (rc) { - iounmap(ioaddr); - pci_release_regions(pdev); - pci_disable_device(pdev); - free_netdev(dev); - return rc; - } - - printk(KERN_DEBUG "%s: Identified chip type is '%s'.\n", dev->name, - rtl_chip_info[tp->chipset].name); - - pci_set_drvdata(pdev, dev); - - printk(KERN_INFO "%s: %s at 0x%lx, " - "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, " - "IRQ %d\n", - dev->name, - rtl_chip_info[ent->driver_data].name, - dev->base_addr, - dev->dev_addr[0], dev->dev_addr[1], - dev->dev_addr[2], dev->dev_addr[3], - dev->dev_addr[4], dev->dev_addr[5], dev->irq); - - rtl8169_hw_phy_config(dev); - - dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); - RTL_W8(0x82, 0x01); - - if (tp->mac_version < RTL_GIGA_MAC_VER_E) { - dprintk("Set PCI Latency=0x40\n"); - pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40); - } - - if (tp->mac_version == RTL_GIGA_MAC_VER_D) { - dprintk("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); - RTL_W8(0x82, 0x01); - dprintk("Set PHY Reg 0x0bh = 0x00h\n"); - mdio_write(ioaddr, 0x0b, 0x0000); //w 0x0b 15 0 0 - } - - // if TBI is not endbled - if (!(RTL_R8(PHYstatus) & TBI_Enable)) { - int val = mdio_read(ioaddr, PHY_AUTO_NEGO_REG); - - option = (board_idx >= MAX_UNITS) ? 0 : media[board_idx]; - // Force RTL8169 in 10/100/1000 Full/Half mode. - if (option > 0) { - printk(KERN_INFO "%s: Force-mode Enabled.\n", - dev->name); - Cap10_100 = 0, Cap1000 = 0; - switch (option) { - case _10_Half: - Cap10_100 = PHY_Cap_10_Half_Or_Less; - Cap1000 = PHY_Cap_Null; - break; - case _10_Full: - Cap10_100 = PHY_Cap_10_Full_Or_Less; - Cap1000 = PHY_Cap_Null; - break; - case _100_Half: - Cap10_100 = PHY_Cap_100_Half_Or_Less; - Cap1000 = PHY_Cap_Null; - break; - case _100_Full: - Cap10_100 = PHY_Cap_100_Full_Or_Less; - Cap1000 = PHY_Cap_Null; - break; - case _1000_Full: - Cap10_100 = PHY_Cap_100_Full_Or_Less; - Cap1000 = PHY_Cap_1000_Full; - break; - default: - break; - } - mdio_write(ioaddr, PHY_AUTO_NEGO_REG, Cap10_100 | (val & 0x1F)); //leave PHY_AUTO_NEGO_REG bit4:0 unchanged - mdio_write(ioaddr, PHY_1000_CTRL_REG, Cap1000); - } else { - printk(KERN_INFO "%s: Auto-negotiation Enabled.\n", - dev->name); - - // enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged - mdio_write(ioaddr, PHY_AUTO_NEGO_REG, - PHY_Cap_100_Full_Or_Less | (val & 0x1f)); - - // enable 1000 Full Mode - mdio_write(ioaddr, PHY_1000_CTRL_REG, - PHY_Cap_1000_Full); - - } - - // Enable auto-negotiation and restart auto-nigotiation - mdio_write(ioaddr, PHY_CTRL_REG, - PHY_Enable_Auto_Nego | PHY_Restart_Auto_Nego); - udelay(100); - - // wait for auto-negotiation process - for (i = 10000; i > 0; i--) { - //check if auto-negotiation complete - if (mdio_read(ioaddr, PHY_STAT_REG) & - PHY_Auto_Neco_Comp) { - udelay(100); - option = RTL_R8(PHYstatus); - if (option & _1000bpsF) { - printk(KERN_INFO - "%s: 1000Mbps Full-duplex operation.\n", - dev->name); - } else { - printk(KERN_INFO - "%s: %sMbps %s-duplex operation.\n", - dev->name, - (option & _100bps) ? "100" : - "10", - (option & FullDup) ? "Full" : - "Half"); - } - break; - } else { - udelay(100); - } - } // end for-loop to wait for auto-negotiation process - - } else { - udelay(100); - printk(KERN_INFO - "%s: 1000Mbps Full-duplex operation, TBI Link %s!\n", - dev->name, - (RTL_R32(TBICSR) & TBILinkOK) ? "OK" : "Failed"); - - } - - return 0; -} - -static void __devexit -rtl8169_remove_one(struct pci_dev *pdev) -{ - struct net_device *dev = pci_get_drvdata(pdev); - struct rtl8169_private *tp = dev->priv; - - assert(dev != NULL); - assert(tp != NULL); - - unregister_netdev(dev); - iounmap(tp->mmio_addr); - pci_release_regions(pdev); - - pci_disable_device(pdev); - free_netdev(dev); - pci_set_drvdata(pdev, NULL); -} - -#ifdef CONFIG_PM - -static int rtl8169_suspend(struct pci_dev *pdev, u32 state) -{ - struct net_device *dev = pci_get_drvdata(pdev); - struct rtl8169_private *tp = dev->priv; - void *ioaddr = tp->mmio_addr; - unsigned long flags; - - if (!netif_running(dev)) - return 0; - - netif_device_detach(dev); - netif_stop_queue(dev); - spin_lock_irqsave(&tp->lock, flags); - - /* Disable interrupts, stop Rx and Tx */ - RTL_W16(IntrMask, 0); - RTL_W8(ChipCmd, 0); - - /* Update the error counts. */ - tp->stats.rx_missed_errors += RTL_R32(RxMissed); - RTL_W32(RxMissed, 0); - spin_unlock_irqrestore(&tp->lock, flags); - - return 0; -} - -static int rtl8169_resume(struct pci_dev *pdev) -{ - struct net_device *dev = pci_get_drvdata(pdev); - - if (!netif_running(dev)) - return 0; - - netif_device_attach(dev); - rtl8169_hw_start(dev); - - return 0; -} - -#endif /* CONFIG_PM */ - -static int -rtl8169_open(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - struct pci_dev *pdev = tp->pci_dev; - int retval; - - retval = - request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); - if (retval < 0) - goto out; - - retval = -ENOMEM; - - /* - * Rx and Tx desscriptors needs 256 bytes alignment. - * pci_alloc_consistent provides more. - */ - tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES, - &tp->TxPhyAddr); - if (!tp->TxDescArray) - goto err_free_irq; - - tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES, - &tp->RxPhyAddr); - if (!tp->RxDescArray) - goto err_free_tx; - - retval = rtl8169_init_ring(dev); - if (retval < 0) - goto err_free_rx; - - rtl8169_hw_start(dev); - - rtl8169_request_timer(dev); -out: - return retval; - -err_free_rx: - pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, - tp->RxPhyAddr); -err_free_tx: - pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, - tp->TxPhyAddr); -err_free_irq: - free_irq(dev->irq, dev); - goto out; -} - -static void -rtl8169_hw_start(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - void *ioaddr = tp->mmio_addr; - u32 i; - - /* Soft reset the chip. */ - RTL_W8(ChipCmd, CmdReset); - - /* Check that the chip has finished the reset. */ - for (i = 1000; i > 0; i--) { - if ((RTL_R8(ChipCmd) & CmdReset) == 0) - break; - else - udelay(10); - } - - RTL_W8(Cfg9346, Cfg9346_Unlock); - RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); - RTL_W8(EarlyTxThres, EarlyTxThld); - - // For gigabit rtl8169 - RTL_W16(RxMaxSize, RxPacketMaxSize); - - // Set Rx Config register - i = rtl8169_rx_config | (RTL_R32(RxConfig) & rtl_chip_info[tp->chipset]. - RxConfigMask); - RTL_W32(RxConfig, i); - - /* Set DMA burst size and Interframe Gap Time */ - RTL_W32(TxConfig, - (TX_DMA_BURST << TxDMAShift) | (InterFrameGap << - TxInterFrameGapShift)); - tp->cp_cmd |= RTL_R16(CPlusCmd); - RTL_W16(CPlusCmd, tp->cp_cmd); - - if (tp->mac_version == RTL_GIGA_MAC_VER_D) { - dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14 MUST be 1\n"); - tp->cp_cmd |= (1 << 14) | PCIMulRW; - RTL_W16(CPlusCmd, tp->cp_cmd); - } - - tp->cur_rx = 0; - - RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK)); - RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32)); - RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK)); - RTL_W32(RxDescAddrHigh, ((u64) tp->RxPhyAddr >> 32)); - RTL_W8(Cfg9346, Cfg9346_Lock); - udelay(10); - - RTL_W32(RxMissed, 0); - - rtl8169_set_rx_mode(dev); - - /* no early-rx interrupts */ - RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xF000); - - /* Enable all known interrupts by setting the interrupt mask. */ - RTL_W16(IntrMask, rtl8169_intr_mask); - - netif_start_queue(dev); - -} - -static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) -{ - desc->addr = 0x0badbadbadbadbad; - desc->status &= ~cpu_to_le32(OWNbit | RsvdMask); -} - -static void rtl8169_free_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, - struct RxDesc *desc) -{ - pci_unmap_single(pdev, le64_to_cpu(desc->addr), RX_BUF_SIZE, - PCI_DMA_FROMDEVICE); - dev_kfree_skb(*sk_buff); - *sk_buff = NULL; - rtl8169_make_unusable_by_asic(desc); -} - -static inline void rtl8169_return_to_asic(struct RxDesc *desc) -{ - desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE); -} - -static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping) -{ - desc->addr = cpu_to_le64(mapping); - desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE); -} - -static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct net_device *dev, - struct sk_buff **sk_buff, struct RxDesc *desc) -{ - struct sk_buff *skb; - dma_addr_t mapping; - int ret = 0; - - skb = dev_alloc_skb(RX_BUF_SIZE); - if (!skb) - goto err_out; - - skb->dev = dev; - skb_reserve(skb, 2); - *sk_buff = skb; - - mapping = pci_map_single(pdev, skb->tail, RX_BUF_SIZE, - PCI_DMA_FROMDEVICE); - - rtl8169_give_to_asic(desc, mapping); - -out: - return ret; - -err_out: - ret = -ENOMEM; - rtl8169_make_unusable_by_asic(desc); - goto out; -} - -static void rtl8169_rx_clear(struct rtl8169_private *tp) -{ - int i; - - for (i = 0; i < NUM_RX_DESC; i++) { - if (tp->Rx_skbuff[i]) { - rtl8169_free_rx_skb(tp->pci_dev, tp->Rx_skbuff + i, - tp->RxDescArray + i); - } - } -} - -static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev, - u32 start, u32 end) -{ - u32 cur; - - for (cur = start; end - cur > 0; cur++) { - int ret, i = cur % NUM_RX_DESC; - - if (tp->Rx_skbuff[i]) - continue; - - ret = rtl8169_alloc_rx_skb(tp->pci_dev, dev, tp->Rx_skbuff + i, - tp->RxDescArray + i); - if (ret < 0) - break; - } - return cur - start; -} - -static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc) -{ - desc->status |= cpu_to_le32(EORbit); -} - -static int rtl8169_init_ring(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - - tp->cur_rx = tp->dirty_rx = 0; - tp->cur_tx = tp->dirty_tx = 0; - memset(tp->TxDescArray, 0x0, NUM_TX_DESC * sizeof (struct TxDesc)); - memset(tp->RxDescArray, 0x0, NUM_RX_DESC * sizeof (struct RxDesc)); - - memset(tp->Tx_skbuff, 0x0, NUM_TX_DESC * sizeof(struct sk_buff *)); - memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *)); - - if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC) - goto err_out; - - rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1); - - return 0; - -err_out: - rtl8169_rx_clear(tp); - return -ENOMEM; -} - -static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, - struct TxDesc *desc) -{ - u32 len = sk_buff[0]->len; - - pci_unmap_single(pdev, le64_to_cpu(desc->addr), - len < ETH_ZLEN ? ETH_ZLEN : len, PCI_DMA_TODEVICE); - desc->addr = 0x00; - *sk_buff = NULL; -} - -static void -rtl8169_tx_clear(struct rtl8169_private *tp) -{ - int i; - - tp->cur_tx = 0; - for (i = 0; i < NUM_TX_DESC; i++) { - struct sk_buff *skb = tp->Tx_skbuff[i]; - - if (skb) { - rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + i, - tp->TxDescArray + i); - dev_kfree_skb(skb); - tp->stats.tx_dropped++; - } - } -} - -static void -rtl8169_tx_timeout(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - void *ioaddr = tp->mmio_addr; - u8 tmp8; - - /* disable Tx, if not already */ - tmp8 = RTL_R8(ChipCmd); - if (tmp8 & CmdTxEnb) - RTL_W8(ChipCmd, tmp8 & ~CmdTxEnb); - - /* Disable interrupts by clearing the interrupt mask. */ - RTL_W16(IntrMask, 0x0000); - - /* Stop a shared interrupt from scavenging while we are. */ - spin_lock_irq(&tp->lock); - rtl8169_tx_clear(tp); - spin_unlock_irq(&tp->lock); - - /* ...and finally, reset everything */ - rtl8169_hw_start(dev); - - netif_wake_queue(dev); -} - -static int -rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - void *ioaddr = tp->mmio_addr; - int entry = tp->cur_tx % NUM_TX_DESC; - u32 len = skb->len; - - if (unlikely(skb->len < ETH_ZLEN)) { - skb = skb_padto(skb, ETH_ZLEN); - if (!skb) - goto err_update_stats; - len = ETH_ZLEN; - } - - spin_lock_irq(&tp->lock); - - if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) { - dma_addr_t mapping; - - mapping = pci_map_single(tp->pci_dev, skb->data, len, - PCI_DMA_TODEVICE); - - tp->Tx_skbuff[entry] = skb; - tp->TxDescArray[entry].addr = cpu_to_le64(mapping); - - tp->TxDescArray[entry].status = cpu_to_le32(OWNbit | FSbit | - LSbit | len | (EORbit * !((entry + 1) % NUM_TX_DESC))); - - RTL_W8(TxPoll, 0x40); //set polling bit - - dev->trans_start = jiffies; - - tp->cur_tx++; - } else - goto err_drop; - - - if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) { - netif_stop_queue(dev); - } -out: - spin_unlock_irq(&tp->lock); - - return 0; - -err_drop: - dev_kfree_skb(skb); -err_update_stats: - tp->stats.tx_dropped++; - goto out; -} - -static void -rtl8169_tx_interrupt(struct net_device *dev, struct rtl8169_private *tp, - void *ioaddr) -{ - unsigned long dirty_tx, tx_left = 0; - - assert(dev != NULL); - assert(tp != NULL); - assert(ioaddr != NULL); - - dirty_tx = tp->dirty_tx; - tx_left = tp->cur_tx - dirty_tx; - - while (tx_left > 0) { - int entry = dirty_tx % NUM_TX_DESC; - struct sk_buff *skb = tp->Tx_skbuff[entry]; - u32 status; - - rmb(); - status = le32_to_cpu(tp->TxDescArray[entry].status); - if (status & OWNbit) - break; - - /* FIXME: is it really accurate for TxErr ? */ - tp->stats.tx_bytes += skb->len >= ETH_ZLEN ? - skb->len : ETH_ZLEN; - tp->stats.tx_packets++; - rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + entry, - tp->TxDescArray + entry); - dev_kfree_skb_irq(skb); - dirty_tx++; - tx_left--; - } - - if (tp->dirty_tx != dirty_tx) { - tp->dirty_tx = dirty_tx; - if (netif_queue_stopped(dev)) - netif_wake_queue(dev); - } -} - -static inline int rtl8169_try_rx_copy(struct sk_buff **sk_buff, int pkt_size, - struct RxDesc *desc, - struct net_device *dev) -{ - int ret = -1; - - if (pkt_size < rx_copybreak) { - struct sk_buff *skb; - - skb = dev_alloc_skb(pkt_size + 2); - if (skb) { - skb->dev = dev; - skb_reserve(skb, 2); - eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0); - *sk_buff = skb; - rtl8169_return_to_asic(desc); - ret = 0; - } - } - return ret; -} - -static void -rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp, - void *ioaddr) -{ - unsigned long cur_rx, rx_left; - int delta; - - assert(dev != NULL); - assert(tp != NULL); - assert(ioaddr != NULL); - - cur_rx = tp->cur_rx; - rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; - - while (rx_left > 0) { - int entry = cur_rx % NUM_RX_DESC; - u32 status; - - rmb(); - status = le32_to_cpu(tp->RxDescArray[entry].status); - - if (status & OWNbit) - break; - - if (status & RxRES) { - printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); - tp->stats.rx_errors++; - if (status & (RxRWT | RxRUNT)) - tp->stats.rx_length_errors++; - if (status & RxCRC) - tp->stats.rx_crc_errors++; - } else { - struct RxDesc *desc = tp->RxDescArray + entry; - struct sk_buff *skb = tp->Rx_skbuff[entry]; - int pkt_size = (status & 0x00001FFF) - 4; - - pci_dma_sync_single(tp->pci_dev, le64_to_cpu(desc->addr), - RX_BUF_SIZE, PCI_DMA_FROMDEVICE); - - if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) { - pci_unmap_single(tp->pci_dev, le64_to_cpu(desc->addr), - RX_BUF_SIZE, PCI_DMA_FROMDEVICE); - tp->Rx_skbuff[entry] = NULL; - } - - - skb_put(skb, pkt_size); - skb->protocol = eth_type_trans(skb, dev); - netif_rx(skb); - - dev->last_rx = jiffies; - tp->stats.rx_bytes += pkt_size; - tp->stats.rx_packets++; - } - - cur_rx++; - rx_left--; - } - - tp->cur_rx = cur_rx; - - delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); - if (delta > 0) - tp->dirty_rx += delta; - else if (delta < 0) - printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name); - - /* - * FIXME: until there is periodic timer to try and refill the ring, - * a temporary shortage may definitely kill the Rx process. - * - disable the asic to try and avoid an overflow and kick it again - * after refill ? - * - how do others driver handle this condition (Uh oh...). - */ - if (tp->dirty_rx + NUM_RX_DESC == tp->cur_rx) - printk(KERN_EMERG "%s: Rx buffers exhausted\n", dev->name); -} - -/* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ -static irqreturn_t -rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs) -{ - struct net_device *dev = (struct net_device *) dev_instance; - struct rtl8169_private *tp = dev->priv; - int boguscnt = max_interrupt_work; - void *ioaddr = tp->mmio_addr; - int status = 0; - int handled = 0; - - do { - status = RTL_R16(IntrStatus); - - /* hotplug/major error/no more work/shared irq */ - if ((status == 0xFFFF) || !status) - break; - - handled = 1; -/* - if (status & RxUnderrun) - link_changed = RTL_R16 (CSCR) & CSCR_LinkChangeBit; -*/ - RTL_W16(IntrStatus, - (status & RxFIFOOver) ? (status | RxOverflow) : status); - - if (!(status & rtl8169_intr_mask)) - break; - - // Rx interrupt - if (status & (RxOK | RxUnderrun | RxOverflow | RxFIFOOver)) { - rtl8169_rx_interrupt(dev, tp, ioaddr); - } - // Tx interrupt - if (status & (TxOK | TxErr)) { - spin_lock(&tp->lock); - rtl8169_tx_interrupt(dev, tp, ioaddr); - spin_unlock(&tp->lock); - } - - boguscnt--; - } while (boguscnt > 0); - - if (boguscnt <= 0) { - printk(KERN_WARNING "%s: Too much work at interrupt!\n", - dev->name); - /* Clear all interrupt sources. */ - RTL_W16(IntrStatus, 0xffff); - } - return IRQ_RETVAL(handled); -} - -static int -rtl8169_close(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - struct pci_dev *pdev = tp->pci_dev; - void *ioaddr = tp->mmio_addr; - - netif_stop_queue(dev); - - rtl8169_delete_timer(dev); - - spin_lock_irq(&tp->lock); - - /* Stop the chip's Tx and Rx DMA processes. */ - RTL_W8(ChipCmd, 0x00); - - /* Disable interrupts by clearing the interrupt mask. */ - RTL_W16(IntrMask, 0x0000); - - /* Update the error counts. */ - tp->stats.rx_missed_errors += RTL_R32(RxMissed); - RTL_W32(RxMissed, 0); - - spin_unlock_irq(&tp->lock); - - synchronize_irq(); - free_irq(dev->irq, dev); - - rtl8169_tx_clear(tp); - - rtl8169_rx_clear(tp); - - pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, - tp->RxPhyAddr); - pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, - tp->TxPhyAddr); - tp->TxDescArray = NULL; - tp->RxDescArray = NULL; - - return 0; -} - -static void -rtl8169_set_rx_mode(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - void *ioaddr = tp->mmio_addr; - unsigned long flags; - u32 mc_filter[2]; /* Multicast hash filter */ - int i, rx_mode; - u32 tmp = 0; - - if (dev->flags & IFF_PROMISC) { - /* Unconditionally log net taps. */ - printk(KERN_NOTICE "%s: Promiscuous mode enabled.\n", - dev->name); - rx_mode = - AcceptBroadcast | AcceptMulticast | AcceptMyPhys | - AcceptAllPhys; - mc_filter[1] = mc_filter[0] = 0xffffffff; - } else if ((dev->mc_count > multicast_filter_limit) - || (dev->flags & IFF_ALLMULTI)) { - /* Too many to filter perfectly -- accept all multicasts. */ - rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; - mc_filter[1] = mc_filter[0] = 0xffffffff; - } else { - struct dev_mc_list *mclist; - rx_mode = AcceptBroadcast | AcceptMyPhys; - mc_filter[1] = mc_filter[0] = 0; - for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; - i++, mclist = mclist->next) { - int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; - mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); - rx_mode |= AcceptMulticast; - } - } - - spin_lock_irqsave(&tp->lock, flags); - - tmp = - rtl8169_rx_config | rx_mode | (RTL_R32(RxConfig) & - rtl_chip_info[tp->chipset]. - RxConfigMask); - - RTL_W32(RxConfig, tmp); - RTL_W32(MAR0 + 0, mc_filter[0]); - RTL_W32(MAR0 + 4, mc_filter[1]); - - spin_unlock_irqrestore(&tp->lock, flags); -} - -/** - * rtl8169_get_stats - Get rtl8169 read/write statistics - * @dev: The Ethernet Device to get statistics for - * - * Get TX/RX statistics for rtl8169 - */ -static struct net_device_stats *rtl8169_get_stats(struct net_device *dev) -{ - struct rtl8169_private *tp = dev->priv; - void *ioaddr = tp->mmio_addr; - unsigned long flags; - - if (netif_running(dev)) { - spin_lock_irqsave(&tp->lock, flags); - tp->stats.rx_missed_errors += RTL_R32(RxMissed); - RTL_W32(RxMissed, 0); - spin_unlock_irqrestore(&tp->lock, flags); - } - - return &tp->stats; -} - -static struct pci_driver rtl8169_pci_driver = { - .name = MODULENAME, - .id_table = rtl8169_pci_tbl, - .probe = rtl8169_init_one, - .remove = __devexit_p(rtl8169_remove_one), -#ifdef CONFIG_PM - .suspend = rtl8169_suspend, - .resume = rtl8169_resume, -#endif -}; - -static int __init -rtl8169_init_module(void) -{ - return pci_module_init(&rtl8169_pci_driver); -} - -static void __exit -rtl8169_cleanup_module(void) -{ - pci_unregister_driver(&rtl8169_pci_driver); -} - -module_init(rtl8169_init_module); -module_exit(rtl8169_cleanup_module); +/* +========================================================================= + r8169.c: A RealTek RTL8169s/8110s Gigabit Ethernet driver for Linux kernel 2.4.x. + -------------------------------------------------------------------- + + History: + Feb 4 2002 - created initially by ShuChen . + May 20 2002 - Add link status force-mode and TBI mode support. +========================================================================= + +RTL8169_VERSION "1.1" <2002/10/4> + + The bit4:0 of MII register 4 is called "selector field", and have to be + 00001b to indicate support of IEEE std 802.3 during NWay process of + exchanging Link Code Word (FLP). + +RTL8169_VERSION "1.2" <2003/6/17> + Update driver module name. + Modify ISR. + Add chip mcfg. + +RTL8169_VERSION "1.3" <2003/6/20> + Add chip pcfg. + Add priv->phy_timer_t, rtl8169_phy_timer_t_handler() + Add rtl8169_hw_PHY_config() + Add rtl8169_hw_PHY_reset() + +RTL8169_VERSION "1.4" <2003/7/14> + Add tx_bytes, rx_bytes. + +RTL8169_VERSION "1.5" <2003/7/18> + Set 0x0000 to PHY at offset 0x0b. + Modify chip mcfg, pcfg + Force media for multiple card. +RTL8169_VERSION "1.6" <2003/8/25> + Modify receive data buffer. + +RTL8169_VERSION "1.7" <2003/9/18> + Add Jumbo Frame support. + +RTL8169_VERSION "1.8" <2003/10/21> + Performance and CPU Utilizaion Enhancement. + +RTL8169_VERSION "1.9" <2003/12/29> + Enable Tx/Rx flow control. + +RTL8169_VERSION "2.0" <2004/03/26> + Beta version. + Support for linux 2.6.x + +RTL8169_VERSION "2.1" <2004/07/05> + Modify parameters. + +RTL8169_VERSION "2.2" <2004/08/09> + Add.pci_dma_sync_single. + Add pci_alloc_consistent()/pci_free_consistent(). + Revise parameters. + Recognize our interrupt for linux 2.6.x. +*/ + + +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef CONFIG_LINKSTATION +#include +#endif + +#define RTL8169_VERSION "2.3" +#define MODULENAME "RTL8169s/8110s" +#define RTL8169_DRIVER_NAME MODULENAME " Gigabit Ethernet driver " RTL8169_VERSION +#define PFX MODULENAME ": " + + +#undef RTL8169_DEBUG +#undef RTL8169_JUMBO_FRAME_SUPPORT +#undef RTL8169_HW_FLOW_CONTROL_SUPPORT + + +#undef RTL8169_IOCTL_SUPPORT +#undef RTL8169_DYNAMIC_CONTROL +#define RTL8169_USE_IO + + +#ifdef RTL8169_DEBUG + #define assert(expr) \ + if(!(expr)) { printk( "Assertion failed! %s,%s,%s,line=%d\n", #expr,__FILE__,__FUNCTION__,__LINE__); } + #define DBG_PRINT( fmt, args...) printk("r8169: " fmt, ## args); +#else + #define assert(expr) do {} while (0) + #define DBG_PRINT( fmt, args...) ; +#endif // end of #ifdef RTL8169_DEBUG + + +/* media options */ +#define MAX_UNITS 8 +static int media[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; + +/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ +static int max_interrupt_work = 20; + +/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). + The RTL chips use a 64 element hash table based on the Ethernet CRC. */ +static int multicast_filter_limit = 32; + +/* MAC address length*/ +#define MAC_ADDR_LEN 6 + +#define RX_FIFO_THRESH 7 /* 7 means NO threshold, Rx buffer level before first PCI xfer. */ +#define RX_DMA_BURST 7 /* Maximum PCI burst, '6' is 1024 */ +#define TX_DMA_BURST 7 /* Maximum PCI burst, '6' is 1024 */ +#define ETTh 0x3F /* 0x3F means NO threshold */ + +#define ETH_HDR_LEN 14 +#define DEFAULT_MTU 1500 +#define DEFAULT_RX_BUF_LEN 1536 + + +#ifdef RTL8169_JUMBO_FRAME_SUPPORT +#define MAX_JUMBO_FRAME_MTU ( 10000 ) +#define MAX_RX_SKBDATA_SIZE ( MAX_JUMBO_FRAME_MTU + ETH_HDR_LEN ) +#else +#define MAX_RX_SKBDATA_SIZE 1600 +#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT + + +#define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ + +//#define NUM_TX_DESC 64 /* Number of Tx descriptor registers*/ +//#define NUM_RX_DESC 64 /* Number of Rx descriptor registers*/ +#define NUM_TX_DESC 1024 /* Number of Tx descriptor registers*/ +#define NUM_RX_DESC 1024 /* Number of Rx descriptor registers*/ + +#define RTL_MIN_IO_SIZE 0x80 +#define TX_TIMEOUT (6*HZ) +#define RTL8169_TIMER_EXPIRE_TIME 100 //100 + + +#ifdef RTL8169_USE_IO +#define RTL_W8(reg, val8) outb ((val8), ioaddr + (reg)) +#define RTL_W16(reg, val16) outw ((val16), ioaddr + (reg)) +#define RTL_W32(reg, val32) outl ((val32), ioaddr + (reg)) +#define RTL_R8(reg) inb (ioaddr + (reg)) +#define RTL_R16(reg) inw (ioaddr + (reg)) +#define RTL_R32(reg) ((unsigned long) inl (ioaddr + (reg))) +#else +/* write/read MMIO register */ +#define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) +#define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg)) +#define RTL_W32(reg, val32) writel ((val32), ioaddr + (reg)) +#define RTL_R8(reg) readb (ioaddr + (reg)) +#define RTL_R16(reg) readw (ioaddr + (reg)) +#define RTL_R32(reg) ((unsigned long) readl (ioaddr + (reg))) +#endif + +#define MCFG_METHOD_1 0x01 +#define MCFG_METHOD_2 0x02 +#define MCFG_METHOD_3 0x03 +#define MCFG_METHOD_4 0x04 + +#define PCFG_METHOD_1 0x01 //PHY Reg 0x03 bit0-3 == 0x0000 +#define PCFG_METHOD_2 0x02 //PHY Reg 0x03 bit0-3 == 0x0001 +#define PCFG_METHOD_3 0x03 //PHY Reg 0x03 bit0-3 == 0x0002 + + +#ifdef RTL8169_DYNAMIC_CONTROL +#include "r8169_callback.h" +#endif //end #ifdef RTL8169_DYNAMIC_CONTROL + + +const static struct { + const char *name; + u8 mcfg; /* depend on RTL8169 docs */ + u32 RxConfigMask; /* should clear the bits supported by this chip */ +} rtl_chip_info[] = { + { "RTL8169", MCFG_METHOD_1, 0xff7e1880 }, + { "RTL8169s/8110s", MCFG_METHOD_2, 0xff7e1880 }, + { "RTL8169s/8110s", MCFG_METHOD_3, 0xff7e1880 }, +}; + + +static struct pci_device_id rtl8169_pci_tbl[] __devinitdata = { + { 0x10ec, 0x8169, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, + {0,}, +}; + + +MODULE_DEVICE_TABLE (pci, rtl8169_pci_tbl); + + +enum RTL8169_registers { + MAC0 = 0x0, + MAR0 = 0x8, + TxDescStartAddr = 0x20, + TxHDescStartAddr= 0x28, + FLASH = 0x30, + ERSR = 0x36, + ChipCmd = 0x37, + TxPoll = 0x38, + IntrMask = 0x3C, + IntrStatus = 0x3E, + TxConfig = 0x40, + RxConfig = 0x44, + RxMissed = 0x4C, + Cfg9346 = 0x50, + Config0 = 0x51, + Config1 = 0x52, + Config2 = 0x53, + Config3 = 0x54, + Config4 = 0x55, + Config5 = 0x56, + MultiIntr = 0x5C, + PHYAR = 0x60, + TBICSR = 0x64, + TBI_ANAR = 0x68, + TBI_LPAR = 0x6A, + PHYstatus = 0x6C, + RxMaxSize = 0xDA, + CPlusCmd = 0xE0, + RxDescStartAddr = 0xE4, + ETThReg = 0xEC, + FuncEvent = 0xF0, + FuncEventMask = 0xF4, + FuncPresetState = 0xF8, + FuncForceEvent = 0xFC, +}; + +enum RTL8169_register_content { + /*InterruptStatusBits*/ + SYSErr = 0x8000, + PCSTimeout = 0x4000, + SWInt = 0x0100, + TxDescUnavail = 0x80, + RxFIFOOver = 0x40, + LinkChg = 0x20, + RxOverflow = 0x10, + TxErr = 0x08, + TxOK = 0x04, + RxErr = 0x02, + RxOK = 0x01, + + /*RxStatusDesc*/ + RxRES = 0x00200000, + RxCRC = 0x00080000, + RxRUNT= 0x00100000, + RxRWT = 0x00400000, + + /*ChipCmdBits*/ + CmdReset = 0x10, + CmdRxEnb = 0x08, + CmdTxEnb = 0x04, + RxBufEmpty = 0x01, + + /*Cfg9346Bits*/ + Cfg9346_Lock = 0x00, + Cfg9346_Unlock = 0xC0, + + /*rx_mode_bits*/ + AcceptErr = 0x20, + AcceptRunt = 0x10, + AcceptBroadcast = 0x08, + AcceptMulticast = 0x04, + AcceptMyPhys = 0x02, + AcceptAllPhys = 0x01, + + /*RxConfigBits*/ + RxCfgFIFOShift = 13, + RxCfgDMAShift = 8, + + /*TxConfigBits*/ + TxInterFrameGapShift = 24, + TxDMAShift = 8, + + /*rtl8169_PHYstatus*/ + TBI_Enable = 0x80, + TxFlowCtrl = 0x40, + RxFlowCtrl = 0x20, + _1000bpsF = 0x10, + _100bps = 0x08, + _10bps = 0x04, + LinkStatus = 0x02, + FullDup = 0x01, + + /*GIGABIT_PHY_registers*/ + PHY_CTRL_REG = 0, + PHY_STAT_REG = 1, + PHY_AUTO_NEGO_REG = 4, + PHY_1000_CTRL_REG = 9, + + /*GIGABIT_PHY_REG_BIT*/ + PHY_Restart_Auto_Nego = 0x0200, + PHY_Enable_Auto_Nego = 0x1000, + + //PHY_STAT_REG = 1; + PHY_Auto_Neco_Comp = 0x0020, + + //PHY_AUTO_NEGO_REG = 4; + PHY_Cap_10_Half = 0x0020, + PHY_Cap_10_Full = 0x0040, + PHY_Cap_100_Half = 0x0080, + PHY_Cap_100_Full = 0x0100, + + //PHY_1000_CTRL_REG = 9; + PHY_Cap_1000_Full = 0x0200, + PHY_Cap_1000_Half = 0x0100, + + PHY_Cap_PAUSE = 0x0400, + PHY_Cap_ASYM_PAUSE = 0x0800, + + PHY_Cap_Null = 0x0, + + /*_MediaType*/ + _10_Half = 0x01, + _10_Full = 0x02, + _100_Half = 0x04, + _100_Full = 0x08, + _1000_Full = 0x10, + + /*_TBICSRBit*/ + TBILinkOK = 0x02000000, +}; + + + +enum _DescStatusBit { + OWNbit = 0x80000000, + EORbit = 0x40000000, + FSbit = 0x20000000, + LSbit = 0x10000000, +}; + + +struct TxDesc { + u32 status; + u32 vlan_tag; + u32 buf_addr; + u32 buf_Haddr; +}; + +struct RxDesc { + u32 status; + u32 vlan_tag; + u32 buf_addr; + u32 buf_Haddr; +}; + + +typedef struct timer_list rt_timer_t; + + +struct rtl8169_private { + unsigned long ioaddr; /* memory map physical address*/ + struct pci_dev *pci_dev; /* Index of PCI device */ + struct net_device_stats stats; /* statistics of net device */ + spinlock_t lock; /* spin lock flag */ + int chipset; + int mcfg; + int pcfg; + rt_timer_t r8169_timer; + unsigned long expire_time; + + unsigned long phy_link_down_cnt; + unsigned long cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */ + unsigned long cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */ + unsigned long dirty_tx; + struct TxDesc *TxDescArray; /* Index of 256-alignment Tx Descriptor buffer */ + struct RxDesc *RxDescArray; /* Index of 256-alignment Rx Descriptor buffer */ + struct sk_buff *Tx_skbuff[NUM_TX_DESC];/* Index of Transmit data buffer */ + struct sk_buff *Rx_skbuff[NUM_RX_DESC];/* Receive data buffer */ + unsigned char drvinit_fail; + + dma_addr_t txdesc_array_dma_addr[NUM_TX_DESC]; + dma_addr_t rxdesc_array_dma_addr[NUM_RX_DESC]; + dma_addr_t rx_skbuff_dma_addr[NUM_RX_DESC]; + + void *txdesc_space; + dma_addr_t txdesc_phy_dma_addr; + int sizeof_txdesc_space; + + void *rxdesc_space; + dma_addr_t rxdesc_phy_dma_addr; + int sizeof_rxdesc_space; + + int curr_mtu_size; + int tx_pkt_len; + int rx_pkt_len; + + int hw_rx_pkt_len; + +#ifdef RTL8169_DYNAMIC_CONTROL + struct r8169_cb_t rt; +#endif //end #ifdef RTL8169_DYNAMIC_CONTROL + + unsigned char linkstatus; +}; + + +MODULE_AUTHOR ("Realtek"); +MODULE_DESCRIPTION ("RealTek RTL-8169 Gigabit Ethernet driver"); +MODULE_PARM (media, "1-" __MODULE_STRING(MAX_UNITS) "i"); +MODULE_LICENSE("GPL"); + + +static int rtl8169_open (struct net_device *dev); +static int rtl8169_start_xmit (struct sk_buff *skb, struct net_device *dev); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +/* typedef int irqreturn_t; */ +#define IRQ_NONE 0 +#define IRQ_HANDLED 1 +static void rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs); +#else +static irqreturn_t rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs); +#endif + +static void rtl8169_init_ring (struct net_device *dev); +static void rtl8169_hw_start (struct net_device *dev); +static int rtl8169_close (struct net_device *dev); +static inline u32 ether_crc (int length, unsigned char *data); +static void rtl8169_set_rx_mode (struct net_device *dev); +static void rtl8169_tx_timeout (struct net_device *dev); +static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); + +#ifdef RTL8169_JUMBO_FRAME_SUPPORT +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu); +#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT + +static void rtl8169_hw_PHY_config (struct net_device *dev); +static void rtl8169_hw_PHY_reset(struct net_device *dev); +static const u16 rtl8169_intr_mask = LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK ; +static const unsigned int rtl8169_rx_config = (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift) | 0x0000000E; + + +#define RTL8169_WRITE_GMII_REG_BIT( ioaddr, reg, bitnum, bitval )\ +{ \ + int val; \ + if( bitval == 1 ){ val = ( RTL8169_READ_GMII_REG( ioaddr, reg ) | (bitval< 0 ; i -- ){ + // Check if the RTL8169 has completed writing to the specified MII register + if( ! (RTL_R32(PHYAR)&0x80000000) ){ + break; + } + else{ + udelay(100); + }// end of if( ! (RTL_R32(PHYAR)&0x80000000) ) + }// end of for() loop +} +//================================================================= +int RTL8169_READ_GMII_REG( unsigned long ioaddr, int RegAddr ) +{ + int i, value = -1; + + RTL_W32 ( PHYAR, 0x0 | (RegAddr&0xFF)<<16 ); + udelay(1000); + + for( i = 2000; i > 0 ; i -- ){ + // Check if the RTL8169 has completed retrieving data from the specified MII register + if( RTL_R32(PHYAR) & 0x80000000 ){ + value = (int)( RTL_R32(PHYAR)&0xFFFF ); + break; + } + else{ + udelay(100); + }// end of if( RTL_R32(PHYAR) & 0x80000000 ) + }// end of for() loop + return value; +} + + +#ifdef RTL8169_IOCTL_SUPPORT +#include "r8169_ioctl.c" +#endif //end #ifdef RTL8169_IOCTL_SUPPORT + + +#ifdef RTL8169_DYNAMIC_CONTROL +#include "r8169_callback.c" +#endif + + + +#define rtl8169_request_timer( timer, timer_expires, timer_func, timer_data ) \ +{ \ + init_timer(timer); \ + timer->expires = (unsigned long)(jiffies + timer_expires); \ + timer->data = (unsigned long)(timer_data); \ + timer->function = (void *)(timer_func); \ + add_timer(timer); \ + DBG_PRINT("request_timer at 0x%08lx\n", (unsigned long)timer); \ +} + +#define rtl8169_delete_timer( del_timer_t ) \ +{ \ + del_timer(del_timer_t); \ + DBG_PRINT("delete_timer at 0x%08lx\n", (unsigned long)del_timer_t); \ +} + +#define rtl8169_mod_timer( timer, timer_expires ) \ +{ \ + mod_timer( timer, jiffies + timer_expires ); \ +} + + + + +//====================================================================================================== +//====================================================================================================== +void rtl8169_phy_timer_t_handler( void *timer_data ) +{ + struct net_device *dev = (struct net_device *)timer_data; + struct rtl8169_private *priv = (struct rtl8169_private *) (dev->priv); + unsigned long ioaddr = priv->ioaddr; + + assert( priv->mcfg > MCFG_METHOD_1 ); + assert( priv->pcfg < PCFG_METHOD_3 ); + + if( RTL_R8(PHYstatus) & LinkStatus ){ + priv->phy_link_down_cnt = 0 ; + } + else{ + priv->phy_link_down_cnt ++ ; + if( priv->phy_link_down_cnt >= 12 ){ + // If link on 1000, perform phy reset. + if( RTL8169_READ_GMII_REG( ioaddr, PHY_1000_CTRL_REG ) & PHY_Cap_1000_Full ) + { + DBG_PRINT("rtl8169_hw_PHY_reset\n"); + rtl8169_hw_PHY_reset( dev ); + } + + priv->phy_link_down_cnt = 0 ; + } + } + + //--------------------------------------------------------------------------- + //mod_timer is a more efficient way to update the expire field of an active timer. + //--------------------------------------------------------------------------- +// rtl8169_mod_timer( (&priv->phy_timer_t), 100 ); +} + + + +//====================================================================================================== +//====================================================================================================== +void rtl8169_timer_handler( void *timer_data ) +{ + struct net_device *dev = (struct net_device *)timer_data; + struct rtl8169_private *priv = (struct rtl8169_private *) (dev->priv); + + if( (priv->mcfg > MCFG_METHOD_1) && (priv->pcfg < PCFG_METHOD_3) ){ + DBG_PRINT("FIX PCS -> rtl8169_phy_timer_t_handler\n"); + priv->phy_link_down_cnt = 0; + rtl8169_phy_timer_t_handler( timer_data ); + } + + +#ifdef RTL8169_DYNAMIC_CONTROL + { + struct r8169_cb_t *rt = &(priv->rt); + if( priv->linkstatus == _1000_Full ){ + r8169_callback(rt); + } + } +#endif //end #ifdef RTL8169_DYNAMIC_CONTROL + + + rtl8169_mod_timer( (&priv->r8169_timer), priv->expire_time ); +} + + + +//====================================================================================================== +//====================================================================================================== +static int __devinit rtl8169_init_board ( struct pci_dev *pdev, struct net_device **dev_out, unsigned long *ioaddr_out) +{ + unsigned long ioaddr = 0; + struct net_device *dev; + struct rtl8169_private *priv; + int rc, i; + unsigned long mmio_start, mmio_end, mmio_flags, mmio_len; + + + assert (pdev != NULL); + assert (ioaddr_out != NULL); + + *ioaddr_out = 0; + *dev_out = NULL; + + // dev zeroed in init_etherdev +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) + dev = init_etherdev (NULL, sizeof (*priv)); +#else + dev = alloc_etherdev (sizeof (*priv)); +#endif + + if (dev == NULL) { + printk (KERN_ERR PFX "unable to alloc new ethernet\n"); + return -ENOMEM; + } + + SET_MODULE_OWNER(dev); + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + SET_NETDEV_DEV(dev, &pdev->dev); +#endif + + priv = dev->priv; + + // enable device (incl. PCI PM wakeup and hotplug setup) + rc = pci_enable_device (pdev); + if (rc) + goto err_out; + + mmio_start = pci_resource_start (pdev, 1); + mmio_end = pci_resource_end (pdev, 1); + mmio_flags = pci_resource_flags (pdev, 1); + mmio_len = pci_resource_len (pdev, 1); + + // make sure PCI base addr 1 is MMIO + if (!(mmio_flags & IORESOURCE_MEM)) { + printk (KERN_ERR PFX "region #1 not an MMIO resource, aborting\n"); + rc = -ENODEV; + goto err_out; + } + + // check for weird/broken PCI region reporting + if ( mmio_len < RTL_MIN_IO_SIZE ) { + printk (KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); + rc = -ENODEV; + goto err_out; + } + + + rc = pci_request_regions (pdev, dev->name); + if (rc) + goto err_out; + + // enable PCI bus-mastering + pci_set_master (pdev); + +#ifdef RTL8169_USE_IO + ioaddr = pci_resource_start(pdev, 0); +#else + // ioremap MMIO region + ioaddr = (unsigned long)ioremap (mmio_start, mmio_len); + if (ioaddr == 0) { + printk (KERN_ERR PFX "cannot remap MMIO, aborting\n"); + rc = -EIO; + goto err_out_free_res; + } +#endif + + // Soft reset the chip. + RTL_W8 ( ChipCmd, CmdReset); + + // Check that the chip has finished the reset. + for (i = 1000; i > 0; i--){ + if ( (RTL_R8(ChipCmd) & CmdReset) == 0){ + break; + } + else{ + udelay (10); + } + } + + // identify config method + { + unsigned long val32 = (RTL_R32(TxConfig)&0x7c800000); + + if( val32 == (0x1<<28) ){ + priv->mcfg = MCFG_METHOD_4; + } + else if( val32 == (0x1<<26) ){ + priv->mcfg = MCFG_METHOD_3; + } + else if( val32 == (0x1<<23) ){ + priv->mcfg = MCFG_METHOD_2; + } + else if( val32 == 0x00000000 ){ + priv->mcfg = MCFG_METHOD_1; + } + else{ + priv->mcfg = MCFG_METHOD_1; + } + } + { + unsigned char val8 = (unsigned char)(RTL8169_READ_GMII_REG(ioaddr,3)&0x000f); + if( val8 == 0x00 ){ + priv->pcfg = PCFG_METHOD_1; + } + else if( val8 == 0x01 ){ + priv->pcfg = PCFG_METHOD_2; + } + else if( val8 == 0x02 ){ + priv->pcfg = PCFG_METHOD_3; + } + else{ + priv->pcfg = PCFG_METHOD_3; + } + } + + + for (i = ARRAY_SIZE (rtl_chip_info) - 1; i >= 0; i--){ + if (priv->mcfg == rtl_chip_info[i].mcfg) { + priv->chipset = i; + goto match; + } + } + + //if unknown chip, assume array element #0, original RTL-8169 in this case +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + printk (KERN_DEBUG PFX "PCI device %s: unknown chip version, assuming RTL-8169\n", pdev->slot_name); +#endif + priv->chipset = 0; + +match: + *ioaddr_out = ioaddr; + *dev_out = dev; + return 0; + +#ifndef RTL8169_USE_IO +err_out_free_res: + pci_release_regions (pdev); +#endif + +err_out: + unregister_netdev (dev); + kfree (dev); + return rc; +} + + + + + + + +//====================================================================================================== +static int __devinit rtl8169_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) +{ + struct net_device *dev = NULL; + struct rtl8169_private *priv = NULL; + unsigned long ioaddr = 0; + static int board_idx = -1; + int i; + int option = -1, Cap10_100 = 0, Cap1000 = 0; + + + assert (pdev != NULL); + assert (ent != NULL); + + board_idx++; + + + i = rtl8169_init_board (pdev, &dev, &ioaddr); + if (i < 0) { + return i; + } + + priv = dev->priv; + + assert (ioaddr != NULL); + assert (dev != NULL); + assert (priv != NULL); + + // Get MAC address // + for (i = 0; i < MAC_ADDR_LEN ; i++){ + dev->dev_addr[i] = RTL_R8( MAC0 + i ); + } + + dev->open = rtl8169_open; + dev->hard_start_xmit = rtl8169_start_xmit; + dev->get_stats = rtl8169_get_stats; + dev->stop = rtl8169_close; + dev->tx_timeout = rtl8169_tx_timeout; + dev->set_multicast_list = rtl8169_set_rx_mode; + dev->watchdog_timeo = TX_TIMEOUT; + dev->irq = pdev->irq; + dev->base_addr = (unsigned long) ioaddr; + +#ifdef RTL8169_JUMBO_FRAME_SUPPORT + dev->change_mtu = rtl8169_change_mtu; +#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT + +#ifdef RTL8169_IOCTL_SUPPORT + dev->do_ioctl = rtl8169_ioctl; +#endif //end #ifdef RTL8169_IOCTL_SUPPORT + +#ifdef RTL8169_DYNAMIC_CONTROL + priv->rt.dev = dev; +#endif //end #ifdef RTL8169_DYNAMIC_CONTROL + + priv = dev->priv; // private data // + priv->pci_dev = pdev; + priv->ioaddr = ioaddr; + +//#ifdef RTL8169_JUMBO_FRAME_SUPPORT + priv->curr_mtu_size = dev->mtu; + priv->tx_pkt_len = dev->mtu + ETH_HDR_LEN; + priv->rx_pkt_len = dev->mtu + ETH_HDR_LEN; + priv->hw_rx_pkt_len = priv->rx_pkt_len + 8; +//#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT + + DBG_PRINT("-------------------------- \n"); + DBG_PRINT("dev->mtu = %d \n", dev->mtu); + DBG_PRINT("priv->curr_mtu_size = %d \n", priv->curr_mtu_size); + DBG_PRINT("priv->tx_pkt_len = %d \n", priv->tx_pkt_len); + DBG_PRINT("priv->rx_pkt_len = %d \n", priv->rx_pkt_len); + DBG_PRINT("priv->hw_rx_pkt_len = %d \n", priv->hw_rx_pkt_len); + DBG_PRINT("-------------------------- \n"); + + spin_lock_init (&priv->lock); + + register_netdev (dev); + + pci_set_drvdata(pdev, dev); // pdev->driver_data = data; + + + printk (KERN_DEBUG "%s: Identified chip type is '%s'.\n",dev->name,rtl_chip_info[priv->chipset].name); + printk (KERN_INFO "%s: %s at 0x%lx, " + "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, " + "IRQ %d\n", + dev->name, + RTL8169_DRIVER_NAME, + dev->base_addr, + dev->dev_addr[0], dev->dev_addr[1], + dev->dev_addr[2], dev->dev_addr[3], + dev->dev_addr[4], dev->dev_addr[5], + dev->irq); + + + // Config PHY + rtl8169_hw_PHY_config(dev); + + DBG_PRINT("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); + RTL_W8( 0x82, 0x01 ); + + if( priv->mcfg < MCFG_METHOD_3 ){ + DBG_PRINT("Set PCI Latency=0x40\n"); + pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0x40); + } + + if( priv->mcfg == MCFG_METHOD_2 ){ + DBG_PRINT("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); + RTL_W8( 0x82, 0x01 ); + DBG_PRINT("Set PHY Reg 0x0bh = 0x00h\n"); + RTL8169_WRITE_GMII_REG( ioaddr, 0x0b, 0x0000 ); //w 0x0b 15 0 0 + } + + // if TBI is not endbled + if( !(RTL_R8(PHYstatus) & TBI_Enable) ){ + int val = RTL8169_READ_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG ); + +#ifdef RTL8169_HW_FLOW_CONTROL_SUPPORT + val |= PHY_Cap_PAUSE | PHY_Cap_ASYM_PAUSE ; +#endif //end #define RTL8169_HW_FLOW_CONTROL_SUPPORT + + option = (board_idx >= MAX_UNITS) ? 0 : media[board_idx]; + // Force RTL8169 in 10/100/1000 Full/Half mode. + if( option > 0 ){ + printk(KERN_INFO "%s: Force-mode Enabled. \n", dev->name); + Cap10_100 = 0; + Cap1000 = 0; + switch( option ){ + case _10_Half: + Cap10_100 = PHY_Cap_10_Half; + Cap1000 = PHY_Cap_Null; + break; + case _10_Full: + Cap10_100 = PHY_Cap_10_Full | PHY_Cap_10_Half; + Cap1000 = PHY_Cap_Null; + break; + case _100_Half: + Cap10_100 = PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half; + Cap1000 = PHY_Cap_Null; + break; + case _100_Full: + Cap10_100 = PHY_Cap_100_Full | PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half; + Cap1000 = PHY_Cap_Null; + break; + case _1000_Full: + Cap10_100 = PHY_Cap_100_Full | PHY_Cap_100_Half | PHY_Cap_10_Full | PHY_Cap_10_Half; + Cap1000 = PHY_Cap_1000_Full; + break; + default: + break; + } + RTL8169_WRITE_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG, Cap10_100 | ( val&0xC1F ) ); //leave PHY_AUTO_NEGO_REG bit4:0 unchanged + RTL8169_WRITE_GMII_REG( ioaddr, PHY_1000_CTRL_REG, Cap1000 ); + } + else{ + printk(KERN_INFO "%s: Auto-negotiation Enabled.\n", dev->name); + + // enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged + RTL8169_WRITE_GMII_REG( ioaddr, PHY_AUTO_NEGO_REG, + PHY_Cap_10_Half | PHY_Cap_10_Full | PHY_Cap_100_Half | PHY_Cap_100_Full | ( val&0xC1F ) ); + + // enable 1000 Full Mode +// RTL8169_WRITE_GMII_REG( ioaddr, PHY_1000_CTRL_REG, PHY_Cap_1000_Full ); + RTL8169_WRITE_GMII_REG( ioaddr, PHY_1000_CTRL_REG, PHY_Cap_1000_Full | PHY_Cap_1000_Half); //rtl8168 + + }// end of if( option > 0 ) + + // Enable auto-negotiation and restart auto-nigotiation + RTL8169_WRITE_GMII_REG( ioaddr, PHY_CTRL_REG, PHY_Enable_Auto_Nego | PHY_Restart_Auto_Nego ); + udelay(100); + +#if defined(CONFIG_LINKSTATION) + miconCntl_Eth1000M(0); + miconCntl_Eth100M(0); + miconCntl_Eth10M(0); +#endif + + // wait for auto-negotiation process + for( i = 10000; i > 0; i-- ){ + //check if auto-negotiation complete + if( RTL8169_READ_GMII_REG(ioaddr, PHY_STAT_REG) & PHY_Auto_Neco_Comp ){ + udelay(100); + option = RTL_R8(PHYstatus); +#if defined(CONFIG_LINKSTATION) + if( option & _1000bpsF ) { // 1000Mbps + miconCntl_Eth1000M(1); + } else if( option & _100bps ) { + miconCntl_Eth100M(1); + } else if( option & _10bps ) { + miconCntl_Eth10M(1); + } +#endif + if( option & _1000bpsF ){ + printk(KERN_INFO "%s: 1000Mbps Full-duplex operation.\n", dev->name); + } + else{ + printk(KERN_INFO "%s: %sMbps %s-duplex operation.\n", dev->name, + (option & _100bps) ? "100" : "10", (option & FullDup) ? "Full" : "Half" ); + } + break; + } + else{ + udelay(100); + }// end of if( RTL8169_READ_GMII_REG(ioaddr, 1) & 0x20 ) + }// end for-loop to wait for auto-negotiation process + + option = RTL_R8(PHYstatus); + if( option & _1000bpsF ){ + priv->linkstatus = _1000_Full; + } + else{ + if(option & _100bps){ + priv->linkstatus = (option & FullDup) ? _100_Full : _100_Half; + } + else{ + priv->linkstatus = (option & FullDup) ? _10_Full : _10_Half; + } + } + DBG_PRINT("priv->linkstatus = 0x%02x\n", priv->linkstatus); + + }// end of TBI is not enabled + else{ + udelay(100); + DBG_PRINT("1000Mbps Full-duplex operation, TBI Link %s!\n",(RTL_R32(TBICSR) & TBILinkOK) ? "OK" : "Failed" ); + + }// end of TBI is not enabled + + return 0; +} + + + + + + + +//====================================================================================================== +static void __devexit rtl8169_remove_one (struct pci_dev *pdev) +{ + struct net_device *dev = pci_get_drvdata(pdev); + + assert (dev != NULL); + assert (priv != NULL); + + unregister_netdev (dev); + +#ifdef RTL8169_USE_IO +#else + iounmap ((void *)(dev->base_addr)); +#endif + pci_release_regions (pdev); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + kfree (dev); +#else + free_netdev(dev); +#endif + + pci_set_drvdata (pdev, NULL); +} + + + + + + + +//====================================================================================================== +static int rtl8169_open (struct net_device *dev) +{ + struct rtl8169_private *priv = dev->priv; + struct pci_dev *pdev = priv->pci_dev; + int retval; +// u8 diff; +// u32 TxPhyAddr, RxPhyAddr; + + + if( priv->drvinit_fail == 1 ){ + printk("%s: Gigabit driver open failed.\n", dev->name ); + return -ENOMEM; + } + + retval = request_irq (dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); + if (retval) { + return retval; + } + + //2004-05-11 + // Allocate tx/rx descriptor space + priv->sizeof_txdesc_space = NUM_TX_DESC * sizeof(struct TxDesc)+256; + priv->txdesc_space = pci_alloc_consistent( pdev, priv->sizeof_txdesc_space, &priv->txdesc_phy_dma_addr ); + if( priv->txdesc_space == NULL ){ + printk("%s: Gigabit driver alloc txdesc_space failed.\n", dev->name ); + return -ENOMEM; + } + priv->sizeof_rxdesc_space = NUM_RX_DESC * sizeof(struct RxDesc)+256; + priv->rxdesc_space = pci_alloc_consistent( pdev, priv->sizeof_rxdesc_space, &priv->rxdesc_phy_dma_addr ); + if( priv->rxdesc_space == NULL ){ + printk("%s: Gigabit driver alloc rxdesc_space failed.\n", dev->name ); + return -ENOMEM; + } + + if(priv->txdesc_phy_dma_addr & 0xff){ + printk("%s: Gigabit driver txdesc_phy_dma_addr is not 256-bytes-aligned.\n", dev->name ); + } + if(priv->rxdesc_phy_dma_addr & 0xff){ + printk("%s: Gigabit driver rxdesc_phy_dma_addr is not 256-bytes-aligned.\n", dev->name ); + } + // Set tx/rx descriptor space + priv->TxDescArray = (struct TxDesc *)priv->txdesc_space; + priv->RxDescArray = (struct RxDesc *)priv->rxdesc_space; + + { + int i; + struct sk_buff *skb = NULL; + + for(i=0;iRx_skbuff[i] = skb; + } + else{ + printk("%s: Gigabit driver failed to allocate skbuff.\n", dev->name); + priv->drvinit_fail = 1; + } + } + } + + + ////////////////////////////////////////////////////////////////////////////// + rtl8169_init_ring (dev); + rtl8169_hw_start (dev); + + + // ------------------------------------------------------ + DBG_PRINT("FIX PCS -> rtl8169_request_timer\n"); + priv->expire_time = RTL8169_TIMER_EXPIRE_TIME; + rtl8169_request_timer( (&priv->r8169_timer), priv->expire_time, rtl8169_timer_handler, ((void *)dev) ); //in open() + + + DBG_PRINT("%s: %s() alloc_rxskb_cnt = %d\n", dev->name, __FUNCTION__, alloc_rxskb_cnt ); + + return 0; + +}//end of rtl8169_open (struct net_device *dev) + + + + + + + + +//====================================================================================================== +static void rtl8169_hw_PHY_reset(struct net_device *dev) +{ + int val, phy_reset_expiretime = 50; + struct rtl8169_private *priv = dev->priv; + unsigned long ioaddr = priv->ioaddr; + + DBG_PRINT("%s: Reset RTL8169s PHY\n", dev->name); + + val = ( RTL8169_READ_GMII_REG( ioaddr, 0 ) | 0x8000 ) & 0xffff; + RTL8169_WRITE_GMII_REG( ioaddr, 0, val ); + + do //waiting for phy reset + { + if( RTL8169_READ_GMII_REG( ioaddr, 0 ) & 0x8000 ){ + phy_reset_expiretime --; + udelay(100); + } + else{ + break; + } + }while( phy_reset_expiretime >= 0 ); + + assert( phy_reset_expiretime > 0 ); +} + + + + +//====================================================================================================== +static void rtl8169_hw_PHY_config (struct net_device *dev) +{ + struct rtl8169_private *priv = dev->priv; + void *ioaddr = (void*)priv->ioaddr; + + DBG_PRINT("priv->mcfg=%d, priv->pcfg=%d\n",priv->mcfg,priv->pcfg); + + if( priv->mcfg == MCFG_METHOD_4 ){ +/* + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0001 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1b, 0x841e ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x0e, 0x7bfb ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x09, 0x273a ); +*/ + + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0002 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x01, 0x90D0 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0000 ); + }else if((priv->mcfg == MCFG_METHOD_2)||(priv->mcfg == MCFG_METHOD_3)){ + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0001 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x15, 0x1000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x18, 0x65C7 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0x0000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x03, 0x00A1 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x02, 0x0008 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x01, 0x1020 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x00, 0x1000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0x0800 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0x0000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0x7000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x03, 0xFF41 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x02, 0xDE60 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x01, 0x0140 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x00, 0x0077 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0x7800 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0x7000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xA000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x03, 0xDF01 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x02, 0xDF20 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x01, 0xFF95 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x00, 0xFA00 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xA800 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xA000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xB000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x03, 0xFF41 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x02, 0xDE20 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x01, 0x0140 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x00, 0x00BB ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xB800 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xB000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xF000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x03, 0xDF01 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x02, 0xDF20 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x01, 0xFF95 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x00, 0xBF00 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xF800 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0xF000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x04, 0x0000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x1F, 0x0000 ); + RTL8169_WRITE_GMII_REG( (unsigned long)ioaddr, 0x0B, 0x0000 ); + } + else{ + DBG_PRINT("priv->mcfg=%d. Discard hw PHY config.\n",priv->mcfg); + } +} + + + + + + + + + + +//====================================================================================================== +static void rtl8169_hw_start (struct net_device *dev) +{ + struct rtl8169_private *priv = dev->priv; + unsigned long ioaddr = priv->ioaddr; + u32 i; + + + /* Soft reset the chip. */ + RTL_W8 ( ChipCmd, CmdReset); + + /* Check that the chip has finished the reset. */ + for (i = 1000; i > 0; i--){ + if ((RTL_R8( ChipCmd ) & CmdReset) == 0) break; + else udelay (10); + } + + RTL_W8 ( Cfg9346, Cfg9346_Unlock); + RTL_W8 ( ChipCmd, CmdTxEnb | CmdRxEnb); + RTL_W8 ( ETThReg, ETTh); + + // For gigabit rtl8169 + RTL_W16 ( RxMaxSize, (unsigned short)priv->hw_rx_pkt_len ); + + // Set Rx Config register + i = rtl8169_rx_config | ( RTL_R32( RxConfig ) & rtl_chip_info[priv->chipset].RxConfigMask); + RTL_W32 ( RxConfig, i); + + + /* Set DMA burst size and Interframe Gap Time */ + RTL_W32 ( TxConfig, (TX_DMA_BURST << TxDMAShift) | (InterFrameGap << TxInterFrameGapShift) ); + + + + RTL_W16( CPlusCmd, RTL_R16(CPlusCmd) ); + + if( priv->mcfg == MCFG_METHOD_2 || + priv->mcfg == MCFG_METHOD_3) + { + RTL_W16( CPlusCmd, (RTL_R16(CPlusCmd)|(1<<14)|(1<<3)) ); + DBG_PRINT("Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14\n"); + } + else + { + RTL_W16( CPlusCmd, (RTL_R16(CPlusCmd)|(1<<3)) ); + DBG_PRINT("Set MAC Reg C+CR Offset 0xE0: bit-3.\n"); + } + + { + //RTL_W16(0xE2, 0x1517); + //RTL_W16(0xE2, 0x152a); + //RTL_W16(0xE2, 0x282a); + RTL_W16(0xE2, 0x0000); + } + + priv->cur_rx = 0; + + RTL_W32 ( TxDescStartAddr, priv->txdesc_phy_dma_addr); + RTL_W32 ( TxDescStartAddr + 4, 0x00); + RTL_W32 ( RxDescStartAddr, priv->rxdesc_phy_dma_addr); + RTL_W32 ( RxDescStartAddr + 4, 0x00); + + RTL_W8 ( Cfg9346, Cfg9346_Lock ); + udelay (10); + + RTL_W32 ( RxMissed, 0 ); + + rtl8169_set_rx_mode (dev); + + RTL_W16 ( MultiIntr, RTL_R16(MultiIntr) & 0xF000); + + RTL_W16 ( IntrMask, rtl8169_intr_mask); + + netif_start_queue (dev); + +}//end of rtl8169_hw_start (struct net_device *dev) + + + + + + + +//====================================================================================================== +static void rtl8169_init_ring (struct net_device *dev) +{ + struct rtl8169_private *priv = dev->priv; + struct pci_dev *pdev = priv->pci_dev; + int i; + struct sk_buff *skb; + + + priv->cur_rx = 0; + priv->cur_tx = 0; + priv->dirty_tx = 0; + memset(priv->TxDescArray, 0x0, NUM_TX_DESC*sizeof(struct TxDesc)); + memset(priv->RxDescArray, 0x0, NUM_RX_DESC*sizeof(struct RxDesc)); + + + for (i=0 ; iTx_skbuff[i]=NULL; + priv->txdesc_array_dma_addr[i] = pci_map_single(pdev, &priv->TxDescArray[i], sizeof(struct TxDesc), PCI_DMA_TODEVICE); + } + + for (i=0; i RxDescArray[i].status = cpu_to_le32((OWNbit | EORbit) | (unsigned long)priv->hw_rx_pkt_len); + } + else{ + priv->RxDescArray[i].status = cpu_to_le32(OWNbit | (unsigned long)priv->hw_rx_pkt_len); + } + + {//----------------------------------------------------------------------- + skb = priv->Rx_skbuff[i]; + priv->rx_skbuff_dma_addr[i] = pci_map_single(pdev, skb->data, MAX_RX_SKBDATA_SIZE, PCI_DMA_FROMDEVICE); + + if( skb != NULL ){ + priv->RxDescArray[i].buf_addr = cpu_to_le32(priv->rx_skbuff_dma_addr[i]); + priv->RxDescArray[i].buf_Haddr = 0; + } + else{ + DBG_PRINT("%s: %s() Rx_skbuff == NULL\n", dev->name, __FUNCTION__); + priv->drvinit_fail = 1; + } + }//----------------------------------------------------------------------- + priv->rxdesc_array_dma_addr[i] = pci_map_single(pdev, &priv->RxDescArray[i], sizeof(struct RxDesc), PCI_DMA_TODEVICE); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + pci_dma_sync_single(pdev, priv->rxdesc_array_dma_addr[i], sizeof(struct RxDesc), PCI_DMA_TODEVICE); +#endif + } +} + + + + + + + +//====================================================================================================== +static void rtl8169_tx_clear (struct rtl8169_private *priv) +{ + int i; + + priv->cur_tx = 0; + for ( i = 0 ; i < NUM_TX_DESC ; i++ ){ + if ( priv->Tx_skbuff[i] != NULL ) { + dev_kfree_skb ( priv->Tx_skbuff[i] ); + priv->Tx_skbuff[i] = NULL; + priv->stats.tx_dropped++; + } + } +} + + + + + + + +//====================================================================================================== +static void rtl8169_tx_timeout (struct net_device *dev) +{ + struct rtl8169_private *priv = dev->priv; + unsigned long ioaddr = priv->ioaddr; + u8 tmp8; + + /* disable Tx, if not already */ + tmp8 = RTL_R8( ChipCmd ); + if (tmp8 & CmdTxEnb){ + RTL_W8 ( ChipCmd, tmp8 & ~CmdTxEnb); + } + + /* Disable interrupts by clearing the interrupt mask. */ + RTL_W16 ( IntrMask, 0x0000); + + /* Stop a shared interrupt from scavenging while we are. */ + spin_lock_irq (&priv->lock); + rtl8169_tx_clear (priv); + spin_unlock_irq (&priv->lock); + + + rtl8169_hw_start (dev); + + netif_wake_queue (dev); +} + + + + + + + +//====================================================================================================== +static int rtl8169_start_xmit (struct sk_buff *skb, struct net_device *dev) +{ + struct rtl8169_private *priv = dev->priv; + unsigned long ioaddr = priv->ioaddr; + struct pci_dev *pdev = priv->pci_dev; + int entry = priv->cur_tx % NUM_TX_DESC; + int buf_len = 60; + dma_addr_t txbuf_dma_addr; + + spin_lock_irq (&priv->lock); + + if( (le32_to_cpu(priv->TxDescArray[entry].status) & OWNbit)==0 ){ + + priv->Tx_skbuff[entry] = skb; + txbuf_dma_addr = pci_map_single(pdev, skb->data, skb->len, PCI_DMA_TODEVICE); + + priv->TxDescArray[entry].buf_addr = cpu_to_le32(txbuf_dma_addr); + DBG_PRINT("%s: TX pkt_size = %d\n", __FUNCTION__, skb->len); + if( skb->len <= priv->tx_pkt_len ){ + buf_len = skb->len; + } + else{ + printk("%s: Error -- Tx packet size(%d) > mtu(%d)+14\n", dev->name, skb->len, dev->mtu); + buf_len = priv->tx_pkt_len; + } + + if( entry != (NUM_TX_DESC-1) ){ + priv->TxDescArray[entry].status = cpu_to_le32((OWNbit | FSbit | LSbit) | buf_len); + } + else{ + priv->TxDescArray[entry].status = cpu_to_le32((OWNbit | EORbit | FSbit | LSbit) | buf_len); + } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + pci_dma_sync_single(pdev, priv->txdesc_array_dma_addr[entry], sizeof(struct TxDesc), PCI_DMA_TODEVICE); +#endif + + RTL_W8 ( TxPoll, 0x40); //set polling bit + + dev->trans_start = jiffies; + + priv->stats.tx_bytes += ( (skb->len > ETH_ZLEN) ? skb->len : ETH_ZLEN); + priv->cur_tx++; + }//end of if( (priv->TxDescArray[entry].status & 0x80000000)==0 ) + + spin_unlock_irq (&priv->lock); + + if ( (priv->cur_tx - NUM_TX_DESC) == priv->dirty_tx ){ + netif_stop_queue (dev); + } + else{ + if (netif_queue_stopped (dev)){ + netif_wake_queue (dev); + } + } + + return 0; +} + + + + + + + +//====================================================================================================== +static void rtl8169_tx_interrupt (struct net_device *dev, struct rtl8169_private *priv, unsigned long ioaddr) +{ + unsigned long dirty_tx, tx_left=0; + int entry = priv->cur_tx % NUM_TX_DESC; + int txloop_cnt = 0; + + assert (dev != NULL); + assert (priv != NULL); + assert (ioaddr != NULL); + + + dirty_tx = priv->dirty_tx; + tx_left = priv->cur_tx - dirty_tx; + + while( (tx_left > 0) && (txloop_cnt < max_interrupt_work) ){ + if( (le32_to_cpu(priv->TxDescArray[entry].status) & OWNbit) == 0 ){ + +#ifdef RTL8169_DYNAMIC_CONTROL + r8169_callback_tx(&(priv->rt), 1, priv->Tx_skbuff[dirty_tx % NUM_TX_DESC]->len); +#endif //end #ifdef RTL8169_DYNAMIC_CONTROL + + dev_kfree_skb_irq( priv->Tx_skbuff[dirty_tx % NUM_TX_DESC] ); + priv->Tx_skbuff[dirty_tx % NUM_TX_DESC] = NULL; + priv->stats.tx_packets++; + dirty_tx++; + tx_left--; + entry++; + } + txloop_cnt ++; + } + + if (priv->dirty_tx != dirty_tx) { + priv->dirty_tx = dirty_tx; + if (netif_queue_stopped (dev)) + netif_wake_queue (dev); + } +} + + + + + + +//====================================================================================================== +static void rtl8169_rx_interrupt (struct net_device *dev, struct rtl8169_private *priv, unsigned long ioaddr) +{ + struct pci_dev *pdev = priv->pci_dev; + int cur_rx; + int pkt_size = 0 ; + int rxdesc_cnt = 0; + int ret; + struct sk_buff *n_skb = NULL; + struct sk_buff *cur_skb; + struct sk_buff *rx_skb; + struct RxDesc *rxdesc; + + assert (dev != NULL); + assert (priv != NULL); + assert (ioaddr != NULL); + + + cur_rx = priv->cur_rx; + + rxdesc = &priv->RxDescArray[cur_rx]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + pci_dma_sync_single(pdev, priv->rxdesc_array_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE); +#endif + + while ( ((le32_to_cpu(rxdesc->status) & OWNbit)== 0) && (rxdesc_cnt < max_interrupt_work) ){ + + rxdesc_cnt++; + + if( le32_to_cpu(rxdesc->status) & RxRES ){ + printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); + priv->stats.rx_errors++; + if ( le32_to_cpu(rxdesc->status) & (RxRWT|RxRUNT) ) + priv->stats.rx_length_errors++; + if ( le32_to_cpu(rxdesc->status) & RxCRC) + priv->stats.rx_crc_errors++; + } + else{ + pkt_size=(int)(le32_to_cpu(rxdesc->status) & 0x00001FFF)-4; + + if( pkt_size > priv->rx_pkt_len ){ + printk("%s: Error -- Rx packet size(%d) > mtu(%d)+14\n", dev->name, pkt_size, dev->mtu); + pkt_size = priv->rx_pkt_len; + } + + DBG_PRINT("%s: RX pkt_size = %d\n", __FUNCTION__, pkt_size); + + {// ----------------------------------------------------- + rx_skb = priv->Rx_skbuff[cur_rx]; + n_skb = RTL8169_ALLOC_RXSKB(MAX_RX_SKBDATA_SIZE); + if( n_skb != NULL ) { + skb_reserve (n_skb, 2); // 16 byte align the IP fields. // + + // Indicate rx_skb + if( rx_skb != NULL ){ + rx_skb->dev = dev; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + pci_dma_sync_single(pdev, priv->rx_skbuff_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE); +#endif + + skb_put ( rx_skb, pkt_size ); + rx_skb->protocol = eth_type_trans ( rx_skb, dev ); + ret = RTL8169_NETIF_RX (rx_skb); + +// dev->last_rx = jiffies; + priv->stats.rx_bytes += pkt_size; + priv->stats.rx_packets++; + +#ifdef RTL8169_DYNAMIC_CONTROL + r8169_callback_rx( &(priv->rt), 1, pkt_size); +#endif //end #ifdef RTL8169_DYNAMIC_CONTROL + + }//end if( rx_skb != NULL ) + + priv->Rx_skbuff[cur_rx] = n_skb; + } + else{ + DBG_PRINT("%s: Allocate n_skb failed!\n",__FUNCTION__ ); + priv->Rx_skbuff[cur_rx] = rx_skb; + } + + + // Update rx descriptor + if( cur_rx == (NUM_RX_DESC-1) ){ + priv->RxDescArray[cur_rx].status = cpu_to_le32((OWNbit | EORbit) | (unsigned long)priv->hw_rx_pkt_len); + } + else{ + priv->RxDescArray[cur_rx].status = cpu_to_le32(OWNbit | (unsigned long)priv->hw_rx_pkt_len); + } + + cur_skb = priv->Rx_skbuff[cur_rx]; + + if( cur_skb != NULL ){ + priv->rx_skbuff_dma_addr[cur_rx] = pci_map_single(pdev, cur_skb->data, MAX_RX_SKBDATA_SIZE, PCI_DMA_FROMDEVICE); + rxdesc->buf_addr = cpu_to_le32(priv->rx_skbuff_dma_addr[cur_rx]); + } + else{ + DBG_PRINT("%s: %s() cur_skb == NULL\n", dev->name, __FUNCTION__); + } + + }//------------------------------------------------------------ + + }// end of if( priv->RxDescArray[cur_rx].status & RxRES ) + + cur_rx = (cur_rx +1) % NUM_RX_DESC; + rxdesc = &priv->RxDescArray[cur_rx]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + pci_dma_sync_single(pdev, priv->rxdesc_array_dma_addr[cur_rx], sizeof(struct RxDesc), PCI_DMA_FROMDEVICE); +#endif + + }// end of while ( (priv->RxDescArray[cur_rx].status & 0x80000000)== 0) + + if( rxdesc_cnt >= max_interrupt_work ){ + DBG_PRINT("%s: Too much work at Rx interrupt.\n", dev->name); + } + + priv->cur_rx = cur_rx; +} + + + + + + + + +//====================================================================================================== +/* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +static void rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs) +#else +static irqreturn_t rtl8169_interrupt (int irq, void *dev_instance, struct pt_regs *regs) +#endif +{ + struct net_device *dev = (struct net_device *) dev_instance; + struct rtl8169_private *priv = dev->priv; + int boguscnt = max_interrupt_work; + unsigned long ioaddr = priv->ioaddr; + int status = 0; + int interrupt_handled = IRQ_NONE; + + RTL_W16 ( IntrMask, 0x0000); + + do { + status = RTL_R16(IntrStatus); + + if (status == 0xFFFF) + break; + +#if defined(CONFIG_LINKSTATION) + if (status & LinkChg) { + RTL8169_READ_GMII_REG(ioaddr, PHY_STAT_REG); + + int option = readb(dev->base_addr + PHYstatus); + miconCntl_Eth1000M(0); + miconCntl_Eth100M(0); + miconCntl_Eth10M(0); + + if( !(option & LinkStatus) ) { // no link + printk(KERN_INFO "%s: No Link.\n", dev->name); + } else if( option & _1000bpsF ) { // 1000Mbps + printk(KERN_INFO "%s: 1Gbps Linked.\n", dev->name); + miconCntl_Eth1000M(1); + } else if( option & _100bps ) { + printk(KERN_INFO "%s: 100Mbps Linked.\n", dev->name); + miconCntl_Eth100M(1); + } else if( option & _10bps ) { + printk(KERN_INFO "%s: 10Mbps Linked.\n", dev->name); + miconCntl_Eth10M(1); + } else { + printk(KERN_INFO "%s: Link status changed.\n", dev->name); + } + } +#endif + + RTL_W16( IntrStatus, status ); + + + if ( (status & rtl8169_intr_mask ) == 0 ) + break; + else + interrupt_handled = IRQ_HANDLED; + + + // Rx interrupt +// if (status & (RxOK | RxErr /* | LinkChg | RxOverflow | RxFIFOOver*/)){ + rtl8169_rx_interrupt (dev, priv, ioaddr); +// } + + // Tx interrupt +// if (status & (TxOK | TxErr)) { + spin_lock (&priv->lock); + rtl8169_tx_interrupt (dev, priv, ioaddr); + spin_unlock (&priv->lock); +// } + + boguscnt--; + } while (boguscnt > 0); + + if (boguscnt <= 0) { + DBG_PRINT("%s: Too much work at interrupt!\n", dev->name); + RTL_W16( IntrStatus, 0xffff); // Clear all interrupt sources + } + + RTL_W16 ( IntrMask, rtl8169_intr_mask); + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) + return interrupt_handled; +#endif +} + + + + + + + +//====================================================================================================== +static int rtl8169_close (struct net_device *dev) +{ + struct rtl8169_private *priv = dev->priv; + unsigned long ioaddr = priv->ioaddr; + int i; + + // ----------------------------------------- + rtl8169_delete_timer( &(priv->r8169_timer) ); + + + netif_stop_queue (dev); + + spin_lock_irq (&priv->lock); + + /* Stop the chip's Tx and Rx processes. */ + RTL_W8 ( ChipCmd, 0x00); + + /* Disable interrupts by clearing the interrupt mask. */ + RTL_W16 ( IntrMask, 0x0000); + + /* Update the error counts. */ + priv->stats.rx_missed_errors += RTL_R32(RxMissed); + RTL_W32( RxMissed, 0); + + spin_unlock_irq (&priv->lock); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + synchronize_irq (); +#else + synchronize_irq (dev->irq); +#endif + free_irq (dev->irq, dev); + + rtl8169_tx_clear (priv); + + //2004-05-11 + if(priv->txdesc_space != NULL){ + pci_free_consistent( + priv->pci_dev, + priv->sizeof_txdesc_space, + priv->txdesc_space, + priv->txdesc_phy_dma_addr + ); + priv->txdesc_space = NULL; + } + + if(priv->rxdesc_space != NULL){ + pci_free_consistent( + priv->pci_dev, + priv->sizeof_rxdesc_space, + priv->rxdesc_space, + priv->rxdesc_phy_dma_addr + ); + priv->rxdesc_space = NULL; + } + + priv->TxDescArray = NULL; + priv->RxDescArray = NULL; + + {//----------------------------------------------------------------------------- + for(i=0;iRx_skbuff[i] != NULL ) { + RTL8169_FREE_RXSKB ( priv->Rx_skbuff[i] ); + } + } + }//----------------------------------------------------------------------------- + + DBG_PRINT("%s: %s() alloc_rxskb_cnt = %d\n", dev->name, __FUNCTION__, alloc_rxskb_cnt ); + + return 0; +} + + + + + + + +//====================================================================================================== +static unsigned const ethernet_polynomial = 0x04c11db7U; +static inline u32 ether_crc (int length, unsigned char *data) +{ + int crc = -1; + + while (--length >= 0) { + unsigned char current_octet = *data++; + int bit; + for (bit = 0; bit < 8; bit++, current_octet >>= 1) + crc = (crc << 1) ^ ((crc < 0) ^ (current_octet & 1) ? ethernet_polynomial : 0); + } + + return crc; +} + + + + + + + + +//====================================================================================================== +static void rtl8169_set_rx_mode (struct net_device *dev) +{ + struct rtl8169_private *priv = dev->priv; + unsigned long ioaddr = priv->ioaddr; + unsigned long flags; + u32 mc_filter[2]; /* Multicast hash filter */ + int i, rx_mode; + u32 tmp=0; + + + if (dev->flags & IFF_PROMISC) { + /* Unconditionally log net taps. */ + printk (KERN_NOTICE "%s: Promiscuous mode enabled.\n", dev->name); + rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptAllPhys; + mc_filter[1] = mc_filter[0] = 0xffffffff; + } else if ((dev->mc_count > multicast_filter_limit) || (dev->flags & IFF_ALLMULTI)) { + /* Too many to filter perfectly -- accept all multicasts. */ + rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; + mc_filter[1] = mc_filter[0] = 0xffffffff; + } else { + struct dev_mc_list *mclist; + rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; + mc_filter[1] = mc_filter[0] = 0; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next) + { + set_bit (ether_crc (ETH_ALEN, mclist->dmi_addr) >> 26, mc_filter); + } +#else + for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; i++, mclist = mclist->next) + { + int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; + + mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31); + rx_mode |= AcceptMulticast; + } +#endif + } + + spin_lock_irqsave (&priv->lock, flags); + + tmp = rtl8169_rx_config | rx_mode | (RTL_R32(RxConfig) & rtl_chip_info[priv->chipset].RxConfigMask); + + RTL_W32 ( RxConfig, tmp); + RTL_W32 ( MAR0 + 0, mc_filter[0]); + RTL_W32 ( MAR0 + 4, mc_filter[1]); + + spin_unlock_irqrestore (&priv->lock, flags); + +}//end of rtl8169_set_rx_mode (struct net_device *dev) + + + + + + + +//================================================================================ +struct net_device_stats *rtl8169_get_stats(struct net_device *dev) + +{ + struct rtl8169_private *priv = dev->priv; + + return &priv->stats; +} + + + + + + + + +//================================================================================ +static struct pci_driver rtl8169_pci_driver = { + name: MODULENAME, + id_table: rtl8169_pci_tbl, + probe: rtl8169_init_one, + remove: rtl8169_remove_one, + suspend: NULL, + resume: NULL, +}; + + + + + +//====================================================================================================== +static int __init rtl8169_init_module (void) +{ + + printk("Realtek RTL8169/8110 Family Gigabit Ethernet Network Adapter\n"); + return pci_module_init (&rtl8169_pci_driver); // pci_register_driver (drv) +} + + + + +//====================================================================================================== +static void __exit rtl8169_cleanup_module (void) +{ + pci_unregister_driver (&rtl8169_pci_driver); +} + + +#ifdef RTL8169_JUMBO_FRAME_SUPPORT +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) +{ + struct rtl8169_private *priv = dev->priv; + unsigned long ioaddr = priv->ioaddr; + + if( new_mtu > MAX_JUMBO_FRAME_MTU ){ + printk("%s: Error -- new_mtu(%d) > MAX_JUMBO_FRAME_MTU(%d).\n", dev->name, new_mtu, MAX_JUMBO_FRAME_MTU); + return -1; + } + + dev->mtu = new_mtu; + + priv->curr_mtu_size = new_mtu; + priv->tx_pkt_len = new_mtu + ETH_HDR_LEN; + priv->rx_pkt_len = new_mtu + ETH_HDR_LEN; + priv->hw_rx_pkt_len = priv->rx_pkt_len + 8; + + RTL_W8 ( Cfg9346, Cfg9346_Unlock); + RTL_W16 ( RxMaxSize, (unsigned short)priv->hw_rx_pkt_len ); + RTL_W8 ( Cfg9346, Cfg9346_Lock); + + DBG_PRINT("-------------------------- \n"); + DBG_PRINT("dev->mtu = %d \n", dev->mtu); + DBG_PRINT("priv->curr_mtu_size = %d \n", priv->curr_mtu_size); + DBG_PRINT("priv->rx_pkt_len = %d \n", priv->rx_pkt_len); + DBG_PRINT("priv->tx_pkt_len = %d \n", priv->tx_pkt_len); + DBG_PRINT("RTL_W16( RxMaxSize, %d )\n", priv->hw_rx_pkt_len); + DBG_PRINT("-------------------------- \n"); + + rtl8169_close (dev); + rtl8169_open (dev); + + return 0; +} +#endif //end #ifdef RTL8169_JUMBO_FRAME_SUPPORT + + + + + + + + + + + +//====================================================================================================== +module_init(rtl8169_init_module); +module_exit(rtl8169_cleanup_module); diff -ruN linux-2.4.31/include/asm-ppc/mpc10x.h linux-2.4.31_linkstation/include/asm-ppc/mpc10x.h --- linux-2.4.31/include/asm-ppc/mpc10x.h 2004-02-18 08:36:32.000000000 -0500 +++ linux-2.4.31_linkstation/include/asm-ppc/mpc10x.h 2006-01-01 20:16:08.000000000 -0500 @@ -105,8 +105,12 @@ #define MPC10X_CFG_PICR1_ADDR_MAP_MASK 0x00010000 #define MPC10X_CFG_PICR1_ADDR_MAP_A 0x00010000 #define MPC10X_CFG_PICR1_ADDR_MAP_B 0x00000000 +#define MPC10X_CFG_PICR1_SPEC_PCI_RD 0x00000004 #define MPC10X_CFG_PICR1_ST_GATH_EN 0x00000040 +#define MPC10X_CFG_PICR2_REG 0xac +#define MPC10X_CFG_PICR2_COPYBACK_OPT 0x00000001 + #define MPC10X_CFG_MAPB_OPTIONS_REG 0xe0 #define MPC10X_CFG_MAPB_OPTIONS_CFAE 0x80 /* CPU_FD_ALIAS_EN */ #define MPC10X_CFG_MAPB_OPTIONS_PFAE 0x40 /* PCI_FD_ALIAS_EN */ diff -ruN linux-2.4.31/include/asm-ppc/pgtable.h linux-2.4.31_linkstation/include/asm-ppc/pgtable.h --- linux-2.4.31/include/asm-ppc/pgtable.h 2004-02-18 08:36:32.000000000 -0500 +++ linux-2.4.31_linkstation/include/asm-ppc/pgtable.h 2006-01-01 19:51:29.000000000 -0500 @@ -113,7 +113,12 @@ /* Start and end of the vmalloc area. */ #define VMALLOC_START vmalloc_start +// __LS_COMMENT__ BUFFALO change 2004.8.31 vmalloc +#if defined(CONFIG_LINKSTATION) +#define VMALLOC_END 0xf8000000 +#else #define VMALLOC_END ioremap_bot +#endif #define VMALLOC_VMADDR(x) ((unsigned long)(x)) #endif /* __ASSEMBLY__ */ diff -ruN linux-2.4.31/include/asm-ppc/serial.h linux-2.4.31_linkstation/include/asm-ppc/serial.h --- linux-2.4.31/include/asm-ppc/serial.h 2004-02-18 08:36:32.000000000 -0500 +++ linux-2.4.31_linkstation/include/asm-ppc/serial.h 2006-01-01 19:54:05.000000000 -0500 @@ -14,6 +14,9 @@ #include #elif defined(CONFIG_SANDPOINT) #include +#elif defined(CONFIG_LINKSTATION) +// __LS_COMMENT__ BUFFALO change +#include #elif defined(CONFIG_SPRUCE) #include #elif defined(CONFIG_PRPMC750) diff -ruN linux-2.4.31/include/buffalo/linkstation_hwctl.h linux-2.4.31_linkstation/include/buffalo/linkstation_hwctl.h --- linux-2.4.31/include/buffalo/linkstation_hwctl.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/include/buffalo/linkstation_hwctl.h 2005-09-05 22:26:41.000000000 -0400 @@ -0,0 +1,62 @@ +/* + * LinkStation HW Control Driver + * + * Copyright (C) 2001-2004 BUFFALO INC. + * + * This software may be used and distributed according to the terms of + * the GNU General Public License (GPL), incorporated herein by reference. + * Drivers based on or derived from this code fall under the GPL and must + * retain the authorship, copyright and license notice. This file is not + * a complete program and may only be used when the entire operating + * system is licensed under the GPL. + * + */ + +#ifndef __LS_HWCTL_H__ +#define __LS_HWCTL_H__ + +// Vendor/Device ID +#define VID_ADMTEK 0x1317 +#define DID_AN983B 0x985 +#define VID_SiI 0x1095 +#define DID_SiI680 0x680 +#define VID_NEC 0x1033 +#define DID_720101_U1 0x35 +#define DID_720101_U2 0xE0 +#define VID_REALTEK 0x10EC +#define DID_RTL8110S 0x8169 +#define DID_RTL8110S_NULL 0x8129 +#define VID_ITE 0x1283 +#define DID_IT8211F 0x8212 + +#define FLASH_CLEAR_START 0x53 +#define FLASH_CLEAR_END 0x52 +#define FLASH_UPDATE_START 0x55 +#define FLASH_UPDATE_END 0x54 +#define HDD_NOT_PRESENT 0x6D +#define RAID_RESYNC_START 0x00 +#define RAID_RESYNC_END 0x01 + +#define AVR_PORT 0x80004500 + +void blink_led(unsigned char state); + +void miconCntl_FanLow(void); + +void miconCntl_FanHigh(void); + +void miconCntl_Eth1000M(int up); + +void miconCntl_Eth100M(int up); + +void miconCntl_Eth10M(int up); + +void miconCntl_5f(void); + +void miconCntl_Rebooting(void); + +void miconCntl_RadiRecovery(void); + +void miconCntl_RadiRecoveryFin(void); + +#endif //__LS_HWCTL_H__ diff -ruN linux-2.4.31/include/linux/i2c-algo-8245.h linux-2.4.31_linkstation/include/linux/i2c-algo-8245.h --- linux-2.4.31/include/linux/i2c-algo-8245.h 1969-12-31 19:00:00.000000000 -0500 +++ linux-2.4.31_linkstation/include/linux/i2c-algo-8245.h 2006-01-01 19:54:46.000000000 -0500 @@ -0,0 +1,83 @@ +/*********************************************************************** + * + * (C) Copyright 2005 + * DENX Software Engineering + * Wolfgang Denk, wd@denx.de + * All rights reserved. + ***********************************************************************/ + +/* ------------------------------------------------------------------------- */ +/* i2c-algo-8245.h i2c driver defines for the MPC8245 I2C Interface */ +/* ------------------------------------------------------------------------- */ +/* + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* ------------------------------------------------------------------------- */ + + +#ifndef I2C_ALGO_8245_H +#define I2C_ALGO_8245_H 1 + +#include + +#define M8245_I2C_OFFSET 0x3000 +#define M8245_I2C_SIZE 0x1000 + +#define M8245_IRQ_I2C 21 + +typedef struct i2c_8245_s +{ + u_int i2cadr; + u_int i2cfdr; + u_int i2ccr; + u_int i2csr; + u_int i2cdr; +} +i2c_8245_t; + + /* Defines for the I2C Address Register. + */ +#define M8245_I2CADR_ADDR_MASK 0x000000FE + + /* Defines for the I2C Frequency Divider Register. + */ +#define M8245_I2CFDR_FDR_MASK 0x0000003F + + /* Defines for the I2C Control Register. + */ +#define M8245_I2CCR_RSTA 0x00000004 +#define M8245_I2CCR_TXAK 0x00000008 +#define M8245_I2CCR_MTX 0x00000010 +#define M8245_I2CCR_MSTA 0x00000020 +#define M8245_I2CCR_MIEN 0x00000040 +#define M8245_I2CCR_MEN 0x00000080 + +#define M8245_I2CCR_INIT_MASK (M8245_I2CCR_MEN | M8245_I2CCR_MSTA | \ + M8245_I2CCR_MTX | M8245_I2CCR_RSTA) + + /* Defines for the I2C Status Register + */ +#define M8245_I2CSR_RXAK 0x00000001 +#define M8245_I2CSR_MIF 0x00000002 +#define M8245_I2CSR_MBB 0x00000020 + +struct i2c_algo_8245_data +{ + volatile i2c_8245_t * i2c; +}; + +extern int i2c_8245_add_bus(struct i2c_adapter *); +extern int i2c_8245_del_bus(struct i2c_adapter *); + +#endif /* I2C_ALGO_8245_H */ diff -ruN linux-2.4.31/include/linux/serial_reg.h linux-2.4.31_linkstation/include/linux/serial_reg.h --- linux-2.4.31/include/linux/serial_reg.h 2001-05-01 19:05:00.000000000 -0400 +++ linux-2.4.31_linkstation/include/linux/serial_reg.h 2005-09-10 17:17:52.000000000 -0400 @@ -40,7 +40,8 @@ #define UART_EMSR 7 /* (LCR=BF) Extended Mode Select Register * FCTR bit 6 selects SCR or EMSR * XR16c85x only */ - +/* __LS_COMMENT__ BUFFALO add 2004.9.23 */ +#define UART_DCR 0x11 /* MPC824x DUART Configration Register */ /* * These are the definitions for the FIFO Control Register * (16650 only)