On Sun, 2005-02-20 at 14:54 -0700, Jamie Painter wrote:

>  
> +static int ax8817x_reset_mm(struct usbnet *dev) {
> +     int lpa;
> +     int mode;
> +
> +     /* Initialize fullduplex flow control */
> +     mode = 0;
> +     ax8817x_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS, 0, 0, 1, &mode);
> +     devdbg( dev, "Medium status before: 0x%02x", mode );
> +


In addition, this call to read the medium status as well as the one to
read the after affects really isn't needed is it?  It's just for
debugging purposes.  It would be best to pull them as we are then
potentially doing DMA with stack memory (the mode variable) which
doesn't work on some archs.  ax8817x_mdio_read() actually does still
have this potential problem and I need to work up a quick patch for it,
but this reset function wouldn't have to change for that.

> +     mode = AX_MEDIUM_TX_ABORT_ALLOW|AX_MEDIUM_FLOW_CONTROL_EN;
> +     lpa = ax8817x_mdio_read(dev->net,dev->mii.phy_id, MII_LPA);
> +     if ((lpa & (LPA_100FULL|LPA_100BASE4)) != 0) /* 100baseTx-FD */
> +             mode |= AX_MEDIUM_FULL_DUPLEX;
> +     ax8817x_write_cmd(dev, AX_CMD_WRITE_MEDIUM_MODE, mode, 0, 0, NULL);
> +
> +     ax8817x_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS, 0, 0, 1, &mode);
> +     devdbg( dev, "Medium status after: 0x%02x", mode );
> +     return 0;
> +}
> +

-- 
David Hollis <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to