mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-18 11:54:37 +08:00
misc drivers/net annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
05bd831fcd
commit
eca1ad82bd
@ -966,8 +966,8 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
|
|||||||
|
|
||||||
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
|
addr_len = read_eeprom (ioaddr, 0, 8) == 0x8129 ? 8 : 6;
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
((u16 *) (dev->dev_addr))[i] =
|
((__le16 *) (dev->dev_addr))[i] =
|
||||||
le16_to_cpu (read_eeprom (ioaddr, i + 7, addr_len));
|
cpu_to_le16(read_eeprom (ioaddr, i + 7, addr_len));
|
||||||
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
|
||||||
|
|
||||||
/* The Rtl8139-specific entries in the device structure. */
|
/* The Rtl8139-specific entries in the device structure. */
|
||||||
@ -1373,8 +1373,8 @@ static void rtl8139_hw_start (struct net_device *dev)
|
|||||||
/* unlock Config[01234] and BMCR register writes */
|
/* unlock Config[01234] and BMCR register writes */
|
||||||
RTL_W8_F (Cfg9346, Cfg9346_Unlock);
|
RTL_W8_F (Cfg9346, Cfg9346_Unlock);
|
||||||
/* Restore our idea of the MAC address. */
|
/* Restore our idea of the MAC address. */
|
||||||
RTL_W32_F (MAC0 + 0, cpu_to_le32 (*(u32 *) (dev->dev_addr + 0)));
|
RTL_W32_F (MAC0 + 0, le32_to_cpu (*(__le32 *) (dev->dev_addr + 0)));
|
||||||
RTL_W32_F (MAC0 + 4, cpu_to_le32 (*(u32 *) (dev->dev_addr + 4)));
|
RTL_W32_F (MAC0 + 4, le16_to_cpu (*(__le16 *) (dev->dev_addr + 4)));
|
||||||
|
|
||||||
/* Must enable Tx/Rx before setting transfer thresholds! */
|
/* Must enable Tx/Rx before setting transfer thresholds! */
|
||||||
RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb);
|
RTL_W8 (ChipCmd, CmdRxEnb | CmdTxEnb);
|
||||||
@ -1945,7 +1945,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
|
|||||||
rmb();
|
rmb();
|
||||||
|
|
||||||
/* read size+status of next frame from DMA ring buffer */
|
/* read size+status of next frame from DMA ring buffer */
|
||||||
rx_status = le32_to_cpu (*(u32 *) (rx_ring + ring_offset));
|
rx_status = le32_to_cpu (*(__le32 *) (rx_ring + ring_offset));
|
||||||
rx_size = rx_status >> 16;
|
rx_size = rx_status >> 16;
|
||||||
pkt_size = rx_size - 4;
|
pkt_size = rx_size - 4;
|
||||||
|
|
||||||
|
@ -378,8 +378,8 @@ static void __init get_node_ID(struct net_device *dev)
|
|||||||
sa_offset = 15;
|
sa_offset = 15;
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
((u16 *)dev->dev_addr)[i] =
|
((__be16 *)dev->dev_addr)[i] =
|
||||||
be16_to_cpu(eeprom_op(ioaddr, EE_READ(sa_offset + i)));
|
cpu_to_be16(eeprom_op(ioaddr, EE_READ(sa_offset + i)));
|
||||||
|
|
||||||
write_reg(ioaddr, CMR2, CMR2_NULL);
|
write_reg(ioaddr, CMR2, CMR2_NULL);
|
||||||
}
|
}
|
||||||
|
@ -971,7 +971,8 @@ static int __devinit dfx_driver_init(struct net_device *dev,
|
|||||||
int alloc_size; /* total buffer size needed */
|
int alloc_size; /* total buffer size needed */
|
||||||
char *top_v, *curr_v; /* virtual addrs into memory block */
|
char *top_v, *curr_v; /* virtual addrs into memory block */
|
||||||
dma_addr_t top_p, curr_p; /* physical addrs into memory block */
|
dma_addr_t top_p, curr_p; /* physical addrs into memory block */
|
||||||
u32 data, le32; /* host data register value */
|
u32 data; /* host data register value */
|
||||||
|
__le32 le32;
|
||||||
char *board_name = NULL;
|
char *board_name = NULL;
|
||||||
|
|
||||||
DBG_printk("In dfx_driver_init...\n");
|
DBG_printk("In dfx_driver_init...\n");
|
||||||
|
@ -511,10 +511,10 @@ enum PhyCtrl_bits {
|
|||||||
/* Note that using only 32 bit fields simplifies conversion to big-endian
|
/* Note that using only 32 bit fields simplifies conversion to big-endian
|
||||||
architectures. */
|
architectures. */
|
||||||
struct netdev_desc {
|
struct netdev_desc {
|
||||||
u32 next_desc;
|
__le32 next_desc;
|
||||||
s32 cmd_status;
|
__le32 cmd_status;
|
||||||
u32 addr;
|
__le32 addr;
|
||||||
u32 software_use;
|
__le32 software_use;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Bits in network_desc.status */
|
/* Bits in network_desc.status */
|
||||||
@ -2018,7 +2018,7 @@ static void drain_rx(struct net_device *dev)
|
|||||||
/* Free all the skbuffs in the Rx queue. */
|
/* Free all the skbuffs in the Rx queue. */
|
||||||
for (i = 0; i < RX_RING_SIZE; i++) {
|
for (i = 0; i < RX_RING_SIZE; i++) {
|
||||||
np->rx_ring[i].cmd_status = 0;
|
np->rx_ring[i].cmd_status = 0;
|
||||||
np->rx_ring[i].addr = 0xBADF00D0; /* An invalid address. */
|
np->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
|
||||||
if (np->rx_skbuff[i]) {
|
if (np->rx_skbuff[i]) {
|
||||||
pci_unmap_single(np->pci_dev,
|
pci_unmap_single(np->pci_dev,
|
||||||
np->rx_dma[i], buflen,
|
np->rx_dma[i], buflen,
|
||||||
|
@ -155,7 +155,7 @@ static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
|
|||||||
dm_write_async_helper(dev, reg, value, 0, NULL);
|
dm_write_async_helper(dev, reg, value, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, u16 *value)
|
static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *value)
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, u16 *value)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, u16 value)
|
static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 value)
|
||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ static int dm9601_get_eeprom(struct net_device *net,
|
|||||||
struct ethtool_eeprom *eeprom, u8 * data)
|
struct ethtool_eeprom *eeprom, u8 * data)
|
||||||
{
|
{
|
||||||
struct usbnet *dev = netdev_priv(net);
|
struct usbnet *dev = netdev_priv(net);
|
||||||
u16 *ebuf = (u16 *) data;
|
__le16 *ebuf = (__le16 *) data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* access is 16bit */
|
/* access is 16bit */
|
||||||
@ -268,7 +268,7 @@ static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc)
|
|||||||
{
|
{
|
||||||
struct usbnet *dev = netdev_priv(netdev);
|
struct usbnet *dev = netdev_priv(netdev);
|
||||||
|
|
||||||
u16 res;
|
__le16 res;
|
||||||
|
|
||||||
if (phy_id) {
|
if (phy_id) {
|
||||||
devdbg(dev, "Only internal phy supported");
|
devdbg(dev, "Only internal phy supported");
|
||||||
@ -288,7 +288,7 @@ static void dm9601_mdio_write(struct net_device *netdev, int phy_id, int loc,
|
|||||||
int val)
|
int val)
|
||||||
{
|
{
|
||||||
struct usbnet *dev = netdev_priv(netdev);
|
struct usbnet *dev = netdev_priv(netdev);
|
||||||
u16 res = cpu_to_le16(val);
|
__le16 res = cpu_to_le16(val);
|
||||||
|
|
||||||
if (phy_id) {
|
if (phy_id) {
|
||||||
devdbg(dev, "Only internal phy supported");
|
devdbg(dev, "Only internal phy supported");
|
||||||
|
@ -218,7 +218,7 @@ EXPORT_SYMBOL_GPL(rndis_command);
|
|||||||
* ActiveSync 4.1 Windows driver.
|
* ActiveSync 4.1 Windows driver.
|
||||||
*/
|
*/
|
||||||
static int rndis_query(struct usbnet *dev, struct usb_interface *intf,
|
static int rndis_query(struct usbnet *dev, struct usb_interface *intf,
|
||||||
void *buf, u32 oid, u32 in_len,
|
void *buf, __le32 oid, u32 in_len,
|
||||||
void **reply, int *reply_len)
|
void **reply, int *reply_len)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
Loading…
Reference in New Issue
Block a user