Texas Instruments TNETE100A Network Card User Manual


 
MII PHY Registers
2-21
ThunderLAN Registers
This samples data on the rising edge of the MCLK bit. Take the first bit into the
PHY MII as follows:
b &= ~MCLK; outp(diodata,b);
b |= MDATA; outp(diodata,b);
b |= MCLK; outp(diodata,b); //1 data bit out
This concludes writing out the start delimiter bits. The data can be changed
before the clock is taken low, as when shifting out the operation code as fol-
lows:
b |= MDATA; outp(diodata,b); //1st part not nec.
//togLH
b &= ~MCLK; outp(diodata,b);
b |= MCLK; outp(diodata,b); //1
b &= ~MDATA; outp(diodata,b);
//togLH
b &= ~MCLK; outp(diodata,b);
b |= MCLK; outp(diodata,b); //0
10 is the read op code for an MII management operation.
// Send the device number Internal=31(0x1f),
External=0(0x00)
for (i = 0x10;i;i >>= 1) /* 10 is the read op code*/
{
if (i&dev)
b |= MDATA;
else
b &= ~MDATA;
outp(diodata,b);
//togLH
b &= ~MCLK; outp(diodata,b);
b |= MCLK; outp(diodata,b);
}
The following loop index is used as a mask to walk through the device number
which is passed to this routine as a parameter. Each loop looks at a bit in the
device number, starting with the MSB. It sets the MDATA bit to match the inter-
nal representation of the NetSio register before outputting the composite value