lkml.org 
[lkml]   [2000]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: acenic-v0.46 update
Jes,

I've been debugging a new acenic device for HP and have been using a
linux machine for bring up. One of the problems we encountered was a
need to change the cards MAC address. Under linux ia32, the driver set
an invalid MAC address. If I would
say
ifconfig eth0 hw ether 00:01:23:45:67:89 (for example only)

Linux would know of it's correct MAC address, but the card had a
different
address. Through reading of the MAC registers (offset 0xb80-0xbf0), the
card
thought it's MAC address was 01:00:45:23:89:67. Attached is a patch
that
would not do the halfword byte swapping.

Also, I have tested this device driver on a HP XU-800 Kayak (IA32) using
the HP 1000Base-T Lan Adapter A4929A device (copper), but it should also
work on the HP 1000Base-SX Lan Adapter A4926A (fiber). Both of these
devices are 64-bit PCI. I've not been able to test the A4924A or A4925A
because they are both on the (HP's) HSC bus.

These device specs can be found at:
A4926A -
http://www.unixsolutions.hp.com/products/networking/links/1000base.html
A4929A -
http://www.unixsolutions.hp.com/products/networking/links/gigetlpg.html

The attached patch is against version 0.46. I also have a device driver
that allows me to dump all the acenic registers. Let me know if you're
interested in a #define'd out patch.

-Stephen Hack
stephen_hack@hp.com

Jes Sorensen wrote:
>
> Hi
>
> Here is a patch for the acenic-v0.46 driver relative to whats in
> test8-pre4 - it solves a few bugs and cleans up a few minor issues in
> the code and comments.
>
> I have been unable to test this patch but looking over the changes I
> cannot see any reason why it would cause problems.
>
> Jes
> <snip>diff -c drivers.old/net/acenic.c drivers/net/acenic.c
*** drivers.old/net/acenic.c Tue Sep 5 13:21:11 2000
--- drivers/net/acenic.c Wed Sep 6 09:52:25 2000
***************
*** 35,40 ****
--- 35,42 ----
* Ken Aaker <kdaaker@rchland.vnet.ibm.com>: Correct check for whether
* memory mapped IO is enabled to
* make the driver work on RS/6000.
+ * Stephen Hack <stephen_hack@hp.com>: Fixed ace_set_mac_addr for little
+ * endian systems.
*/

#include <linux/config.h>
***************
*** 2554,2560 ****
{
struct sockaddr *addr=p;
struct ace_regs *regs;
! u16 *da;
struct cmd cmd;

if(netif_running(dev))
--- 2556,2562 ----
{
struct sockaddr *addr=p;
struct ace_regs *regs;
! u8 *da;
struct cmd cmd;

if(netif_running(dev))
***************
*** 2562,2572 ****

memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);

! da = (u16 *)dev->dev_addr;

regs = ((struct ace_private *)dev->priv)->regs;
! writel(da[0], &regs->MacAddrHi);
! writel((da[1] << 16) | da[2], &regs->MacAddrLo);

cmd.evt = C_SET_MAC_ADDR;
cmd.code = 0;
--- 2564,2574 ----

memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);

! da = (u8 *)dev->dev_addr;

regs = ((struct ace_private *)dev->priv)->regs;
! writel(da[0] << 8 | da[1], &regs->MacAddrHi);
! writel((da[2] << 24) | (da[3] << 16) | (da[4] << 8) | da[5] , &regs->MacAddrLo);

cmd.evt = C_SET_MAC_ADDR;
cmd.code = 0;
begin:vcard
n:Hack;Stephen
tel;home:(970) 225-0820
tel;work:(970) 898-1545
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:stephen_hack@hp.com
x-mozilla-cpt:;28608
fn:Stephen Hack
end:vcard
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.045 / U:3.008 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site