From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 0069E2F0C6 for ; Thu, 29 Mar 2001 11:21:18 -0500 (EST) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f2TGMv621473 for axp-list@listman.redhat.com; Thu, 29 Mar 2001 11:22:57 -0500 Received: from alpha-gw.alpha-processor.com (barracuda.alpha-processor.com [192.233.60.7]) by mail.redhat.com (8.11.0/8.8.7) with SMTP id f2TGMvV21467 for ; Thu, 29 Mar 2001 11:22:57 -0500 Received: from barracuda.alpha-processor.com by alpha-gw.alpha-processor.com via smtpd (for mail.redhat.com [199.183.24.239]) with SMTP; 29 Mar 2001 16:18:58 UT Received: by barracuda.alpha-processor.com with Internet Mail Service (5.5.2653.19) id ; Thu, 29 Mar 2001 11:17:24 -0500 Message-ID: <051DFF3BBA73D3119A5800A0C95BD021C03A4A@barracuda.alpha-processor.com> From: Soohoon Lee To: "'axp-list@redhat.com'" Subject: For fun, intel e100 port. Date: Thu, 29 Mar 2001 11:17:23 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C0B86B.BD156000" X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C0B86B.BD156000 Content-Type: text/plain; charset="iso-8859-1" Attached is intel e100-1.5.5a driver patch for alpha. The driver has many advanced features like checksum offloading, auto nego, ARP support at chip level and many more, probably intel engineers know how to use that. With this patch, the driver basically works for alpha but I don't know beyond that 'cause I only spent couple of hours for porting and testing, there will be many unidentified problems. That's why the title starts with "For fun..." I guess more than 95% of porting work was replacing mmap IO access codes to use read?/write?. So It was a kind of drudgery. Have fun. Soohoon. ------_=_NextPart_000_01C0B86B.BD156000 Content-Type: application/octet-stream; name="diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="diff" diff -Naur src/Makefile src2/Makefile=0A= --- src/Makefile Wed Feb 21 17:26:57 2001=0A= +++ src2/Makefile Thu Mar 29 11:38:17 2001=0A= @@ -85,7 +85,7 @@=0A= =0A= =0A= # Required Flags=0A= -CFLAGS =3D -D__KERNEL__ -DMODULE -DLINUX -DEXPORT_SYMTAB = -D__NO_VERSION__=0A= +CFLAGS =3D -g -D__KERNEL__ -DMODULE -DLINUX -DEXPORT_SYMTAB = -D__NO_VERSION__ -D__ia64__ -mcpu=3Dev6 -ffixed-8=0A= CFLAGS +=3D -I$(INCLUDEDIR) -I.=0A= CFLAGS +=3D -O2 -pipe=0A= =0A= @@ -122,6 +122,7 @@=0A= ANS =3D NO=0A= endif=0A= =0A= +ANS =3D NO=0A= =0A= ifneq ($(ANS), NO)=0A= CFLAGS +=3D -DIANS -DIANS_BASE_VLAN_TAGGING -DIANS_BASE_VLAN_ID=0A= diff -Naur src/base_comm.h src2/base_comm.h=0A= --- src/base_comm.h Wed Feb 21 17:26:58 2001=0A= +++ src2/base_comm.h Thu Mar 29 11:38:17 2001=0A= @@ -543,7 +543,7 @@=0A= } IANS_ATTR_HEADER, *PIANS_ATTR_HEADER;=0A= =0A= /* Turn into a legal pointer */=0A= -#if defined(__i386__)=0A= +#if defined(__alpha__)=0A= #define CelingAlignPtr(p) ( p )=0A= #else=0A= #error TBD =0A= diff -Naur src/e100.c src2/e100.c=0A= --- src/e100.c Wed Feb 21 17:26:58 2001=0A= +++ src2/e100.c Thu Mar 29 11:38:17 2001=0A= @@ -938,7 +938,8 @@=0A= * =0A= */=0A= =0A= -#define e100_exec_cmd(bdp, cmd_low) (bdp)->bddp->scbp->scb_cmd_low =3D = (uint8_t) (cmd_low)=0A= +//#define e100_exec_cmd(bdp, cmd_low) (bdp)->bddp->scbp->scb_cmd_low = =3D (uint8_t) (cmd_low)=0A= +#define e100_exec_cmd(bdp, cmd_low) writeb((uint8_t) (cmd_low), = &(bdp)->bddp->scbp->scb_cmd_low)=0A= =0A= /* =0A= * Procedure: e100_wait_exec_cmd=0A= @@ -961,7 +962,7 @@=0A= =0A= if (e100_wait_scb(bdp) !=3D B_TRUE) {=0A= printk(KERN_ERR "e100_wait_exec_cmd: Wait failed. scb = cmd=3D0x%x\n",=0A= - bddp->scbp->scb_cmd_low);=0A= + readb(&bddp->scbp->scb_cmd_low));=0A= return (B_FALSE);=0A= }=0A= =0A= @@ -1590,7 +1591,8 @@=0A= corrupted from a TCO packet */=0A= /* Load the CU BASE (set to 0, because we use linear mode) */=0A= bddp->prev_cu_cmd =3D SCB_CUC_LOAD_BASE;=0A= - bddp->scbp->scb_gen_ptr =3D 0;=0A= +// bddp->scbp->scb_gen_ptr =3D 0;=0A= + writel(0, &bddp->scbp->scb_gen_ptr);=0A= e100_exec_cmd(bdp, SCB_CUC_LOAD_BASE);=0A= =0A= /* Wait for the SCB command word to clear before we set the * = general=0A= @@ -1604,7 +1606,8 @@=0A= }=0A= =0A= /* Load the RU BASE (set to 0, because we use linear mode) */=0A= - bddp->scbp->scb_gen_ptr =3D 0;=0A= + writel(0, &bddp->scbp->scb_gen_ptr);=0A= +// bddp->scbp->scb_gen_ptr =3D 0;=0A= bddp->prev_cu_cmd =3D SCB_RUC_LOAD_BASE;=0A= e100_exec_cmd(bdp, SCB_RUC_LOAD_BASE);=0A= =0A= @@ -1936,7 +1939,7 @@=0A= (bddp->prev_cu_cmd =3D=3D CB_TRANSMIT_FIRST)) {=0A= /* Wait for suspended state */=0A= e100_retry =3D E100_CMD_WAIT;=0A= - while (((bddp->scbp->scb_status & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= + while (((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= && (e100_retry)) {=0A= mdelay(20);=0A= e100_retry--;=0A= @@ -1944,7 +1947,7 @@=0A= }=0A= =0A= /* Update the command list pointer. */=0A= - bddp->scbp->scb_gen_ptr =3D bddp->nontx_paddr;=0A= + writel(bddp->nontx_paddr, &bddp->scbp->scb_gen_ptr);=0A= /* store the command */=0A= bddp->prev_cu_cmd =3D CB_MULTICAST;=0A= /* Submit the Multicast Cmd to the chip, and wait for it to = complete. */=0A= @@ -2171,7 +2174,7 @@=0A= =0A= /* Load the CU BASE (set to 0, because we use linear mode) */=0A= bddp->prev_cu_cmd =3D SCB_CUC_LOAD_BASE;=0A= - bddp->scbp->scb_gen_ptr =3D 0;=0A= + writel(0, &bddp->scbp->scb_gen_ptr);=0A= e100_exec_cmd(bdp, SCB_CUC_LOAD_BASE);=0A= =0A= =0A= @@ -2181,7 +2184,7 @@=0A= return (B_FALSE);=0A= =0A= /* Load the RU BASE (set to 0, because we use linear mode) */=0A= - bddp->scbp->scb_gen_ptr =3D 0;=0A= + writel(0, &bddp->scbp->scb_gen_ptr);=0A= bddp->prev_cu_cmd =3D SCB_RUC_LOAD_BASE;=0A= e100_exec_cmd(bdp, SCB_RUC_LOAD_BASE);=0A= =0A= @@ -2209,8 +2212,8 @@=0A= /* If 82558/9 and if the user has enabled flow control, set up * = the=0A= * Flow Control Reg. in the CSR */=0A= if ((bddp->flags & IS_BACHELOR) && (e100_flow_control_enable)) = {=0A= - bddp->scbp->scb_ext.d101_scb.scb_fc_thld =3D DFLT_FC_THLD;=0A= - bddp->scbp->scb_ext.d101_scb.scb_fc_xon_xoff =3D = DFLT_FC_CMD;=0A= + writeb(DFLT_FC_THLD, = &bddp->scbp->scb_ext.d101_scb.scb_fc_thld);=0A= + writeb(DFLT_FC_CMD, = &bddp->scbp->scb_ext.d101_scb.scb_fc_xon_xoff);=0A= }=0A= =0A= return (B_TRUE);=0A= @@ -2660,9 +2663,9 @@=0A= bdp =3D dev->priv;=0A= bddp =3D bdp->bddp;=0A= =0A= - intr_status =3D bddp->scbp->scb_status & SCB_STATUS_ACK_MASK;=0A= + intr_status =3D readw(&bddp->scbp->scb_status) & = SCB_STATUS_ACK_MASK;=0A= if (!intr_status) return; /* not our intr - return = */=0A= - bddp->scbp->scb_status =3D intr_status; /* ack intrs */ =0A= + writew(intr_status, &bddp->scbp->scb_status); /* ack intrs */ = =0A= e100_dis_intr(bdp); /* prevent intr from happen on another CPU = */=0A= =0A= /* increment intr counter for CNA delay adjustment (82558/9 only) = */=0A= @@ -2680,7 +2683,7 @@=0A= =0A= e100_rx_srv(bdp); =0A= /* restart the RU if it has stopped */=0A= - if ((bddp->scbp->scb_status & SCB_RUS_MASK) !=3D = SCB_RUS_READY) =0A= + if ((readw(&bddp->scbp->scb_status) & SCB_RUS_MASK) !=3D = SCB_RUS_READY) =0A= e100_start_ru(bdp);=0A= }=0A= =0A= @@ -2847,7 +2850,7 @@=0A= =0A= tcb_poolp->head =3D tcb_head;=0A= if ((tcb_head !=3D tcb_poolp->tail) && !last_tcb_served ) {=0A= - if ((bddp->scbp->scb_status & SCB_CUS_MASK) =3D=3D = SCB_CUS_IDLE) {=0A= + if ((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) =3D=3D = SCB_CUS_IDLE) {=0A= printk(KERN_WARNING "CU idle while %d tcbs to tx\n",=0A= tcb_poolp->head-tcb_poolp->tail); =0A= }=0A= @@ -2896,7 +2899,7 @@=0A= =0A= #if (DEBUG) =0A= printk(KERN_DEBUG "e100_rx_srv - B. b %d scb_status=3D0x%x\n",=0A= - bdp->bd_number, bddp->scbp->scb_status);=0A= + bdp->bd_number, readw(&bddp->scbp->scb_status));=0A= printk(KERN_DEBUG " rfd_head =3D 0x%p\n", bddp->rfd_head);=0A= #endif=0A= =0A= @@ -3223,7 +3226,7 @@=0A= printk(KERN_DEBUG " - B. b %d tcb[h=3D0x%x t=3D0x%x c=3D0x%x ] = scb_status 0x%x\n",=0A= bdp->bd_number,=0A= tcb_poolp->head, tcb_poolp->tail, tcb_poolp->count,=0A= - bddp->scbp->scb_status);=0A= + readw(&bddp->scbp->scb_status));=0A= printk(KERN_DEBUG " - TCB_TO_USE =3D 0x%x\n", = TCB_TO_USE(tcb_poolp));=0A= #endif=0A= =0A= @@ -3381,8 +3384,8 @@=0A= }=0A= =0A= /* If it is idle, do a start */=0A= - if ((bddp->scbp->scb_status & SCB_CUS_MASK) =3D=3D SCB_CUS_IDLE) = {=0A= - bddp->scbp->scb_gen_ptr =3D tcbp->tcb_paddr;=0A= + if ((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) =3D=3D = SCB_CUS_IDLE) {=0A= + writel(tcbp->tcb_paddr, &bddp->scbp->scb_gen_ptr);=0A= e100_exec_cmd(bdp, SCB_CUC_START);=0A= bddp->prev_cu_cmd =3D CB_TRANSMIT_FIRST;=0A= #if (DEBUG_TX)=0A= @@ -3391,7 +3394,7 @@=0A= printk(KERN_DEBUG " tcb_paddr =3D 0x%x\n", = tcbp->tcb_paddr);=0A= printk(KERN_DEBUG " bddp =3D 0x%x\n", bddp);=0A= printk(KERN_DEBUG " scbp =3D 0x%x\n", bddp->scbp);=0A= - printk(KERN_DEBUG " scb_gen_ptr =3D 0x%x\n", = bddp->scbp->scb_gen_ptr);=0A= + printk(KERN_DEBUG " scb_gen_ptr =3D 0x%x\n", = readl(&bddp->scbp->scb_gen_ptr));=0A= #endif =0A= spin_unlock_irqrestore(&bddp->bd_lock, lock_flag);=0A= return;=0A= @@ -3400,20 +3403,20 @@=0A= /* If it is active, but if the previous command was not a transmit = * then =0A= * wait for the command to finish, and then do a start */=0A= loop_cnt =3D 0;=0A= - while (((bddp->scbp->scb_status & SCB_CUS_MASK) !=3D SCB_CUS_IDLE) = &&=0A= + while (((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) !=3D = SCB_CUS_IDLE) &&=0A= (loop_cnt < 5)) {=0A= loop_cnt++;=0A= drv_usecwait(5);=0A= }=0A= =0A= - bddp->scbp->scb_gen_ptr =3D tcbp->tcb_paddr;=0A= + writel(tcbp->tcb_paddr, &bddp->scbp->scb_gen_ptr);=0A= e100_exec_cmd(bdp, SCB_CUC_START);=0A= bddp->prev_cu_cmd =3D CB_TRANSMIT_FIRST;=0A= #if (DEBUG_TX)=0A= /* E100_DEBUG */=0A= printk(KERN_DEBUG "cu_start: did START 2, cmd =3D 0x%x\n", = SCB_CUC_START);=0A= printk(KERN_DEBUG " tcb_paddr =3D 0x%x\n", = tcbp->tcb_paddr);=0A= - printk(KERN_DEBUG " scb_gen_ptr =3D 0x%x\n", = bddp->scbp->scb_gen_ptr);=0A= + printk(KERN_DEBUG " scb_gen_ptr =3D 0x%x\n", = readl(&bddp->scbp->scb_gen_ptr));=0A= #endif=0A= spin_unlock_irqrestore(&bddp->bd_lock, lock_flag);=0A= return;=0A= @@ -3514,7 +3517,7 @@=0A= bddp->pselftest->st_result);=0A= #endif=0A= /* Do the port command */=0A= - bddp->scbp->scb_port =3D SelfTestCommandCode;=0A= + writel(SelfTestCommandCode, &bddp->scbp->scb_port);=0A= =0A= /* Wait 5 milliseconds for the self-test to complete */=0A= mdelay(50);=0A= @@ -3789,7 +3792,7 @@=0A= (bddp->prev_cu_cmd =3D=3D CB_TRANSMIT_FIRST)) {=0A= /* Wait for suspended state */=0A= e100_retry =3D E100_CMD_WAIT;=0A= - while (((bddp->scbp->scb_status & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= + while (((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= && (e100_retry)) {=0A= mdelay(20);=0A= e100_retry--;=0A= @@ -3797,7 +3800,7 @@=0A= }=0A= =0A= /* write the config buffer in the scb gen pointer */=0A= - bddp->scbp->scb_gen_ptr =3D bddp->nontx_paddr;=0A= + writel(bddp->nontx_paddr, &bddp->scbp->scb_gen_ptr);=0A= =0A= /* store the command */=0A= bddp->prev_cu_cmd =3D CB_CONFIGURE;=0A= @@ -3869,7 +3872,7 @@=0A= /* Wait for suspended state */=0A= /* Set timeout to 100 ms */=0A= i =3D 0;=0A= - while (((bddp->scbp->scb_status & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= + while (((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= && (i < 5)) {=0A= mdelay(20);=0A= i++;=0A= @@ -3877,7 +3880,7 @@=0A= }=0A= =0A= /* Update the command list pointer. */=0A= - bddp->scbp->scb_gen_ptr =3D bddp->nontx_paddr;=0A= + writel(bddp->nontx_paddr, &bddp->scbp->scb_gen_ptr);=0A= =0A= /* store the command */=0A= bddp->prev_cu_cmd =3D CB_IA_ADDRESS;=0A= @@ -3921,7 +3924,7 @@=0A= int lock_flag;=0A= sk_buff_t *skb; =0A= /* If the receiver is ready, then don't try to restart. */=0A= - if ((bddp->scbp->scb_status & SCB_RUS_MASK) =3D=3D SCB_RUS_READY) = {=0A= + if ((readw(&bddp->scbp->scb_status) & SCB_RUS_MASK) =3D=3D = SCB_RUS_READY) {=0A= return;=0A= }=0A= for(skb =3D bddp->rfd_head; skb !=3D NULL; skb =3D = NEXT_SKB(skb,bddp)){=0A= @@ -3938,7 +3941,7 @@=0A= spin_lock(&bddp->bd_lock);=0A= =0A= e100_wait_scb(bdp);=0A= - bddp->scbp->scb_gen_ptr =3D = cpu_to_le32(GET_SKB_DMA_ADDR(skb,bddp));=0A= + writel(cpu_to_le32(GET_SKB_DMA_ADDR(skb,bddp)), = &bddp->scbp->scb_gen_ptr);=0A= e100_exec_cmd(bdp, SCB_RUC_START);=0A= =0A= spin_unlock(&bddp->bd_lock);=0A= @@ -3995,7 +3998,7 @@=0A= /* Load the dump counters pointer. Since this command is = generated only=0A= * * after the IA setup has complete, we don't need to wait for = the SCB * =0A= * command word to clear */=0A= - bddp->scbp->scb_gen_ptr =3D bddp->stat_cnt_paddr;=0A= + writel(bddp->stat_cnt_paddr, &bddp->scbp->scb_gen_ptr);=0A= =0A= /* Issue the load dump counters address command */=0A= bddp->prev_cu_cmd =3D SCB_CUC_DUMP_ADDR;=0A= @@ -4053,7 +4056,7 @@=0A= =0A= retry =3D DUMP_STATS_TIMEOUT;=0A= =0A= - while (((bddp->scbp->scb_status & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= + while (((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= && (retry)) {=0A= mdelay(20);=0A= retry--;=0A= @@ -4084,7 +4087,7 @@=0A= e100_exec_cmd(bdp, SCB_CUC_DUMP_RST_STAT);=0A= =0A= /* check the status of the CU, */=0A= - if ((bddp->scbp->scb_status & SCB_CUS_MASK) =3D=3D 0) /* is idle = */=0A= + if ((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) =3D=3D 0) /* = is idle */=0A= bddp->prev_cu_cmd =3D CB_NULL;=0A= spin_unlock_irqrestore(&bddp->bd_lock, lock_flag_bd);=0A= spin_unlock_irqrestore(&bddp->bd_tx_lock, lock_flag_tx);=0A= @@ -4159,6 +4162,7 @@=0A= e100_exec_cmd(bdp, SCB_CUC_START);=0A= =0A= =0A= + mdelay(20);=0A= /* Wait for the SCB to clear, indicating the completion of the = command. */=0A= if (e100_wait_scb(bdp) !=3D B_TRUE) {=0A= return (B_FALSE);=0A= @@ -4209,7 +4213,7 @@=0A= bdd_t *bddp =3D bdp->bddp; /* stores all adapter specific = info */=0A= =0A= do {=0A= - if (!bddp->scbp->scb_cmd_low)=0A= + if (!readb(&bddp->scbp->scb_cmd_low))=0A= return B_TRUE;=0A= =0A= drv_usecwait(1);=0A= @@ -4240,7 +4244,7 @@=0A= printk(KERN_DEBUG "e100_sw_reset, cmd =3D 0x%x\n", reset_cmd);=0A= #endif=0A= /* Issue a PORT command with a data word of 0 */=0A= - bddp->scbp->scb_port =3D reset_cmd;=0A= + writel(reset_cmd, &bddp->scbp->scb_port );=0A= =0A= /* wait 5 milliseconds for the reset to take effect */=0A= mdelay(5);=0A= @@ -4384,7 +4388,7 @@=0A= /* Wait for suspended state */=0A= /* Set timeout to 100 ms */=0A= i =3D 0;=0A= - while (((bddp->scbp->scb_status & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= + while (((readw(&bddp->scbp->scb_status) & SCB_CUS_MASK) =3D=3D = SCB_CUS_ACTIVE)=0A= && (i < 5)) {=0A= mdelay(20);=0A= i++;=0A= @@ -4395,7 +4399,7 @@=0A= }=0A= =0A= /* Update the command list pointer. */=0A= - bddp->scbp->scb_gen_ptr =3D bddp->nontx_paddr;=0A= + writel(bddp->nontx_paddr, &bddp->scbp->scb_gen_ptr);=0A= =0A= /* store the command */=0A= bddp->prev_cu_cmd =3D CB_LOAD_MICROCODE;=0A= @@ -4452,7 +4456,7 @@=0A= printk(KERN_DEBUG "e100_rd_eaddr: begin\n");=0A= =0A= /* Read SCB reg General Control 2 */=0A= - data =3D bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2;=0A= + data =3D readb(&bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2);=0A= =0A= if(bddp->rev_id >=3D D102_REV_ID)=0A= {=0A= @@ -4464,8 +4468,8 @@=0A= we will just loop until we get it. */=0A= =0A= data |=3D SCB_GCR2_EEPROM_ACCESS_SEMAPHORE;=0A= - bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2 =3D data;=0A= - data =3D bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2;=0A= + writeb(data, = &bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2);=0A= + data =3D = readb(&bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2);=0A= =0A= }=0A= }=0A= @@ -4486,9 +4490,9 @@=0A= /* Read SCB reg General Control 2 */=0A= if(bddp->rev_id >=3D D102_REV_ID)=0A= {=0A= - data =3D bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2;=0A= + data =3D = readb(&bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2);=0A= data &=3D ~SCB_GCR2_EEPROM_ACCESS_SEMAPHORE;=0A= - bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2 =3D data;=0A= + writeb(data, &bddp->scbp->scb_ext.d102_scb.scb_gen_ctrl2);=0A= }=0A= =0A= /* fill in the device structure... */=0A= @@ -5366,6 +5370,7 @@=0A= * the ForceSpeedAndUplex routine. If it isn't then we need to = check * to =0A= * see if autoneg has completed and if we need to restart it. = */=0A= if (!((board_speed_duplex >=3D 1) && (board_speed_duplex <=3D 4))) = {=0A= +printk("AUTO\n");=0A= e100_auto_neg(bdp);=0A= e100_FindPhySpeedAndDpx(bdp, PhyId);=0A= }=0A= @@ -5560,7 +5565,7 @@=0A= /* First we should check to see if we have link */=0A= /* If we don't have link no reason to print a speed and duplex = */=0A= if ((bddp->rev_id >=3D 8) || (bddp->flags & IS_ICH)) {=0A= - if (!(bddp->scbp->scb_ext.d101m_scb.scb_gen_stat & BIT_0)) = {=0A= + if (!(readb(&bddp->scbp->scb_ext.d101m_scb.scb_gen_stat) & = BIT_0)) {=0A= bddp->cur_line_speed =3D 0;=0A= bddp->cur_dplx_mode =3D NO_DUPLEX;=0A= return;=0A= @@ -5582,13 +5587,13 @@=0A= * SCB. So, we save an MdiRead and get these from the SCB. * */=0A= if ((bddp->rev_id >=3D 8) || (bddp->flags & IS_ICH)) {=0A= /* Read speed */=0A= - if (bddp->scbp->scb_ext.d101m_scb.scb_gen_stat & BIT_1)=0A= + if (readb(&bddp->scbp->scb_ext.d101m_scb.scb_gen_stat) & = BIT_1)=0A= bddp->cur_line_speed =3D 100;=0A= else=0A= bddp->cur_line_speed =3D 10;=0A= =0A= /* Read duplex */=0A= - if (bddp->scbp->scb_ext.d101m_scb.scb_gen_stat & BIT_2)=0A= + if (readb(&bddp->scbp->scb_ext.d101m_scb.scb_gen_stat) & = BIT_2)=0A= bddp->cur_dplx_mode =3D FULL_DUPLEX;=0A= else=0A= bddp->cur_dplx_mode =3D HALF_DUPLEX;=0A= @@ -5959,7 +5964,7 @@=0A= /* If the controller is a 82559 or later one, link status is = available=0A= * from the CSR. This avoids the MdiRead. */=0A= if ((bddp->rev_id >=3D 8) || (bddp->flags & IS_ICH)) {=0A= - if (bddp->scbp->scb_ext.d101m_scb.scb_gen_stat & BIT_0) {=0A= + if (readb(&bddp->scbp->scb_ext.d101m_scb.scb_gen_stat) & = BIT_0) {=0A= /* Link is up */=0A= return (B_TRUE);=0A= } else =0A= @@ -6010,14 +6015,14 @@=0A= temp_val =3D (((uint32_t) DataValue) |=0A= (RegAddress << 16) | (PhyAddress << 21) | (MDI_WRITE <<=0A= 26));=0A= - bddp->scbp->scb_mdi_cntrl =3D temp_val;=0A= + writel(temp_val, &bddp->scbp->scb_mdi_cntrl);=0A= =0A= /* wait 20usec before checking status */=0A= drv_usecwait(20); /* Removed mstous. */=0A= =0A= /* poll for the mdi write to complete */=0A= e100_retry =3D E100_CMD_WAIT;=0A= - while ((!(bddp->scbp->scb_mdi_cntrl & MDI_PHY_READY)) && = (e100_retry)) {=0A= + while ((!(readl(&bddp->scbp->scb_mdi_cntrl) & MDI_PHY_READY)) && = (e100_retry)) {=0A= drv_usecwait(20); /* Removed mstous. */=0A= e100_retry--;=0A= }=0A= @@ -6056,14 +6061,14 @@=0A= /* Issue the read command to the MDI control register. */=0A= temp_val =3D=0A= ((RegAddress << 16) | (PhyAddress << 21) | (MDI_READ << = 26));=0A= - bddp->scbp->scb_mdi_cntrl =3D temp_val;=0A= + writel(temp_val, &bddp->scbp->scb_mdi_cntrl );=0A= =0A= /* wait 20usec before checking status */=0A= drv_usecwait(20); /* Removed mstous. */=0A= =0A= /* poll for the mdi read to complete */=0A= e100_retry =3D E100_CMD_WAIT;=0A= - while ((!(bddp->scbp->scb_mdi_cntrl & MDI_PHY_READY)) && = (e100_retry)) {=0A= + while ((!(readl(&bddp->scbp->scb_mdi_cntrl) & MDI_PHY_READY)) && = (e100_retry)) {=0A= drv_usecwait(20);=0A= e100_retry--;=0A= }=0A= @@ -6075,7 +6080,7 @@=0A= *DataValue =3D 0;=0A= =0A= =0A= - *DataValue =3D (uint16_t) bddp->scbp->scb_mdi_cntrl;=0A= + *DataValue =3D (uint16_t) readl(&bddp->scbp->scb_mdi_cntrl);=0A= }=0A= =0A= =0A= @@ -7893,7 +7898,7 @@=0A= bddp =3D (pbdd_t) bdp->bddp; /* get the bddp for this board = */=0A= =0A= /* Disable interrupts on our PCI board by setting the mask bit = */=0A= - bddp->scbp->scb_cmd_hi =3D (uint8_t) SCB_INT_MASK;=0A= + writeb((uint8_t) SCB_INT_MASK, &bddp->scbp->scb_cmd_hi);=0A= }=0A= =0A= =0A= @@ -7920,7 +7925,7 @@=0A= bddp =3D (pbdd_t) bdp->bddp; /* get the bddp for this board = */=0A= =0A= /* Enable interrupts on our PCI board by clearing the mask bit = */=0A= - bddp->scbp->scb_cmd_hi =3D (uint8_t) 0;=0A= + writeb(0, &bddp->scbp->scb_cmd_hi);=0A= }=0A= =0A= =0A= @@ -7931,7 +7936,7 @@=0A= =0A= bddp =3D (pbdd_t) bdp->bddp; =0A= /* Trigger interrupt on our PCI board by asserting SWI bit */=0A= - bddp->scbp->scb_cmd_hi =3D (uint8_t) SCB_SOFT_INT;=0A= + writeb((uint8_t) SCB_SOFT_INT, &bddp->scbp->scb_cmd_hi);=0A= }=0A= =0A= =0A= @@ -8039,7 +8044,7 @@=0A= e100_get_pci_info(pci_dev_t * pcid, bd_config_t * bdp)=0A= {=0A= bdd_t *bddp =3D bdp->bddp;=0A= - uint32_t tmp_base_addr;=0A= + ulong_t tmp_base_addr;=0A= uint16_t pci_cmd =3D 0;=0A= =0A= if (DEBUG)=0A= @@ -8055,13 +8060,13 @@=0A= pci_set_master(pcid);=0A= =0A= /* address #0 is a memory mapping */=0A= - tmp_base_addr =3D (uint32_t)pci_resource_start(pcid, 0);=0A= + tmp_base_addr =3D (ulong_t)pci_resource_start(pcid, 0);=0A= bddp->scbp =3D (pscb_t) ioremap((tmp_base_addr & ~0xf), = sizeof(scb_t));=0A= bddp->mem_size =3D sizeof(scb_t);=0A= bdp->mem_start =3D tmp_base_addr;=0A= =0A= /* address #1 is a IO region */=0A= - tmp_base_addr =3D (uint32_t)pci_resource_start(pcid, 1);=0A= + tmp_base_addr =3D (ulong_t)pci_resource_start(pcid, 1);=0A= bdp->io_start =3D (tmp_base_addr & ~0x3UL);=0A= =0A= #if (E100_DEBUG) =0A= diff -Naur src/e100.h src2/e100.h=0A= --- src/e100.h Wed Feb 21 17:26:58 2001=0A= +++ src2/e100.h Thu Mar 29 11:38:17 2001=0A= @@ -662,8 +662,8 @@=0A= #define EEPROM_SUBSYSTEM_ID_WORD 0x0b=0A= #define EEPROM_SUBSYSTEM_VENDOR_WORD 0x0c=0A= =0A= -#define E100_WRITE_REG(reg, value) {bddp->scbp->reg =3D value; }=0A= -#define E100_READ_REG(reg) bddp->scbp->reg=0A= +#define E100_WRITE_REG(reg, value) {writew(value, &bddp->scbp->reg); = }=0A= +#define E100_READ_REG(reg) readw(&bddp->scbp->reg)=0A= =0A= #define EEPROM_CTRL scb_eprm_cntrl=0A= #define EEPROM_CHECKSUM_REG 0x3f=0A= @@ -1827,7 +1827,8 @@=0A= uint_t bd_number; /* Board Number */=0A= uint_t phy_addr; /* address of PHY component */=0A= uint32_t flags;=0A= - uint32_t io_base; /* IO base address */=0A= + ulong_t io_base; /* IO base address */=0A= +//SOO uint32_t io_base; /* IO base address */=0A= size_t mem_size; /* Memory size from devmem_size = */=0A= pscb_t scbp; /* memory mapped ptr to 82557 scb = */=0A= pself_test_t pselftest; /* pointer to self test area */=0A= @@ -1922,8 +1923,10 @@=0A= struct bdconfig *bd_next; /* pointer to next bd in chain */=0A= struct bdconfig *bd_prev; /* pointer to prev bd in chain */=0A= uint unit; /* from mdi_get_unit */=0A= - uint32_t io_start; /* start of I/O base address = */=0A= - uint32_t io_end; /* end of I/O base address = */=0A= + paddr_t io_start; /* start of I/O base address = */=0A= + paddr_t io_end; /* end of I/O base address = */=0A= +//SOO uint32_t io_start; /* start of I/O base address = */=0A= +// uint32_t io_end; /* end of I/O base address = */=0A= paddr_t mem_start; /* start of base mem address = */=0A= paddr_t mem_end; /* start of base mem address = */=0A= int irq_level; /* interrupt request level = */=0A= ------_=_NextPart_000_01C0B86B.BD156000--