Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-10-25 Thread Zang Roy-r61911
On Mon, 2006-10-23 at 10:09, Zang Roy-r61911 wrote: > On Thu, 2006-09-21 at 12:46, Jeff Garzik wrote: > > > you should have a chip structure, that contains two structs (one for > > each interface/port) > > > Jeff, > > I updated the code according to all your feedback and post it here > > http:

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-10-22 Thread Zang Roy-r61911
On Thu, 2006-09-21 at 12:46, Jeff Garzik wrote: > you should have a chip structure, that contains two structs (one for > each interface/port) > Jeff, I updated the code according to all your feedback and post it here http://www.spinics.net/lists/netdev/msg17120.html Any comment? Roy - To un

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-10-17 Thread Zang Roy-r61911
On Thu, 2006-09-21 at 12:46, Jeff Garzik wrote: > > + > > +/* Synchronization is needed between the thread and up/down events. > > + * Note that the PHY is accessed through the same registers for > both > > + * interfaces, so this can't be made interface-specific. > > + */ > > + > > +static DEFINE_

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-29 Thread Jeff Garzik
Zang Roy-r61911 wrote: Could you interpret the chip structure in more detail? Need I create two net_device struct for each port? No. One net_device per port. And one container structure for the entire device. Jeff - To unsubscribe from this list: send the line "unsubscribe netdev

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-29 Thread Zang Roy-r61911
On Thu, 2006-09-21 at 12:46, Jeff Garzik wrote: > Zang Roy-r61911 wrote: > > +struct tsi108_prv_data { > > + void __iomem *regs;/* Base of normal regs */ > > + void __iomem *phyregs; /* Base of register bank used for PHY > access */ > > + > > + int phy;/* Inde

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-20 Thread Jeff Garzik
Zang Roy-r61911 wrote: On Thu, 2006-09-21 at 12:26, Jeff Garzik wrote: Zang Roy-r61911 wrote: +#define TSI108_ETH_WRITE_REG(offset, val) \ + writel(le32_to_cpu(val),data->regs + (offset)) + +#define TSI108_ETH_READ_REG(offset) \ + le32_to_cpu(readl(data->regs + (offset))) + +#define TSI

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-20 Thread Zang Roy-r61911
On Thu, 2006-09-21 at 12:26, Jeff Garzik wrote: > Zang Roy-r61911 wrote: > > +#define TSI108_ETH_WRITE_REG(offset, val) \ > > + writel(le32_to_cpu(val),data->regs + (offset)) > > + > > +#define TSI108_ETH_READ_REG(offset) \ > > + le32_to_cpu(readl(data->regs + (offset))) > > + > > +#define

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-20 Thread Jeff Garzik
Zang Roy-r61911 wrote: +struct tsi108_prv_data { + void __iomem *regs;/* Base of normal regs */ + void __iomem *phyregs; /* Base of register bank used for PHY access */ + + int phy;/* Index of PHY for this interface */ + int irq_num; + in

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-20 Thread Jeff Garzik
Zang Roy-r61911 wrote: +#define TSI108_ETH_WRITE_REG(offset, val) \ + writel(le32_to_cpu(val),data->regs + (offset)) + +#define TSI108_ETH_READ_REG(offset) \ + le32_to_cpu(readl(data->regs + (offset))) + +#define TSI108_ETH_WRITE_PHYREG(offset, val) \ + writel(le32_to_cpu(val),

RE: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-20 Thread Arjan van de Ven
On Tue, 2006-09-19 at 15:39 +0800, Zang Roy-r61911 wrote: > > > > > + spin_unlock_irq(&phy_lock); > > > + msleep(10); > > > + spin_lock_irq(&phy_lock); > > > + } > > > > hmm some places take phy_lock with disabling interrupts, while others > > don't. I sort of fear "the o

RE: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-19 Thread Zang Roy-r61911
> > I have some review comments about your driver; please > consider them for > fixing > Thanks. > > > + spin_unlock_irq(&phy_lock); > > + msleep(10); > > + spin_lock_irq(&phy_lock); > > + } > > hmm some places take phy_lock with disabling interrupts, while

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-13 Thread Zang Roy-r61911
On Tue, 2006-09-12 at 22:43, Jeff Garzik wrote: > Roland Dreier wrote: > > > +struct tsi108_prv_data { > > > + volatile u32 regs; /* Base of normal regs */ > > > + volatile u32 phyregs; /* Base of register bank used for PHY > access */ > > > > Why volatile? This looks really wrong her

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-12 Thread Jeff Garzik
Roland Dreier wrote: > +struct tsi108_prv_data { > + volatile u32 regs; /* Base of normal regs */ > + volatile u32 phyregs; /* Base of register bank used for PHY access */ Why volatile? This looks really wrong here. Indeed. > + data->regs = (u32)ioremap(einfo->regs, 0x400);/

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-12 Thread Roland Dreier
> +struct tsi108_prv_data { > +volatile u32 regs; /* Base of normal regs */ > +volatile u32 phyregs; /* Base of register bank used for PHY access */ Why volatile? This looks really wrong here. > +data->regs = (u32)ioremap(einfo->regs, 0x400); /*FIX ME */ > +data->phy

Re: [patch 3/3] Add tsi108 On Chip Ethernet device driver support

2006-09-12 Thread Arjan van de Ven
On Tue, 2006-09-12 at 16:55 +0800, Zang Roy-r61911 wrote: > The driver for tsi108/9 on chip Ethernet port Hi, I have some review comments about your driver; please consider them for fixing > + > +#undef DEBUG > +#ifdef DEBUG > +#define DBG(fmt...) do { printk(fmt); } while(0) > +#else > +#de