drivers/net: Move && and || to end of previous line

Only files where David Miller is the primary git-signer.
wireless, wimax, ixgbe, etc are not modified.

Compile tested x86 allyesconfig only
Not all files compiled (not x86 compatible)

Added a few > 80 column lines, which I ignored.
Existing checkpatch complaints ignored.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Joe Perches 2009-12-03 07:58:21 +00:00 коммит произвёл David S. Miller
Родитель 3454f83583
Коммит 8e95a2026f
132 изменённых файлов: 799 добавлений и 805 удалений

Просмотреть файл

@ -249,11 +249,11 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
* for the Sager NP943 prefix. * for the Sager NP943 prefix.
*/ */
if (station_addr[0] == 0x02 && station_addr[1] == 0x60 if (station_addr[0] == 0x02 && station_addr[1] == 0x60 &&
&& station_addr[2] == 0x8c) station_addr[2] == 0x8c)
mname = "3c501"; mname = "3c501";
else if (station_addr[0] == 0x00 && station_addr[1] == 0x80 else if (station_addr[0] == 0x00 && station_addr[1] == 0x80 &&
&& station_addr[2] == 0xC8) station_addr[2] == 0xC8)
mname = "NP943"; mname = "NP943";
else { else {
release_region(ioaddr, EL1_IO_EXTENT); release_region(ioaddr, EL1_IO_EXTENT);

Просмотреть файл

@ -214,8 +214,8 @@ el2_probe1(struct net_device *dev, int ioaddr)
iobase_reg = inb(ioaddr+0x403); iobase_reg = inb(ioaddr+0x403);
membase_reg = inb(ioaddr+0x404); membase_reg = inb(ioaddr+0x404);
/* ASIC location registers should be 0 or have only a single bit set. */ /* ASIC location registers should be 0 or have only a single bit set. */
if ( (iobase_reg & (iobase_reg - 1)) if ((iobase_reg & (iobase_reg - 1)) ||
|| (membase_reg & (membase_reg - 1))) { (membase_reg & (membase_reg - 1))) {
retval = -ENODEV; retval = -ENODEV;
goto out1; goto out1;
} }
@ -291,8 +291,8 @@ el2_probe1(struct net_device *dev, int ioaddr)
writel(0xba5eba5e, mem_base); writel(0xba5eba5e, mem_base);
for (i = sizeof(test_val); i < EL2_MEMSIZE; i+=sizeof(test_val)) { for (i = sizeof(test_val); i < EL2_MEMSIZE; i+=sizeof(test_val)) {
writel(test_val, mem_base + i); writel(test_val, mem_base + i);
if (readl(mem_base) != 0xba5eba5e if (readl(mem_base) != 0xba5eba5e ||
|| readl(mem_base + i) != test_val) { readl(mem_base + i) != test_val) {
pr_warning("3c503: memory failure or memory address conflict.\n"); pr_warning("3c503: memory failure or memory address conflict.\n");
dev->mem_start = 0; dev->mem_start = 0;
ei_status.name = "3c503-PIO"; ei_status.name = "3c503-PIO";
@ -397,9 +397,10 @@ el2_open(struct net_device *dev)
unsigned long cookie = probe_irq_on(); unsigned long cookie = probe_irq_on();
outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR); outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR);
outb_p(0x00, E33G_IDCFR); outb_p(0x00, E33G_IDCFR);
if (*irqp == probe_irq_off(cookie) /* It's a good IRQ line! */ if (*irqp == probe_irq_off(cookie) && /* It's a good IRQ line! */
&& ((retval = request_irq(dev->irq = *irqp, ((retval = request_irq(dev->irq = *irqp,
eip_interrupt, 0, dev->name, dev)) == 0)) eip_interrupt, 0,
dev->name, dev)) == 0))
break; break;
} else { } else {
if (retval != -EBUSY) if (retval != -EBUSY)

Просмотреть файл

@ -836,8 +836,8 @@ static void el16_rx(struct net_device *dev)
void __iomem *data_frame = lp->base + data_buffer_addr; void __iomem *data_frame = lp->base + data_buffer_addr;
ushort pkt_len = readw(data_frame); ushort pkt_len = readw(data_frame);
if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 ||
|| (pkt_len & 0xC000) != 0xC000) { (pkt_len & 0xC000) != 0xC000) {
pr_err("%s: Rx frame at %#x corrupted, " pr_err("%s: Rx frame at %#x corrupted, "
"status %04x cmd %04x next %04x " "status %04x cmd %04x next %04x "
"data-buf @%04x %04x.\n", "data-buf @%04x %04x.\n",

Просмотреть файл

@ -253,9 +253,9 @@ static int el3_isa_id_sequence(__be16 *phys_addr)
This check is needed in order not to register them twice. */ This check is needed in order not to register them twice. */
for (i = 0; i < el3_cards; i++) { for (i = 0; i < el3_cards; i++) {
struct el3_private *lp = netdev_priv(el3_devs[i]); struct el3_private *lp = netdev_priv(el3_devs[i]);
if (lp->type == EL3_PNP if (lp->type == EL3_PNP &&
&& !memcmp(phys_addr, el3_devs[i]->dev_addr, !memcmp(phys_addr, el3_devs[i]->dev_addr,
ETH_ALEN)) { ETH_ALEN)) {
if (el3_debug > 3) if (el3_debug > 3)
pr_debug("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n", pr_debug("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n",
phys_addr[0] & 0xff, phys_addr[0] >> 8, phys_addr[0] & 0xff, phys_addr[0] >> 8,
@ -835,8 +835,8 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
#ifndef final_version #ifndef final_version
{ /* Error-checking code, delete someday. */ { /* Error-checking code, delete someday. */
ushort status = inw(ioaddr + EL3_STATUS); ushort status = inw(ioaddr + EL3_STATUS);
if (status & 0x0001 /* IRQ line active, missed one. */ if (status & 0x0001 && /* IRQ line active, missed one. */
&& inw(ioaddr + EL3_STATUS) & 1) { /* Make sure. */ inw(ioaddr + EL3_STATUS) & 1) { /* Make sure. */
pr_debug("%s: Missed interrupt, status then %04x now %04x" pr_debug("%s: Missed interrupt, status then %04x now %04x"
" Tx %2.2x Rx %4.4x.\n", dev->name, status, " Tx %2.2x Rx %4.4x.\n", dev->name, status,
inw(ioaddr + EL3_STATUS), inb(ioaddr + TX_STATUS), inw(ioaddr + EL3_STATUS), inb(ioaddr + TX_STATUS),

Просмотреть файл

@ -764,10 +764,11 @@ static int corkscrew_open(struct net_device *dev)
/* Use the now-standard shared IRQ implementation. */ /* Use the now-standard shared IRQ implementation. */
if (vp->capabilities == 0x11c7) { if (vp->capabilities == 0x11c7) {
/* Corkscrew: Cannot share ISA resources. */ /* Corkscrew: Cannot share ISA resources. */
if (dev->irq == 0 if (dev->irq == 0 ||
|| dev->dma == 0 dev->dma == 0 ||
|| request_irq(dev->irq, corkscrew_interrupt, 0, request_irq(dev->irq, corkscrew_interrupt, 0,
vp->product_name, dev)) return -EAGAIN; vp->product_name, dev))
return -EAGAIN;
enable_dma(dev->dma); enable_dma(dev->dma);
set_dma_mode(dev->dma, DMA_MODE_CASCADE); set_dma_mode(dev->dma, DMA_MODE_CASCADE);
} else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED, } else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED,
@ -1368,8 +1369,8 @@ static int boomerang_rx(struct net_device *dev)
/* Check if the packet is long enough to just accept without /* Check if the packet is long enough to just accept without
copying to a properly sized skbuff. */ copying to a properly sized skbuff. */
if (pkt_len < rx_copybreak if (pkt_len < rx_copybreak &&
&& (skb = dev_alloc_skb(pkt_len + 4)) != NULL) { (skb = dev_alloc_skb(pkt_len + 4)) != NULL) {
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
/* 'skb_put()' points to the start of sk_buff data area. */ /* 'skb_put()' points to the start of sk_buff data area. */
memcpy(skb_put(skb, pkt_len), memcpy(skb_put(skb, pkt_len),

Просмотреть файл

@ -1168,8 +1168,8 @@ static void mc32_rx_ring(struct net_device *dev)
/* Try to save time by avoiding a copy on big frames */ /* Try to save time by avoiding a copy on big frames */
if ((length > RX_COPYBREAK) if ((length > RX_COPYBREAK) &&
&& ((newskb=dev_alloc_skb(1532)) != NULL)) ((newskb=dev_alloc_skb(1532)) != NULL))
{ {
skb=lp->rx_ring[rx_ring_tail].skb; skb=lp->rx_ring[rx_ring_tail].skb;
skb_put(skb, length); skb_put(skb, length);

Просмотреть файл

@ -1942,8 +1942,8 @@ vortex_error(struct net_device *dev, int status)
if (status & TxComplete) { /* Really "TxError" for us. */ if (status & TxComplete) { /* Really "TxError" for us. */
tx_status = ioread8(ioaddr + TxStatus); tx_status = ioread8(ioaddr + TxStatus);
/* Presumably a tx-timeout. We must merely re-enable. */ /* Presumably a tx-timeout. We must merely re-enable. */
if (vortex_debug > 2 if (vortex_debug > 2 ||
|| (tx_status != 0x88 && vortex_debug > 0)) { (tx_status != 0x88 && vortex_debug > 0)) {
pr_err("%s: Transmit error, Tx status register %2.2x.\n", pr_err("%s: Transmit error, Tx status register %2.2x.\n",
dev->name, tx_status); dev->name, tx_status);
if (tx_status == 0x82) { if (tx_status == 0x82) {

Просмотреть файл

@ -909,8 +909,8 @@ static void __cp_set_rx_mode (struct net_device *dev)
AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
AcceptAllPhys; AcceptAllPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff; mc_filter[1] = mc_filter[0] = 0xffffffff;
} else if ((dev->mc_count > multicast_filter_limit) } else if ((dev->mc_count > multicast_filter_limit) ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to filter perfectly -- accept all multicasts. */ /* Too many to filter perfectly -- accept all multicasts. */
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff; mc_filter[1] = mc_filter[0] = 0xffffffff;

Просмотреть файл

@ -1549,8 +1549,8 @@ static inline void rtl8139_thread_iter (struct net_device *dev,
mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA); mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA);
if (!tp->mii.force_media && mii_lpa != 0xffff) { if (!tp->mii.force_media && mii_lpa != 0xffff) {
int duplex = (mii_lpa & LPA_100FULL) int duplex = ((mii_lpa & LPA_100FULL) ||
|| (mii_lpa & 0x01C0) == 0x0040; (mii_lpa & 0x01C0) == 0x0040);
if (tp->mii.full_duplex != duplex) { if (tp->mii.full_duplex != duplex) {
tp->mii.full_duplex = duplex; tp->mii.full_duplex = duplex;
@ -1936,8 +1936,8 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp,
RTL_R16 (RxBufAddr), RTL_R16 (RxBufAddr),
RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd));
while (netif_running(dev) && received < budget while (netif_running(dev) && received < budget &&
&& (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) {
u32 ring_offset = cur_rx % RX_BUF_LEN; u32 ring_offset = cur_rx % RX_BUF_LEN;
u32 rx_status; u32 rx_status;
unsigned int pkt_size; unsigned int pkt_size;
@ -2521,8 +2521,8 @@ static void __set_rx_mode (struct net_device *dev)
AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
AcceptAllPhys; AcceptAllPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff; mc_filter[1] = mc_filter[0] = 0xffffffff;
} else if ((dev->mc_count > multicast_filter_limit) } else if ((dev->mc_count > multicast_filter_limit) ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to filter perfectly -- accept all multicasts. */ /* Too many to filter perfectly -- accept all multicasts. */
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff; mc_filter[1] = mc_filter[0] = 0xffffffff;

Просмотреть файл

@ -230,9 +230,9 @@ static int ipddp_delete(struct ipddp_route *rt)
spin_lock_bh(&ipddp_route_lock); spin_lock_bh(&ipddp_route_lock);
while((tmp = *r) != NULL) while((tmp = *r) != NULL)
{ {
if(tmp->ip == rt->ip if(tmp->ip == rt->ip &&
&& tmp->at.s_net == rt->at.s_net tmp->at.s_net == rt->at.s_net &&
&& tmp->at.s_node == rt->at.s_node) tmp->at.s_node == rt->at.s_node)
{ {
*r = tmp->next; *r = tmp->next;
spin_unlock_bh(&ipddp_route_lock); spin_unlock_bh(&ipddp_route_lock);
@ -255,9 +255,9 @@ static struct ipddp_route* __ipddp_find_route(struct ipddp_route *rt)
for(f = ipddp_route_list; f != NULL; f = f->next) for(f = ipddp_route_list; f != NULL; f = f->next)
{ {
if(f->ip == rt->ip if(f->ip == rt->ip &&
&& f->at.s_net == rt->at.s_net f->at.s_net == rt->at.s_net &&
&& f->at.s_node == rt->at.s_node) f->at.s_node == rt->at.s_node)
return (f); return (f);
} }

Просмотреть файл

@ -174,9 +174,9 @@ static int __init arcrimi_found(struct net_device *dev)
* 2k (or there are no mirrors at all) but on some, it's 4k. * 2k (or there are no mirrors at all) but on some, it's 4k.
*/ */
mirror_size = MIRROR_SIZE; mirror_size = MIRROR_SIZE;
if (readb(p) == TESTvalue if (readb(p) == TESTvalue &&
&& check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0 check_mirror(shmem - MIRROR_SIZE, MIRROR_SIZE) == 0 &&
&& check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1) check_mirror(shmem - 2 * MIRROR_SIZE, MIRROR_SIZE) == 1)
mirror_size = 2 * MIRROR_SIZE; mirror_size = 2 * MIRROR_SIZE;
first_mirror = shmem - mirror_size; first_mirror = shmem - mirror_size;

Просмотреть файл

@ -301,8 +301,8 @@ static int choose_mtu(void)
/* choose the smallest MTU of all available encaps */ /* choose the smallest MTU of all available encaps */
for (count = 0; count < 256; count++) { for (count = 0; count < 256; count++) {
if (arc_proto_map[count] != &arc_proto_null if (arc_proto_map[count] != &arc_proto_null &&
&& arc_proto_map[count]->mtu < mtu) { arc_proto_map[count]->mtu < mtu) {
mtu = arc_proto_map[count]->mtu; mtu = arc_proto_map[count]->mtu;
} }
} }
@ -953,13 +953,13 @@ irqreturn_t arcnet_interrupt(int irq, void *dev_id)
* > RECON_THRESHOLD/min; * > RECON_THRESHOLD/min;
* then print a warning message. * then print a warning message.
*/ */
if (!lp->network_down if (!lp->network_down &&
&& (lp->last_recon - lp->first_recon) <= HZ * 60 (lp->last_recon - lp->first_recon) <= HZ * 60 &&
&& lp->num_recons >= RECON_THRESHOLD) { lp->num_recons >= RECON_THRESHOLD) {
lp->network_down = 1; lp->network_down = 1;
BUGMSG(D_NORMAL, "many reconfigurations detected: cabling problem?\n"); BUGMSG(D_NORMAL, "many reconfigurations detected: cabling problem?\n");
} else if (!lp->network_down } else if (!lp->network_down &&
&& lp->last_recon - lp->first_recon > HZ * 60) { lp->last_recon - lp->first_recon > HZ * 60) {
/* reset counters if we've gone for over a minute. */ /* reset counters if we've gone for over a minute. */
lp->first_recon = lp->last_recon; lp->first_recon = lp->last_recon;
lp->num_recons = 1; lp->num_recons = 1;

Просмотреть файл

@ -350,13 +350,13 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
slot = -1; slot = -1;
/* We must check for the EEPROM-config boards first, else accessing /* We must check for the EEPROM-config boards first, else accessing
IOCONFIG0 will move the board! */ IOCONFIG0 will move the board! */
if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr if (at1700_probe_list[inb(ioaddr + IOCONFIG1) & 0x07] == ioaddr &&
&& read_eeprom(ioaddr, 4) == 0x0000 read_eeprom(ioaddr, 4) == 0x0000 &&
&& (read_eeprom(ioaddr, 5) & 0xff00) == 0xF400) (read_eeprom(ioaddr, 5) & 0xff00) == 0xF400)
is_at1700 = 1; is_at1700 = 1;
else if (inb(ioaddr + SAPROM ) == 0x00 else if (inb(ioaddr + SAPROM ) == 0x00 &&
&& inb(ioaddr + SAPROM + 1) == 0x00 inb(ioaddr + SAPROM + 1) == 0x00 &&
&& inb(ioaddr + SAPROM + 2) == 0x0e) inb(ioaddr + SAPROM + 2) == 0x0e)
is_fmv18x = 1; is_fmv18x = 1;
else { else {
goto err_out; goto err_out;
@ -839,8 +839,8 @@ set_rx_mode(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { if (dev->flags & IFF_PROMISC) {
memset(mc_filter, 0xff, sizeof(mc_filter)); memset(mc_filter, 0xff, sizeof(mc_filter));
outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */
} else if (dev->mc_count > MC_FILTERBREAK } else if (dev->mc_count > MC_FILTERBREAK ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to filter perfectly -- accept all multicasts. */ /* Too many to filter perfectly -- accept all multicasts. */
memset(mc_filter, 0xff, sizeof(mc_filter)); memset(mc_filter, 0xff, sizeof(mc_filter));
outb(2, ioaddr + RX_MODE); /* Use normal mode. */ outb(2, ioaddr + RX_MODE); /* Use normal mode. */

Просмотреть файл

@ -930,8 +930,8 @@ static irqreturn_t lance_interrupt( int irq, void *dev_id )
} }
#endif #endif
if (lp->tx_full && (netif_queue_stopped(dev)) if (lp->tx_full && (netif_queue_stopped(dev)) &&
&& dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) { dirty_tx > lp->cur_tx - TX_RING_SIZE + 2) {
/* The ring is no longer full, clear tbusy. */ /* The ring is no longer full, clear tbusy. */
lp->tx_full = 0; lp->tx_full = 0;
netif_wake_queue (dev); netif_wake_queue (dev);

Просмотреть файл

@ -1344,8 +1344,8 @@ static u32 atl1_check_link(struct atl1_adapter *adapter)
/* link result is our setting */ /* link result is our setting */
if (!reconfig) { if (!reconfig) {
if (adapter->link_speed != speed if (adapter->link_speed != speed ||
|| adapter->link_duplex != duplex) { adapter->link_duplex != duplex) {
adapter->link_speed = speed; adapter->link_speed = speed;
adapter->link_duplex = duplex; adapter->link_duplex = duplex;
atl1_setup_mac_ctrl(adapter); atl1_setup_mac_ctrl(adapter);
@ -2087,8 +2087,8 @@ static void atl1_intr_tx(struct atl1_adapter *adapter)
} }
atomic_set(&tpd_ring->next_to_clean, sw_tpd_next_to_clean); atomic_set(&tpd_ring->next_to_clean, sw_tpd_next_to_clean);
if (netif_queue_stopped(adapter->netdev) if (netif_queue_stopped(adapter->netdev) &&
&& netif_carrier_ok(adapter->netdev)) netif_carrier_ok(adapter->netdev))
netif_wake_queue(adapter->netdev); netif_wake_queue(adapter->netdev);
} }

Просмотреть файл

@ -673,8 +673,8 @@ static irqreturn_t atp_interrupt(int irq, void *dev_instance)
netif_wake_queue(dev); /* Inform upper layers. */ netif_wake_queue(dev); /* Inform upper layers. */
} }
num_tx_since_rx++; num_tx_since_rx++;
} else if (num_tx_since_rx > 8 } else if (num_tx_since_rx > 8 &&
&& time_after(jiffies, dev->last_rx + HZ)) { time_after(jiffies, dev->last_rx + HZ)) {
if (net_debug > 2) if (net_debug > 2)
printk(KERN_DEBUG "%s: Missed packet? No Rx after %d Tx and " printk(KERN_DEBUG "%s: Missed packet? No Rx after %d Tx and "
"%ld jiffies status %02x CMR1 %02x.\n", dev->name, "%ld jiffies status %02x CMR1 %02x.\n", dev->name,

Просмотреть файл

@ -2382,8 +2382,8 @@ static struct pci_driver be_driver = {
static int __init be_init_module(void) static int __init be_init_module(void)
{ {
if (rx_frag_size != 8192 && rx_frag_size != 4096 if (rx_frag_size != 8192 && rx_frag_size != 4096 &&
&& rx_frag_size != 2048) { rx_frag_size != 2048) {
printk(KERN_WARNING DRV_NAME printk(KERN_WARNING DRV_NAME
" : Module param rx_frag_size must be 2048/4096/8192." " : Module param rx_frag_size must be 2048/4096/8192."
" Using 2048\n"); " Using 2048\n");

Просмотреть файл

@ -554,8 +554,8 @@ static void adjust_tx_list(void)
{ {
int timeout_cnt = MAX_TIMEOUT_CNT; int timeout_cnt = MAX_TIMEOUT_CNT;
if (tx_list_head->status.status_word != 0 if (tx_list_head->status.status_word != 0 &&
&& current_tx_ptr != tx_list_head) { current_tx_ptr != tx_list_head) {
goto adjust_head; /* released something, just return; */ goto adjust_head; /* released something, just return; */
} }
@ -567,8 +567,8 @@ static void adjust_tx_list(void)
if (current_tx_ptr->next->next == tx_list_head) { if (current_tx_ptr->next->next == tx_list_head) {
while (tx_list_head->status.status_word == 0) { while (tx_list_head->status.status_word == 0) {
udelay(10); udelay(10);
if (tx_list_head->status.status_word != 0 if (tx_list_head->status.status_word != 0 ||
|| !(bfin_read_DMA2_IRQ_STATUS() & DMA_RUN)) { !(bfin_read_DMA2_IRQ_STATUS() & DMA_RUN)) {
goto adjust_head; goto adjust_head;
} }
if (timeout_cnt-- < 0) { if (timeout_cnt-- < 0) {
@ -596,8 +596,8 @@ adjust_head:
": no sk_buff in a transmitted frame!\n"); ": no sk_buff in a transmitted frame!\n");
} }
tx_list_head = tx_list_head->next; tx_list_head = tx_list_head->next;
} while (tx_list_head->status.status_word != 0 } while (tx_list_head->status.status_word != 0 &&
&& current_tx_ptr != tx_list_head); current_tx_ptr != tx_list_head);
return; return;
} }

Просмотреть файл

@ -438,8 +438,8 @@ bmac_init_phy(struct net_device *dev)
ctrl = bmac_mif_read(dev, 0); ctrl = bmac_mif_read(dev, 0);
capable = ((bmac_mif_read(dev, 1) & 0xf800) >> 6) | 1; capable = ((bmac_mif_read(dev, 1) & 0xf800) >> 6) | 1;
if (bmac_mif_read(dev, 4) != capable if (bmac_mif_read(dev, 4) != capable ||
|| (ctrl & 0x1000) == 0) { (ctrl & 0x1000) == 0) {
bmac_mif_write(dev, 4, capable); bmac_mif_write(dev, 4, capable);
bmac_mif_write(dev, 0, 0x1200); bmac_mif_write(dev, 0, 0x1200);
} else } else

Просмотреть файл

@ -4717,8 +4717,8 @@ static u8 bnx2x_ext_phy_is_link_up(struct link_params *params,
0xc809, &val1); 0xc809, &val1);
DP(NETIF_MSG_LINK, "8705 1.c809 val=0x%x\n", val1); DP(NETIF_MSG_LINK, "8705 1.c809 val=0x%x\n", val1);
ext_phy_link_up = ((rx_sd & 0x1) && (val1 & (1<<9)) ext_phy_link_up = ((rx_sd & 0x1) && (val1 & (1<<9)) &&
&& ((val1 & (1<<8)) == 0)); ((val1 & (1<<8)) == 0));
if (ext_phy_link_up) if (ext_phy_link_up)
vars->line_speed = SPEED_10000; vars->line_speed = SPEED_10000;
break; break;

Просмотреть файл

@ -561,12 +561,12 @@ static void __update_selected(struct lacpdu *lacpdu, struct port *port)
const struct port_params *partner = &port->partner_oper; const struct port_params *partner = &port->partner_oper;
// check if any parameter is different // check if any parameter is different
if (ntohs(lacpdu->actor_port) != partner->port_number if (ntohs(lacpdu->actor_port) != partner->port_number ||
|| ntohs(lacpdu->actor_port_priority) != partner->port_priority ntohs(lacpdu->actor_port_priority) != partner->port_priority ||
|| MAC_ADDRESS_COMPARE(&lacpdu->actor_system, &partner->system) MAC_ADDRESS_COMPARE(&lacpdu->actor_system, &partner->system) ||
|| ntohs(lacpdu->actor_system_priority) != partner->system_priority ntohs(lacpdu->actor_system_priority) != partner->system_priority ||
|| ntohs(lacpdu->actor_key) != partner->key ntohs(lacpdu->actor_key) != partner->key ||
|| (lacpdu->actor_state & AD_STATE_AGGREGATION) != (partner->port_state & AD_STATE_AGGREGATION)) { (lacpdu->actor_state & AD_STATE_AGGREGATION) != (partner->port_state & AD_STATE_AGGREGATION)) {
// update the state machine Selected variable // update the state machine Selected variable
port->sm_vars &= ~AD_PORT_SELECTED; port->sm_vars &= ~AD_PORT_SELECTED;
} }
@ -592,12 +592,12 @@ static void __update_default_selected(struct port *port)
const struct port_params *oper = &port->partner_oper; const struct port_params *oper = &port->partner_oper;
// check if any parameter is different // check if any parameter is different
if (admin->port_number != oper->port_number if (admin->port_number != oper->port_number ||
|| admin->port_priority != oper->port_priority admin->port_priority != oper->port_priority ||
|| MAC_ADDRESS_COMPARE(&admin->system, &oper->system) MAC_ADDRESS_COMPARE(&admin->system, &oper->system) ||
|| admin->system_priority != oper->system_priority admin->system_priority != oper->system_priority ||
|| admin->key != oper->key admin->key != oper->key ||
|| (admin->port_state & AD_STATE_AGGREGATION) (admin->port_state & AD_STATE_AGGREGATION)
!= (oper->port_state & AD_STATE_AGGREGATION)) { != (oper->port_state & AD_STATE_AGGREGATION)) {
// update the state machine Selected variable // update the state machine Selected variable
port->sm_vars &= ~AD_PORT_SELECTED; port->sm_vars &= ~AD_PORT_SELECTED;

Просмотреть файл

@ -1852,8 +1852,8 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
} }
if (!bond->params.fail_over_mac) { if (!bond->params.fail_over_mac) {
if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) &&
&& bond->slave_cnt > 1) bond->slave_cnt > 1)
pr_warning(DRV_NAME pr_warning(DRV_NAME
": %s: Warning: the permanent HWaddr of %s - " ": %s: Warning: the permanent HWaddr of %s - "
"%pM - is still in use by %s. " "%pM - is still in use by %s. "

Просмотреть файл

@ -254,8 +254,8 @@ static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
static inline bool bond_is_lb(const struct bonding *bond) static inline bool bond_is_lb(const struct bonding *bond)
{ {
return bond->params.mode == BOND_MODE_TLB return (bond->params.mode == BOND_MODE_TLB ||
|| bond->params.mode == BOND_MODE_ALB; bond->params.mode == BOND_MODE_ALB);
} }
#define BOND_PRI_RESELECT_ALWAYS 0 #define BOND_PRI_RESELECT_ALWAYS 0

Просмотреть файл

@ -318,12 +318,12 @@ static void ems_usb_rx_can_msg(struct ems_usb *dev, struct ems_cpc_msg *msg)
cf->can_id = le32_to_cpu(msg->msg.can_msg.id); cf->can_id = le32_to_cpu(msg->msg.can_msg.id);
cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8); cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8);
if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME ||
|| msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME)
cf->can_id |= CAN_EFF_FLAG; cf->can_id |= CAN_EFF_FLAG;
if (msg->type == CPC_MSG_TYPE_RTR_FRAME if (msg->type == CPC_MSG_TYPE_RTR_FRAME ||
|| msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) { msg->type == CPC_MSG_TYPE_EXT_RTR_FRAME) {
cf->can_id |= CAN_RTR_FLAG; cf->can_id |= CAN_RTR_FLAG;
} else { } else {
for (i = 0; i < cf->can_dlc; i++) for (i = 0; i < cf->can_dlc; i++)

Просмотреть файл

@ -2117,19 +2117,19 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
if (t.qset_idx >= SGE_QSETS) if (t.qset_idx >= SGE_QSETS)
return -EINVAL; return -EINVAL;
if (!in_range(t.intr_lat, 0, M_NEWTIMER) || if (!in_range(t.intr_lat, 0, M_NEWTIMER) ||
!in_range(t.cong_thres, 0, 255) || !in_range(t.cong_thres, 0, 255) ||
!in_range(t.txq_size[0], MIN_TXQ_ENTRIES, !in_range(t.txq_size[0], MIN_TXQ_ENTRIES,
MAX_TXQ_ENTRIES) || MAX_TXQ_ENTRIES) ||
!in_range(t.txq_size[1], MIN_TXQ_ENTRIES, !in_range(t.txq_size[1], MIN_TXQ_ENTRIES,
MAX_TXQ_ENTRIES) || MAX_TXQ_ENTRIES) ||
!in_range(t.txq_size[2], MIN_CTRL_TXQ_ENTRIES, !in_range(t.txq_size[2], MIN_CTRL_TXQ_ENTRIES,
MAX_CTRL_TXQ_ENTRIES) || MAX_CTRL_TXQ_ENTRIES) ||
!in_range(t.fl_size[0], MIN_FL_ENTRIES, !in_range(t.fl_size[0], MIN_FL_ENTRIES,
MAX_RX_BUFFERS) MAX_RX_BUFFERS) ||
|| !in_range(t.fl_size[1], MIN_FL_ENTRIES, !in_range(t.fl_size[1], MIN_FL_ENTRIES,
MAX_RX_JUMBO_BUFFERS) MAX_RX_JUMBO_BUFFERS) ||
|| !in_range(t.rspq_size, MIN_RSPQ_ENTRIES, !in_range(t.rspq_size, MIN_RSPQ_ENTRIES,
MAX_RSPQ_ENTRIES)) MAX_RSPQ_ENTRIES))
return -EINVAL; return -EINVAL;
if ((adapter->flags & FULL_INIT_DONE) && t.lro > 0) if ((adapter->flags & FULL_INIT_DONE) && t.lro > 0)

Просмотреть файл

@ -163,8 +163,8 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
strcmp (media[card_idx], "4") == 0) { strcmp (media[card_idx], "4") == 0) {
np->speed = 100; np->speed = 100;
np->full_duplex = 1; np->full_duplex = 1;
} else if (strcmp (media[card_idx], "100mbps_hd") == 0 } else if (strcmp (media[card_idx], "100mbps_hd") == 0 ||
|| strcmp (media[card_idx], "3") == 0) { strcmp (media[card_idx], "3") == 0) {
np->speed = 100; np->speed = 100;
np->full_duplex = 0; np->full_duplex = 0;
} else if (strcmp (media[card_idx], "10mbps_fd") == 0 || } else if (strcmp (media[card_idx], "10mbps_fd") == 0 ||

Просмотреть файл

@ -1024,8 +1024,8 @@ dm9000_rx(struct net_device *dev)
} }
/* Move data from DM9000 */ /* Move data from DM9000 */
if (GoodPacket if (GoodPacket &&
&& ((skb = dev_alloc_skb(RxLen + 4)) != NULL)) { ((skb = dev_alloc_skb(RxLen + 4)) != NULL)) {
skb_reserve(skb, 2); skb_reserve(skb, 2);
rdptr = (u8 *) skb_put(skb, RxLen - 4); rdptr = (u8 *) skb_put(skb, RxLen - 4);

Просмотреть файл

@ -3507,8 +3507,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
adapter->detect_tx_hung = false; adapter->detect_tx_hung = false;
if (tx_ring->buffer_info[eop].time_stamp && if (tx_ring->buffer_info[eop].time_stamp &&
time_after(jiffies, tx_ring->buffer_info[eop].time_stamp + time_after(jiffies, tx_ring->buffer_info[eop].time_stamp +
(adapter->tx_timeout_factor * HZ)) (adapter->tx_timeout_factor * HZ)) &&
&& !(er32(STATUS) & E1000_STATUS_TXOFF)) { !(er32(STATUS) & E1000_STATUS_TXOFF)) {
/* detected Tx unit hang */ /* detected Tx unit hang */
DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n" DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n"

Просмотреть файл

@ -679,8 +679,8 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter)
adapter->detect_tx_hung = 0; adapter->detect_tx_hung = 0;
if (tx_ring->buffer_info[i].time_stamp && if (tx_ring->buffer_info[i].time_stamp &&
time_after(jiffies, tx_ring->buffer_info[i].time_stamp time_after(jiffies, tx_ring->buffer_info[i].time_stamp
+ (adapter->tx_timeout_factor * HZ)) + (adapter->tx_timeout_factor * HZ)) &&
&& !(er32(STATUS) & E1000_STATUS_TXOFF)) { !(er32(STATUS) & E1000_STATUS_TXOFF)) {
schedule_work(&adapter->print_hang_task); schedule_work(&adapter->print_hang_task);
netif_stop_queue(netdev); netif_stop_queue(netdev);
} }
@ -4046,8 +4046,8 @@ static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter,
u16 length, offset; u16 length, offset;
if (vlan_tx_tag_present(skb)) { if (vlan_tx_tag_present(skb)) {
if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id) if (!((vlan_tx_tag_get(skb) == adapter->hw.mng_cookie.vlan_id) &&
&& (adapter->hw.mng_cookie.status & (adapter->hw.mng_cookie.status &
E1000_MNG_DHCP_COOKIE_STATUS_VLAN))) E1000_MNG_DHCP_COOKIE_STATUS_VLAN)))
return 0; return 0;
} }

Просмотреть файл

@ -186,9 +186,9 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)
return -EBUSY; return -EBUSY;
/* First check the station address for the Ctron prefix. */ /* First check the station address for the Ctron prefix. */
if (inb(ioaddr + E21_SAPROM + 0) != 0x00 if (inb(ioaddr + E21_SAPROM + 0) != 0x00 ||
|| inb(ioaddr + E21_SAPROM + 1) != 0x00 inb(ioaddr + E21_SAPROM + 1) != 0x00 ||
|| inb(ioaddr + E21_SAPROM + 2) != 0x1d) { inb(ioaddr + E21_SAPROM + 2) != 0x1d) {
retval = -ENODEV; retval = -ENODEV;
goto out; goto out;
} }

Просмотреть файл

@ -189,8 +189,8 @@ static void ehea_update_firmware_handles(void)
for (k = 0; k < EHEA_MAX_PORTS; k++) { for (k = 0; k < EHEA_MAX_PORTS; k++) {
struct ehea_port *port = adapter->port[k]; struct ehea_port *port = adapter->port[k];
if (!port || (port->state != EHEA_PORT_UP) if (!port || (port->state != EHEA_PORT_UP) ||
|| (num_ports == 0)) (num_ports == 0))
continue; continue;
for (l = 0; for (l = 0;
@ -657,8 +657,8 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe,
struct sk_buff *skb) struct sk_buff *skb)
{ {
int vlan_extracted = (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) &&
&& pr->port->vgrp; pr->port->vgrp);
if (use_lro) { if (use_lro) {
if (vlan_extracted) if (vlan_extracted)
@ -1389,8 +1389,8 @@ out:
int ehea_rem_smrs(struct ehea_port_res *pr) int ehea_rem_smrs(struct ehea_port_res *pr)
{ {
if ((ehea_rem_mr(&pr->send_mr)) if ((ehea_rem_mr(&pr->send_mr)) ||
|| (ehea_rem_mr(&pr->recv_mr))) (ehea_rem_mr(&pr->recv_mr)))
return -EIO; return -EIO;
else else
return 0; return 0;
@ -2031,8 +2031,8 @@ static void ehea_xmit2(struct sk_buff *skb, struct net_device *dev,
write_ip_start_end(swqe, skb); write_ip_start_end(swqe, skb);
if (iph->protocol == IPPROTO_UDP) { if (iph->protocol == IPPROTO_UDP) {
if ((iph->frag_off & IP_MF) if ((iph->frag_off & IP_MF) ||
|| (iph->frag_off & IP_OFFSET)) (iph->frag_off & IP_OFFSET))
/* IP fragment, so don't change cs */ /* IP fragment, so don't change cs */
swqe->tx_control &= ~EHEA_SWQE_TCP_CHECKSUM; swqe->tx_control &= ~EHEA_SWQE_TCP_CHECKSUM;
else else
@ -2077,8 +2077,8 @@ static void ehea_xmit3(struct sk_buff *skb, struct net_device *dev,
write_tcp_offset_end(swqe, skb); write_tcp_offset_end(swqe, skb);
} else if (iph->protocol == IPPROTO_UDP) { } else if (iph->protocol == IPPROTO_UDP) {
if ((iph->frag_off & IP_MF) if ((iph->frag_off & IP_MF) ||
|| (iph->frag_off & IP_OFFSET)) (iph->frag_off & IP_OFFSET))
/* IP fragment, so don't change cs */ /* IP fragment, so don't change cs */
swqe->tx_control |= EHEA_SWQE_CRC swqe->tx_control |= EHEA_SWQE_CRC
| EHEA_SWQE_IMM_DATA_PRESENT; | EHEA_SWQE_IMM_DATA_PRESENT;

Просмотреть файл

@ -837,8 +837,8 @@ static u64 ehea_reg_mr_section(int top, int dir, int idx, u64 *pt,
hret = ehea_h_register_rpage_mr(adapter->handle, mr->handle, 0, hret = ehea_h_register_rpage_mr(adapter->handle, mr->handle, 0,
0, pt_abs, EHEA_MAX_RPAGE); 0, pt_abs, EHEA_MAX_RPAGE);
if ((hret != H_SUCCESS) if ((hret != H_SUCCESS) &&
&& (hret != H_PAGE_REGISTERED)) { (hret != H_PAGE_REGISTERED)) {
ehea_h_free_resource(adapter->handle, mr->handle, ehea_h_free_resource(adapter->handle, mr->handle,
FORCE_FREE); FORCE_FREE);
ehea_error("register_rpage_mr failed"); ehea_error("register_rpage_mr failed");

Просмотреть файл

@ -630,8 +630,8 @@ static int mdio_read(struct net_device *dev, int phy_id, int location)
barrier(); barrier();
if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) { if ((inl(ioaddr + MIICtrl) & MII_READOP) == 0) {
/* Work around read failure bug. */ /* Work around read failure bug. */
if (phy_id == 1 && location < 6 if (phy_id == 1 && location < 6 &&
&& inw(ioaddr + MIIData) == 0xffff) { inw(ioaddr + MIIData) == 0xffff) {
outl(read_cmd, ioaddr + MIICtrl); outl(read_cmd, ioaddr + MIICtrl);
continue; continue;
} }
@ -1205,8 +1205,8 @@ static int epic_rx(struct net_device *dev, int budget)
} }
/* Check if the packet is long enough to accept without copying /* Check if the packet is long enough to accept without copying
to a minimally-sized skbuff. */ to a minimally-sized skbuff. */
if (pkt_len < rx_copybreak if (pkt_len < rx_copybreak &&
&& (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
skb_reserve(skb, 2); /* 16 byte align the IP header */ skb_reserve(skb, 2); /* 16 byte align the IP header */
pci_dma_sync_single_for_cpu(ep->pci_dev, pci_dma_sync_single_for_cpu(ep->pci_dev,
ep->rx_ring[entry].bufaddr, ep->rx_ring[entry].bufaddr,

Просмотреть файл

@ -1629,8 +1629,8 @@ static int netdev_rx(struct net_device *dev)
if (debug) if (debug)
printk(KERN_DEBUG " netdev_rx() status was %8.8x.\n", rx_status); printk(KERN_DEBUG " netdev_rx() status was %8.8x.\n", rx_status);
if ((!((rx_status & RXFSD) && (rx_status & RXLSD))) if ((!((rx_status & RXFSD) && (rx_status & RXLSD))) ||
|| (rx_status & ErrorSummary)) { (rx_status & ErrorSummary)) {
if (rx_status & ErrorSummary) { /* there was a fatal error */ if (rx_status & ErrorSummary) { /* there was a fatal error */
if (debug) if (debug)
printk(KERN_DEBUG printk(KERN_DEBUG
@ -1655,8 +1655,8 @@ static int netdev_rx(struct net_device *dev)
cur = np->cur_rx; cur = np->cur_rx;
while (desno <= np->really_rx_count) { while (desno <= np->really_rx_count) {
++desno; ++desno;
if ((!(cur->status & RXOWN)) if ((!(cur->status & RXOWN)) &&
&& (cur->status & RXLSD)) (cur->status & RXLSD))
break; break;
/* goto next rx descriptor */ /* goto next rx descriptor */
cur = cur->next_desc_logical; cur = cur->next_desc_logical;
@ -1786,8 +1786,8 @@ static void __set_rx_mode(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
memset(mc_filter, 0xff, sizeof(mc_filter)); memset(mc_filter, 0xff, sizeof(mc_filter));
rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM; rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM;
} else if ((dev->mc_count > multicast_filter_limit) } else if ((dev->mc_count > multicast_filter_limit) ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to match, or accept all multicasts. */ /* Too many to match, or accept all multicasts. */
memset(mc_filter, 0xff, sizeof(mc_filter)); memset(mc_filter, 0xff, sizeof(mc_filter));
rx_mode = CR_W_AB | CR_W_AM; rx_mode = CR_W_AB | CR_W_AM;

Просмотреть файл

@ -62,8 +62,8 @@ static ssize_t gfar_set_bd_stash(struct device *dev,
/* Find out the new setting */ /* Find out the new setting */
if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1))
new_setting = 1; new_setting = 1;
else if (!strncmp("off", buf, count - 1) else if (!strncmp("off", buf, count - 1) ||
|| !strncmp("0", buf, count - 1)) !strncmp("0", buf, count - 1))
new_setting = 0; new_setting = 0;
else else
return count; return count;

Просмотреть файл

@ -1566,8 +1566,8 @@ static int hamachi_rx(struct net_device *dev)
#endif #endif
/* Check if the packet is long enough to accept without copying /* Check if the packet is long enough to accept without copying
to a minimally-sized skbuff. */ to a minimally-sized skbuff. */
if (pkt_len < rx_copybreak if (pkt_len < rx_copybreak &&
&& (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
#ifdef RX_CHECKSUM #ifdef RX_CHECKSUM
printk(KERN_ERR "%s: rx_copybreak non-zero " printk(KERN_ERR "%s: rx_copybreak non-zero "
"not good with RX_CHECKSUM\n", dev->name); "not good with RX_CHECKSUM\n", dev->name);
@ -1722,10 +1722,10 @@ static void hamachi_error(struct net_device *dev, int intr_status)
readl(ioaddr + 0x370); readl(ioaddr + 0x370);
readl(ioaddr + 0x3F0); readl(ioaddr + 0x3F0);
} }
if ((intr_status & ~(LinkChange|StatsMax|NegotiationChange|IntrRxDone|IntrTxDone)) if ((intr_status & ~(LinkChange|StatsMax|NegotiationChange|IntrRxDone|IntrTxDone)) &&
&& hamachi_debug) hamachi_debug)
printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n", printk(KERN_ERR "%s: Something Wicked happened! %4.4x.\n",
dev->name, intr_status); dev->name, intr_status);
/* Hmmmmm, it's not clear how to recover from PCI faults. */ /* Hmmmmm, it's not clear how to recover from PCI faults. */
if (intr_status & (IntrTxPCIErr | IntrTxPCIFault)) if (intr_status & (IntrTxPCIErr | IntrTxPCIFault))
hmp->stats.tx_fifo_errors++; hmp->stats.tx_fifo_errors++;

Просмотреть файл

@ -167,10 +167,7 @@ static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev)
static inline int dev_is_ethdev(struct net_device *dev) static inline int dev_is_ethdev(struct net_device *dev)
{ {
return ( return (dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5));
dev->type == ARPHRD_ETHER
&& strncmp(dev->name, "dummy", 5)
);
} }
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */

Просмотреть файл

@ -331,8 +331,8 @@ static int __init dmascc_init(void)
for (i = 0; i < MAX_NUM_DEVS && io[i]; i++) { for (i = 0; i < MAX_NUM_DEVS && io[i]; i++) {
j = (io[i] - j = (io[i] -
hw[h].io_region) / hw[h].io_delta; hw[h].io_region) / hw[h].io_delta;
if (j >= 0 && j < hw[h].num_devs if (j >= 0 && j < hw[h].num_devs &&
&& hw[h].io_region + hw[h].io_region +
j * hw[h].io_delta == io[i]) { j * hw[h].io_delta == io[i]) {
base[j] = io[i]; base[j] = io[i];
} }
@ -396,8 +396,8 @@ static int __init dmascc_init(void)
t_val = t_val =
inb(t1[i]) + (inb(t1[i]) << 8); inb(t1[i]) + (inb(t1[i]) << 8);
/* Also check whether counter did wrap */ /* Also check whether counter did wrap */
if (t_val == 0 if (t_val == 0 ||
|| t_val > TMR_0_HZ / HZ * 10) t_val > TMR_0_HZ / HZ * 10)
counting[i] = 0; counting[i] = 0;
delay[i] = jiffies - start[i]; delay[i] = jiffies - start[i];
} }

Просмотреть файл

@ -187,8 +187,8 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
return -EBUSY; return -EBUSY;
/* Check for the HP+ signature, 50 48 0x 53. */ /* Check for the HP+ signature, 50 48 0x 53. */
if (inw(ioaddr + HP_ID) != 0x4850 if (inw(ioaddr + HP_ID) != 0x4850 ||
|| (inw(ioaddr + HP_PAGING) & 0xfff0) != 0x5300) { (inw(ioaddr + HP_PAGING) & 0xfff0) != 0x5300) {
retval = -ENODEV; retval = -ENODEV;
goto out; goto out;
} }

Просмотреть файл

@ -993,8 +993,8 @@ static void hp100_mmuinit(struct net_device *dev)
if (lp->mode == 1) { /* only needed for Busmaster */ if (lp->mode == 1) { /* only needed for Busmaster */
int xmit_stop, recv_stop; int xmit_stop, recv_stop;
if ((lp->chip == HP100_CHIPID_RAINIER) if ((lp->chip == HP100_CHIPID_RAINIER) ||
|| (lp->chip == HP100_CHIPID_SHASTA)) { (lp->chip == HP100_CHIPID_SHASTA)) {
int pdl_stop; int pdl_stop;
/* /*

Просмотреть файл

@ -1976,27 +1976,27 @@ static int emac_ethtool_set_settings(struct net_device *ndev,
if (cmd->autoneg == AUTONEG_DISABLE) { if (cmd->autoneg == AUTONEG_DISABLE) {
switch (cmd->speed) { switch (cmd->speed) {
case SPEED_10: case SPEED_10:
if (cmd->duplex == DUPLEX_HALF if (cmd->duplex == DUPLEX_HALF &&
&& !(f & SUPPORTED_10baseT_Half)) !(f & SUPPORTED_10baseT_Half))
return -EINVAL; return -EINVAL;
if (cmd->duplex == DUPLEX_FULL if (cmd->duplex == DUPLEX_FULL &&
&& !(f & SUPPORTED_10baseT_Full)) !(f & SUPPORTED_10baseT_Full))
return -EINVAL; return -EINVAL;
break; break;
case SPEED_100: case SPEED_100:
if (cmd->duplex == DUPLEX_HALF if (cmd->duplex == DUPLEX_HALF &&
&& !(f & SUPPORTED_100baseT_Half)) !(f & SUPPORTED_100baseT_Half))
return -EINVAL; return -EINVAL;
if (cmd->duplex == DUPLEX_FULL if (cmd->duplex == DUPLEX_FULL &&
&& !(f & SUPPORTED_100baseT_Full)) !(f & SUPPORTED_100baseT_Full))
return -EINVAL; return -EINVAL;
break; break;
case SPEED_1000: case SPEED_1000:
if (cmd->duplex == DUPLEX_HALF if (cmd->duplex == DUPLEX_HALF &&
&& !(f & SUPPORTED_1000baseT_Half)) !(f & SUPPORTED_1000baseT_Half))
return -EINVAL; return -EINVAL;
if (cmd->duplex == DUPLEX_FULL if (cmd->duplex == DUPLEX_FULL &&
&& !(f & SUPPORTED_1000baseT_Full)) !(f & SUPPORTED_1000baseT_Full))
return -EINVAL; return -EINVAL;
break; break;
default: default:

Просмотреть файл

@ -4974,9 +4974,8 @@ static bool igb_clean_tx_irq(struct igb_q_vector *q_vector)
tx_ring->detect_tx_hung = false; tx_ring->detect_tx_hung = false;
if (tx_ring->buffer_info[i].time_stamp && if (tx_ring->buffer_info[i].time_stamp &&
time_after(jiffies, tx_ring->buffer_info[i].time_stamp + time_after(jiffies, tx_ring->buffer_info[i].time_stamp +
(adapter->tx_timeout_factor * HZ)) (adapter->tx_timeout_factor * HZ)) &&
&& !(rd32(E1000_STATUS) & !(rd32(E1000_STATUS) & E1000_STATUS_TXOFF)) {
E1000_STATUS_TXOFF)) {
/* detected Tx unit hang */ /* detected Tx unit hang */
dev_err(&tx_ring->pdev->dev, dev_err(&tx_ring->pdev->dev,

Просмотреть файл

@ -827,8 +827,8 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring)
adapter->detect_tx_hung = false; adapter->detect_tx_hung = false;
if (tx_ring->buffer_info[i].time_stamp && if (tx_ring->buffer_info[i].time_stamp &&
time_after(jiffies, tx_ring->buffer_info[i].time_stamp + time_after(jiffies, tx_ring->buffer_info[i].time_stamp +
(adapter->tx_timeout_factor * HZ)) (adapter->tx_timeout_factor * HZ)) &&
&& !(er32(STATUS) & E1000_STATUS_TXOFF)) { !(er32(STATUS) & E1000_STATUS_TXOFF)) {
tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i); tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i);
/* detected Tx unit hang */ /* detected Tx unit hang */

Просмотреть файл

@ -1124,11 +1124,11 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
* The actual image starts after the "STMP" keyword * The actual image starts after the "STMP" keyword
* so forward to the firmware header tag * so forward to the firmware header tag
*/ */
for (i = 0; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG) for (i = 0; (fw->data[i] != STIR421X_PATCH_END_OF_HDR_TAG) &&
&& (i < fw->size); i++) ; (i < fw->size); i++) ;
/* here we check for the out of buffer case */ /* here we check for the out of buffer case */
if ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) if ((STIR421X_PATCH_END_OF_HDR_TAG == fw->data[i]) &&
&& (i < STIR421X_PATCH_CODE_OFFSET)) { (i < STIR421X_PATCH_CODE_OFFSET)) {
if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG, if (!memcmp(fw->data + i + 1, STIR421X_PATCH_STMP_TAG,
sizeof(STIR421X_PATCH_STMP_TAG) - 1)) { sizeof(STIR421X_PATCH_STMP_TAG) - 1)) {

Просмотреть файл

@ -612,16 +612,16 @@ static int fifo_txwait(struct stir_cb *stir, int space)
pr_debug("fifo status 0x%lx count %lu\n", status, count); pr_debug("fifo status 0x%lx count %lu\n", status, count);
/* is fifo receiving already, or empty */ /* is fifo receiving already, or empty */
if (!(status & FIFOCTL_DIR) if (!(status & FIFOCTL_DIR) ||
|| (status & FIFOCTL_EMPTY)) (status & FIFOCTL_EMPTY))
return 0; return 0;
if (signal_pending(current)) if (signal_pending(current))
return -EINTR; return -EINTR;
/* shutting down? */ /* shutting down? */
if (!netif_running(stir->netdev) if (!netif_running(stir->netdev) ||
|| !netif_device_present(stir->netdev)) !netif_device_present(stir->netdev))
return -ESHUTDOWN; return -ESHUTDOWN;
/* only waiting for some space */ /* only waiting for some space */
@ -776,8 +776,8 @@ static int stir_transmit_thread(void *arg)
} }
/* nothing to send? start receiving */ /* nothing to send? start receiving */
if (!stir->receiving if (!stir->receiving &&
&& irda_device_txqueue_empty(dev)) { irda_device_txqueue_empty(dev)) {
/* Wait otherwise chip gets confused. */ /* Wait otherwise chip gets confused. */
if (fifo_txwait(stir, -1)) if (fifo_txwait(stir, -1))
break; break;

Просмотреть файл

@ -1185,8 +1185,8 @@ F01_E */
* if frame size,data ptr,or skb ptr are wrong ,the get next * if frame size,data ptr,or skb ptr are wrong ,the get next
* entry. * entry.
*/ */
if ((skb == NULL) || (skb->data == NULL) if ((skb == NULL) || (skb->data == NULL) ||
|| (self->rx_buff.data == NULL) || (len < 6)) { (self->rx_buff.data == NULL) || (len < 6)) {
self->netdev->stats.rx_dropped++; self->netdev->stats.rx_dropped++;
return TRUE; return TRUE;
} }
@ -1284,8 +1284,8 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
self->RetryCount++; self->RetryCount++;
if ((self->RetryCount >= 1) || if ((self->RetryCount >= 1) ||
((st_fifo->pending_bytes + 2048) > self->rx_buff.truesize) ((st_fifo->pending_bytes + 2048) > self->rx_buff.truesize) ||
|| (st_fifo->len >= (MAX_RX_WINDOW))) { (st_fifo->len >= (MAX_RX_WINDOW))) {
while (st_fifo->len > 0) { //upload frame while (st_fifo->len > 0) { //upload frame
// Put this entry back in fifo // Put this entry back in fifo
if (st_fifo->head > MAX_RX_WINDOW) if (st_fifo->head > MAX_RX_WINDOW)
@ -1300,8 +1300,8 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
* if frame size, data ptr, or skb ptr are wrong, * if frame size, data ptr, or skb ptr are wrong,
* then get next entry. * then get next entry.
*/ */
if ((skb == NULL) || (skb->data == NULL) if ((skb == NULL) || (skb->data == NULL) ||
|| (self->rx_buff.data == NULL) || (len < 6)) { (self->rx_buff.data == NULL) || (len < 6)) {
self->netdev->stats.rx_dropped++; self->netdev->stats.rx_dropped++;
continue; continue;
} }
@ -1332,8 +1332,8 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
* if frame is receive complete at this routine ,then upload * if frame is receive complete at this routine ,then upload
* frame. * frame.
*/ */
if ((GetRXStatus(iobase) & 0x10) if ((GetRXStatus(iobase) & 0x10) &&
&& (RxCurCount(iobase, self) != self->RxLastCount)) { (RxCurCount(iobase, self) != self->RxLastCount)) {
upload_rxdata(self, iobase); upload_rxdata(self, iobase);
if (irda_device_txqueue_empty(self->netdev)) if (irda_device_txqueue_empty(self->netdev))
via_ircc_dma_receive(self); via_ircc_dma_receive(self);

Просмотреть файл

@ -431,8 +431,8 @@ static struct vlsi_ring *vlsi_alloc_ring(struct pci_dev *pdev, struct ring_descr
memset(rd, 0, sizeof(*rd)); memset(rd, 0, sizeof(*rd));
rd->hw = hwmap + i; rd->hw = hwmap + i;
rd->buf = kmalloc(len, GFP_KERNEL|GFP_DMA); rd->buf = kmalloc(len, GFP_KERNEL|GFP_DMA);
if (rd->buf == NULL if (rd->buf == NULL ||
|| !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) { !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) {
if (rd->buf) { if (rd->buf) {
IRDA_ERROR("%s: failed to create PCI-MAP for %p", IRDA_ERROR("%s: failed to create PCI-MAP for %p",
__func__, rd->buf); __func__, rd->buf);
@ -955,8 +955,8 @@ static netdev_tx_t vlsi_hard_start_xmit(struct sk_buff *skb,
} }
for(;;) { for(;;) {
do_gettimeofday(&now); do_gettimeofday(&now);
if (now.tv_sec > ready.tv_sec if (now.tv_sec > ready.tv_sec ||
|| (now.tv_sec==ready.tv_sec && now.tv_usec>=ready.tv_usec)) (now.tv_sec==ready.tv_sec && now.tv_usec>=ready.tv_usec))
break; break;
udelay(100); udelay(100);
/* must not sleep here - called under netif_tx_lock! */ /* must not sleep here - called under netif_tx_lock! */
@ -1594,8 +1594,8 @@ static int vlsi_irda_init(struct net_device *ndev)
* see include file for details why we need these 2 masks, in this order! * see include file for details why we need these 2 masks, in this order!
*/ */
if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW) if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW) ||
|| pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) { pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) {
IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __func__); IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __func__);
return -1; return -1;
} }
@ -1641,8 +1641,8 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id)
IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n", IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n",
drivername, pci_name(pdev)); drivername, pci_name(pdev));
if ( !pci_resource_start(pdev,0) if ( !pci_resource_start(pdev,0) ||
|| !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) {
IRDA_ERROR("%s: bar 0 invalid", __func__); IRDA_ERROR("%s: bar 0 invalid", __func__);
goto out_disable; goto out_disable;
} }

Просмотреть файл

@ -214,9 +214,9 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
* contains the manufacturer's unique code. That might be a good probe * contains the manufacturer's unique code. That might be a good probe
* method. Ideally you would add additional checks. * method. Ideally you would add additional checks.
*/ */
if (inb(ioaddr + 0) != SA_ADDR0 if (inb(ioaddr + 0) != SA_ADDR0 ||
|| inb(ioaddr + 1) != SA_ADDR1 inb(ioaddr + 1) != SA_ADDR1 ||
|| inb(ioaddr + 2) != SA_ADDR2) inb(ioaddr + 2) != SA_ADDR2)
goto out; goto out;
if (net_debug && version_printed++ == 0) if (net_debug && version_printed++ == 0)

Просмотреть файл

@ -604,10 +604,10 @@ static int veth_process_caps(struct veth_lpar_connection *cnx)
/* Convert timer to jiffies */ /* Convert timer to jiffies */
cnx->ack_timeout = remote_caps->ack_timeout * HZ / 1000000; cnx->ack_timeout = remote_caps->ack_timeout * HZ / 1000000;
if ( (remote_caps->num_buffers == 0) if ( (remote_caps->num_buffers == 0) ||
|| (remote_caps->ack_threshold > VETH_MAX_ACKS_PER_MSG) (remote_caps->ack_threshold > VETH_MAX_ACKS_PER_MSG) ||
|| (remote_caps->ack_threshold == 0) (remote_caps->ack_threshold == 0) ||
|| (cnx->ack_timeout == 0) ) { (cnx->ack_timeout == 0) ) {
veth_error("Received incompatible capabilities from LPAR %d.\n", veth_error("Received incompatible capabilities from LPAR %d.\n",
cnx->remote_lp); cnx->remote_lp);
return HvLpEvent_Rc_InvalidSubtypeData; return HvLpEvent_Rc_InvalidSubtypeData;
@ -714,8 +714,8 @@ static void veth_statemachine(struct work_struct *work)
cnx->state |= VETH_STATE_OPEN; cnx->state |= VETH_STATE_OPEN;
} }
if ( (cnx->state & VETH_STATE_OPEN) if ( (cnx->state & VETH_STATE_OPEN) &&
&& !(cnx->state & VETH_STATE_SENTMON) ) { !(cnx->state & VETH_STATE_SENTMON) ) {
rc = veth_signalevent(cnx, VETH_EVENT_MONITOR, rc = veth_signalevent(cnx, VETH_EVENT_MONITOR,
HvLpEvent_AckInd_DoAck, HvLpEvent_AckInd_DoAck,
HvLpEvent_AckType_DeferredAck, HvLpEvent_AckType_DeferredAck,
@ -724,8 +724,8 @@ static void veth_statemachine(struct work_struct *work)
if (rc == HvLpEvent_Rc_Good) { if (rc == HvLpEvent_Rc_Good) {
cnx->state |= VETH_STATE_SENTMON; cnx->state |= VETH_STATE_SENTMON;
} else { } else {
if ( (rc != HvLpEvent_Rc_PartitionDead) if ( (rc != HvLpEvent_Rc_PartitionDead) &&
&& (rc != HvLpEvent_Rc_PathClosed) ) (rc != HvLpEvent_Rc_PathClosed) )
veth_error("Error sending monitor to LPAR %d, " veth_error("Error sending monitor to LPAR %d, "
"rc = %d\n", rlp, rc); "rc = %d\n", rlp, rc);
@ -735,8 +735,8 @@ static void veth_statemachine(struct work_struct *work)
} }
} }
if ( (cnx->state & VETH_STATE_OPEN) if ( (cnx->state & VETH_STATE_OPEN) &&
&& !(cnx->state & VETH_STATE_SENTCAPS)) { !(cnx->state & VETH_STATE_SENTCAPS)) {
u64 *rawcap = (u64 *)&cnx->local_caps; u64 *rawcap = (u64 *)&cnx->local_caps;
rc = veth_signalevent(cnx, VETH_EVENT_CAP, rc = veth_signalevent(cnx, VETH_EVENT_CAP,
@ -748,8 +748,8 @@ static void veth_statemachine(struct work_struct *work)
if (rc == HvLpEvent_Rc_Good) { if (rc == HvLpEvent_Rc_Good) {
cnx->state |= VETH_STATE_SENTCAPS; cnx->state |= VETH_STATE_SENTCAPS;
} else { } else {
if ( (rc != HvLpEvent_Rc_PartitionDead) if ( (rc != HvLpEvent_Rc_PartitionDead) &&
&& (rc != HvLpEvent_Rc_PathClosed) ) (rc != HvLpEvent_Rc_PathClosed) )
veth_error("Error sending caps to LPAR %d, " veth_error("Error sending caps to LPAR %d, "
"rc = %d\n", rlp, rc); "rc = %d\n", rlp, rc);
@ -759,8 +759,8 @@ static void veth_statemachine(struct work_struct *work)
} }
} }
if ((cnx->state & VETH_STATE_GOTCAPS) if ((cnx->state & VETH_STATE_GOTCAPS) &&
&& !(cnx->state & VETH_STATE_SENTCAPACK)) { !(cnx->state & VETH_STATE_SENTCAPACK)) {
struct veth_cap_data *remote_caps = &cnx->remote_caps; struct veth_cap_data *remote_caps = &cnx->remote_caps;
memcpy(remote_caps, &cnx->cap_event.u.caps_data, memcpy(remote_caps, &cnx->cap_event.u.caps_data,
@ -783,9 +783,9 @@ static void veth_statemachine(struct work_struct *work)
goto cant_cope; goto cant_cope;
} }
if ((cnx->state & VETH_STATE_GOTCAPACK) if ((cnx->state & VETH_STATE_GOTCAPACK) &&
&& (cnx->state & VETH_STATE_GOTCAPS) (cnx->state & VETH_STATE_GOTCAPS) &&
&& !(cnx->state & VETH_STATE_READY)) { !(cnx->state & VETH_STATE_READY)) {
if (cnx->cap_ack_event.base_event.xRc == HvLpEvent_Rc_Good) { if (cnx->cap_ack_event.base_event.xRc == HvLpEvent_Rc_Good) {
/* Start the ACK timer */ /* Start the ACK timer */
cnx->ack_timer.expires = jiffies + cnx->ack_timeout; cnx->ack_timer.expires = jiffies + cnx->ack_timeout;
@ -818,8 +818,8 @@ static int veth_init_connection(u8 rlp)
struct veth_msg *msgs; struct veth_msg *msgs;
int i; int i;
if ( (rlp == this_lp) if ( (rlp == this_lp) ||
|| ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) )
return 0; return 0;
cnx = kzalloc(sizeof(*cnx), GFP_KERNEL); cnx = kzalloc(sizeof(*cnx), GFP_KERNEL);
@ -1538,8 +1538,8 @@ static void veth_receive(struct veth_lpar_connection *cnx,
cnx->pending_acks[cnx->num_pending_acks++] = cnx->pending_acks[cnx->num_pending_acks++] =
event->base_event.xCorrelationToken; event->base_event.xCorrelationToken;
if ( (cnx->num_pending_acks >= cnx->remote_caps.ack_threshold) if ( (cnx->num_pending_acks >= cnx->remote_caps.ack_threshold) ||
|| (cnx->num_pending_acks >= VETH_MAX_ACKS_PER_MSG) ) (cnx->num_pending_acks >= VETH_MAX_ACKS_PER_MSG) )
veth_flush_acks(cnx); veth_flush_acks(cnx);
spin_unlock_irqrestore(&cnx->lock, flags); spin_unlock_irqrestore(&cnx->lock, flags);

Просмотреть файл

@ -130,8 +130,8 @@ static int __devinit sonic_probe1(struct net_device *dev)
printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision); printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision);
i = 0; i = 0;
while (known_revisions[i] != 0xffff while (known_revisions[i] != 0xffff &&
&& known_revisions[i] != silicon_revision) known_revisions[i] != silicon_revision)
i++; i++;
if (known_revisions[i] == 0xffff) { if (known_revisions[i] == 0xffff) {

Просмотреть файл

@ -1050,8 +1050,8 @@ jme_dynamic_pcc(struct jme_adapter *jme)
if ((NET_STAT(jme).rx_bytes - dpi->last_bytes) > PCC_P3_THRESHOLD) if ((NET_STAT(jme).rx_bytes - dpi->last_bytes) > PCC_P3_THRESHOLD)
jme_attempt_pcc(dpi, PCC_P3); jme_attempt_pcc(dpi, PCC_P3);
else if ((NET_STAT(jme).rx_packets - dpi->last_pkts) > PCC_P2_THRESHOLD else if ((NET_STAT(jme).rx_packets - dpi->last_pkts) > PCC_P2_THRESHOLD ||
|| dpi->intr_cnt > PCC_INTR_THRESHOLD) dpi->intr_cnt > PCC_INTR_THRESHOLD)
jme_attempt_pcc(dpi, PCC_P2); jme_attempt_pcc(dpi, PCC_P2);
else else
jme_attempt_pcc(dpi, PCC_P1); jme_attempt_pcc(dpi, PCC_P1);
@ -2199,8 +2199,8 @@ jme_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecmd)
if (netif_running(netdev)) if (netif_running(netdev))
return -EBUSY; return -EBUSY;
if (ecmd->use_adaptive_rx_coalesce if (ecmd->use_adaptive_rx_coalesce &&
&& test_bit(JME_FLAG_POLL, &jme->flags)) { test_bit(JME_FLAG_POLL, &jme->flags)) {
clear_bit(JME_FLAG_POLL, &jme->flags); clear_bit(JME_FLAG_POLL, &jme->flags);
jme->jme_rx = netif_rx; jme->jme_rx = netif_rx;
jme->jme_vlan_rx = vlan_hwaccel_rx; jme->jme_vlan_rx = vlan_hwaccel_rx;
@ -2209,8 +2209,8 @@ jme_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecmd)
dpi->cnt = 0; dpi->cnt = 0;
jme_set_rx_pcc(jme, PCC_P1); jme_set_rx_pcc(jme, PCC_P1);
jme_interrupt_mode(jme); jme_interrupt_mode(jme);
} else if (!(ecmd->use_adaptive_rx_coalesce) } else if (!(ecmd->use_adaptive_rx_coalesce) &&
&& !(test_bit(JME_FLAG_POLL, &jme->flags))) { !(test_bit(JME_FLAG_POLL, &jme->flags))) {
set_bit(JME_FLAG_POLL, &jme->flags); set_bit(JME_FLAG_POLL, &jme->flags);
jme->jme_rx = netif_receive_skb; jme->jme_rx = netif_receive_skb;
jme->jme_vlan_rx = vlan_hwaccel_receive_skb; jme->jme_vlan_rx = vlan_hwaccel_receive_skb;

Просмотреть файл

@ -493,14 +493,14 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
static const short ioaddr_table[] = { 0x300, 0x320, 0x340, 0x360}; static const short ioaddr_table[] = { 0x300, 0x320, 0x340, 0x360};
int hp_port = (readl(bios + 1) & 1) ? 0x499 : 0x99; int hp_port = (readl(bios + 1) & 1) ? 0x499 : 0x99;
/* We can have boards other than the built-in! Verify this is on-board. */ /* We can have boards other than the built-in! Verify this is on-board. */
if ((inb(hp_port) & 0xc0) == 0x80 if ((inb(hp_port) & 0xc0) == 0x80 &&
&& ioaddr_table[inb(hp_port) & 3] == ioaddr) ioaddr_table[inb(hp_port) & 3] == ioaddr)
hp_builtin = hp_port; hp_builtin = hp_port;
} }
iounmap(bios); iounmap(bios);
/* We also recognize the HP Vectra on-board here, but check below. */ /* We also recognize the HP Vectra on-board here, but check below. */
hpJ2405A = (inb(ioaddr) == 0x08 && inb(ioaddr+1) == 0x00 hpJ2405A = (inb(ioaddr) == 0x08 && inb(ioaddr+1) == 0x00 &&
&& inb(ioaddr+2) == 0x09); inb(ioaddr+2) == 0x09);
/* Reset the LANCE. */ /* Reset the LANCE. */
reset_val = inw(ioaddr+LANCE_RESET); /* Reset the LANCE */ reset_val = inw(ioaddr+LANCE_RESET); /* Reset the LANCE */
@ -1035,8 +1035,8 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id)
spin_lock (&lp->devlock); spin_lock (&lp->devlock);
outw(0x00, dev->base_addr + LANCE_ADDR); outw(0x00, dev->base_addr + LANCE_ADDR);
while ((csr0 = inw(dev->base_addr + LANCE_DATA)) & 0x8600 while ((csr0 = inw(dev->base_addr + LANCE_DATA)) & 0x8600 &&
&& --boguscnt >= 0) { --boguscnt >= 0) {
/* Acknowledge all of the current interrupt sources ASAP. */ /* Acknowledge all of the current interrupt sources ASAP. */
outw(csr0 & ~0x004f, dev->base_addr + LANCE_DATA); outw(csr0 & ~0x004f, dev->base_addr + LANCE_DATA);

Просмотреть файл

@ -464,8 +464,8 @@ static irqreturn_t __ei_interrupt(int irq, void *dev_id)
ei_inb_p(e8390_base + EN0_ISR)); ei_inb_p(e8390_base + EN0_ISR));
/* !!Assumption!! -- we stay in page 0. Don't break this. */ /* !!Assumption!! -- we stay in page 0. Don't break this. */
while ((interrupts = ei_inb_p(e8390_base + EN0_ISR)) != 0 while ((interrupts = ei_inb_p(e8390_base + EN0_ISR)) != 0 &&
&& ++nr_serviced < MAX_SERVICE) ++nr_serviced < MAX_SERVICE)
{ {
if (!netif_running(dev)) { if (!netif_running(dev)) {
printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name); printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name);
@ -721,10 +721,10 @@ static void ei_receive(struct net_device *dev)
/* Check for bogosity warned by 3c503 book: the status byte is never /* Check for bogosity warned by 3c503 book: the status byte is never
written. This happened a lot during testing! This code should be written. This happened a lot during testing! This code should be
cleaned up someday. */ cleaned up someday. */
if (rx_frame.next != next_frame if (rx_frame.next != next_frame &&
&& rx_frame.next != next_frame + 1 rx_frame.next != next_frame + 1 &&
&& rx_frame.next != next_frame - num_rx_pages rx_frame.next != next_frame - num_rx_pages &&
&& rx_frame.next != next_frame + 1 - num_rx_pages) { rx_frame.next != next_frame + 1 - num_rx_pages) {
ei_local->current_page = rxing_page; ei_local->current_page = rxing_page;
ei_outb(ei_local->current_page-1, e8390_base+EN0_BOUNDARY); ei_outb(ei_local->current_page-1, e8390_base+EN0_BOUNDARY);
dev->stats.rx_errors++; dev->stats.rx_errors++;

Просмотреть файл

@ -231,8 +231,8 @@ static void temac_set_multicast_list(struct net_device *ndev)
int i; int i;
mutex_lock(&lp->indirect_mutex); mutex_lock(&lp->indirect_mutex);
if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) ||
|| ndev->mc_count > MULTICAST_CAM_TABLE_NUM) { ndev->mc_count > MULTICAST_CAM_TABLE_NUM) {
/* /*
* We must make the kernel realise we had to move * We must make the kernel realise we had to move
* into promisc mode or we start all out war on * into promisc mode or we start all out war on

Просмотреть файл

@ -222,8 +222,8 @@ struct net_device * __init mac89x0_probe(int unit)
int card_present; int card_present;
local_irq_save(flags); local_irq_save(flags);
card_present = hwreg_present((void*) ioaddr+4) card_present = (hwreg_present((void*) ioaddr+4) &&
&& hwreg_present((void*) ioaddr + DATA_PORT); hwreg_present((void*) ioaddr + DATA_PORT));
local_irq_restore(flags); local_irq_restore(flags);
if (!card_present) if (!card_present)

Просмотреть файл

@ -897,8 +897,8 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id)
if (next >= N_RX_RING) if (next >= N_RX_RING)
next = 0; next = 0;
np = mp->rx_cmds + next; np = mp->rx_cmds + next;
if (next != mp->rx_fill if (next != mp->rx_fill &&
&& (ld_le16(&np->xfer_status) & ACTIVE) != 0) { (ld_le16(&np->xfer_status) & ACTIVE) != 0) {
printk(KERN_DEBUG "mace: lost a status word\n"); printk(KERN_DEBUG "mace: lost a status word\n");
++mace_lost_status; ++mace_lost_status;
} else } else

Просмотреть файл

@ -410,8 +410,8 @@ myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd,
* and try to get the completion quickly * and try to get the completion quickly
* (1ms will be enough for those commands) */ * (1ms will be enough for those commands) */
for (sleep_total = 0; for (sleep_total = 0;
sleep_total < 1000 sleep_total < 1000 &&
&& response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT); response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT);
sleep_total += 10) { sleep_total += 10) {
udelay(10); udelay(10);
mb(); mb();
@ -419,8 +419,8 @@ myri10ge_send_cmd(struct myri10ge_priv *mgp, u32 cmd,
} else { } else {
/* use msleep for most command */ /* use msleep for most command */
for (sleep_total = 0; for (sleep_total = 0;
sleep_total < 15 sleep_total < 15 &&
&& response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT); response->result == htonl(MYRI10GE_NO_RESPONSE_RESULT);
sleep_total++) sleep_total++)
msleep(1); msleep(1);
} }
@ -557,8 +557,8 @@ myri10ge_validate_firmware(struct myri10ge_priv *mgp,
sscanf(mgp->fw_version, "%d.%d.%d", &mgp->fw_ver_major, sscanf(mgp->fw_version, "%d.%d.%d", &mgp->fw_ver_major,
&mgp->fw_ver_minor, &mgp->fw_ver_tiny); &mgp->fw_ver_minor, &mgp->fw_ver_tiny);
if (!(mgp->fw_ver_major == MXGEFW_VERSION_MAJOR if (!(mgp->fw_ver_major == MXGEFW_VERSION_MAJOR &&
&& mgp->fw_ver_minor == MXGEFW_VERSION_MINOR)) { mgp->fw_ver_minor == MXGEFW_VERSION_MINOR)) {
dev_err(dev, "Found firmware version %s\n", mgp->fw_version); dev_err(dev, "Found firmware version %s\n", mgp->fw_version);
dev_err(dev, "Driver needs %d.%d\n", MXGEFW_VERSION_MAJOR, dev_err(dev, "Driver needs %d.%d\n", MXGEFW_VERSION_MAJOR,
MXGEFW_VERSION_MINOR); MXGEFW_VERSION_MINOR);
@ -1412,8 +1412,8 @@ myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index)
} }
/* start the queue if we've stopped it */ /* start the queue if we've stopped it */
if (netif_tx_queue_stopped(dev_queue) if (netif_tx_queue_stopped(dev_queue) &&
&& tx->req - tx->done < (tx->mask >> 1)) { tx->req - tx->done < (tx->mask >> 1)) {
tx->wake_queue++; tx->wake_queue++;
netif_tx_wake_queue(dev_queue); netif_tx_wake_queue(dev_queue);
} }

Просмотреть файл

@ -683,8 +683,8 @@ static ssize_t natsemi_set_dspcfg_workaround(struct device *dev,
/* Find out the new setting */ /* Find out the new setting */
if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1)) if (!strncmp("on", buf, count - 1) || !strncmp("1", buf, count - 1))
new_setting = 1; new_setting = 1;
else if (!strncmp("off", buf, count - 1) else if (!strncmp("off", buf, count - 1) ||
|| !strncmp("0", buf, count - 1)) !strncmp("0", buf, count - 1))
new_setting = 0; new_setting = 0;
else else
return count; return count;
@ -757,8 +757,8 @@ static void __devinit natsemi_init_media (struct net_device *dev)
np->autoneg = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE; np->autoneg = (tmp & BMCR_ANENABLE)? AUTONEG_ENABLE: AUTONEG_DISABLE;
np->advertising= mdio_read(dev, MII_ADVERTISE); np->advertising= mdio_read(dev, MII_ADVERTISE);
if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL if ((np->advertising & ADVERTISE_ALL) != ADVERTISE_ALL &&
&& netif_msg_probe(np)) { netif_msg_probe(np)) {
printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s " printk(KERN_INFO "natsemi %s: Transceiver default autonegotiation %s "
"10%s %s duplex.\n", "10%s %s duplex.\n",
pci_name(np->pci_dev), pci_name(np->pci_dev),
@ -1153,8 +1153,8 @@ static void init_phy_fixup(struct net_device *dev)
tmp = mdio_read(dev, MII_BMCR); tmp = mdio_read(dev, MII_BMCR);
if (np->autoneg == AUTONEG_ENABLE) { if (np->autoneg == AUTONEG_ENABLE) {
/* renegotiate if something changed */ /* renegotiate if something changed */
if ((tmp & BMCR_ANENABLE) == 0 if ((tmp & BMCR_ANENABLE) == 0 ||
|| np->advertising != mdio_read(dev, MII_ADVERTISE)) np->advertising != mdio_read(dev, MII_ADVERTISE))
{ {
/* turn on autonegotiation and force negotiation */ /* turn on autonegotiation and force negotiation */
tmp |= (BMCR_ANENABLE | BMCR_ANRESTART); tmp |= (BMCR_ANENABLE | BMCR_ANRESTART);
@ -2164,8 +2164,8 @@ static void netdev_tx_done(struct net_device *dev)
dev_kfree_skb_irq(np->tx_skbuff[entry]); dev_kfree_skb_irq(np->tx_skbuff[entry]);
np->tx_skbuff[entry] = NULL; np->tx_skbuff[entry] = NULL;
} }
if (netif_queue_stopped(dev) if (netif_queue_stopped(dev) &&
&& np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) { np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 4) {
/* The ring is no longer full, wake queue. */ /* The ring is no longer full, wake queue. */
netif_wake_queue(dev); netif_wake_queue(dev);
} }
@ -2343,8 +2343,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
/* Omit CRC size. */ /* Omit CRC size. */
/* Check if the packet is long enough to accept /* Check if the packet is long enough to accept
* without copying to a minimally-sized skbuff. */ * without copying to a minimally-sized skbuff. */
if (pkt_len < rx_copybreak if (pkt_len < rx_copybreak &&
&& (skb = dev_alloc_skb(pkt_len + RX_OFFSET)) != NULL) { (skb = dev_alloc_skb(pkt_len + RX_OFFSET)) != NULL) {
/* 16 byte align the IP header */ /* 16 byte align the IP header */
skb_reserve(skb, RX_OFFSET); skb_reserve(skb, RX_OFFSET);
pci_dma_sync_single_for_cpu(np->pci_dev, pci_dma_sync_single_for_cpu(np->pci_dev,
@ -2390,8 +2390,8 @@ static void netdev_error(struct net_device *dev, int intr_status)
spin_lock(&np->lock); spin_lock(&np->lock);
if (intr_status & LinkChange) { if (intr_status & LinkChange) {
u16 lpa = mdio_read(dev, MII_LPA); u16 lpa = mdio_read(dev, MII_LPA);
if (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE if (mdio_read(dev, MII_BMCR) & BMCR_ANENABLE &&
&& netif_msg_link(np)) { netif_msg_link(np)) {
printk(KERN_INFO printk(KERN_INFO
"%s: Autonegotiation advertising" "%s: Autonegotiation advertising"
" %#04x partner %#04x.\n", dev->name, " %#04x partner %#04x.\n", dev->name,
@ -2488,8 +2488,8 @@ static void __set_rx_mode(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
rx_mode = RxFilterEnable | AcceptBroadcast rx_mode = RxFilterEnable | AcceptBroadcast
| AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys; | AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys;
} else if ((dev->mc_count > multicast_filter_limit) } else if ((dev->mc_count > multicast_filter_limit) ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
rx_mode = RxFilterEnable | AcceptBroadcast rx_mode = RxFilterEnable | AcceptBroadcast
| AcceptAllMulticast | AcceptMyPhys; | AcceptAllMulticast | AcceptMyPhys;
} else { } else {

Просмотреть файл

@ -257,18 +257,18 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
/* read which mode */ /* read which mode */
if (adapter->ahw.port_type == NETXEN_NIC_GBE) { if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
/* autonegotiation */ /* autonegotiation */
if (adapter->phy_write if (adapter->phy_write &&
&& adapter->phy_write(adapter, adapter->phy_write(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
ecmd->autoneg) != 0) ecmd->autoneg) != 0)
return -EIO; return -EIO;
else else
adapter->link_autoneg = ecmd->autoneg; adapter->link_autoneg = ecmd->autoneg;
if (adapter->phy_read if (adapter->phy_read &&
&& adapter->phy_read(adapter, adapter->phy_read(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) != 0) &status) != 0)
return -EIO; return -EIO;
/* speed */ /* speed */
@ -288,10 +288,10 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
netxen_clear_phy_duplex(status); netxen_clear_phy_duplex(status);
if (ecmd->duplex == DUPLEX_FULL) if (ecmd->duplex == DUPLEX_FULL)
netxen_set_phy_duplex(status); netxen_set_phy_duplex(status);
if (adapter->phy_write if (adapter->phy_write &&
&& adapter->phy_write(adapter, adapter->phy_write(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
*((int *)&status)) != 0) *((int *)&status)) != 0)
return -EIO; return -EIO;
else { else {
adapter->link_speed = ecmd->speed; adapter->link_speed = ecmd->speed;
@ -442,10 +442,10 @@ static u32 netxen_nic_test_link(struct net_device *dev)
/* read which mode */ /* read which mode */
if (adapter->ahw.port_type == NETXEN_NIC_GBE) { if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
if (adapter->phy_read if (adapter->phy_read &&
&& adapter->phy_read(adapter, adapter->phy_read(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) != 0) &status) != 0)
return -EIO; return -EIO;
else { else {
val = netxen_get_phy_link(status); val = netxen_get_phy_link(status);

Просмотреть файл

@ -1936,10 +1936,10 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
return; return;
} }
if (adapter->phy_read if (adapter->phy_read &&
&& adapter->phy_read(adapter, adapter->phy_read(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
&status) == 0) { &status) == 0) {
if (netxen_get_phy_link(status)) { if (netxen_get_phy_link(status)) {
switch (netxen_get_phy_speed(status)) { switch (netxen_get_phy_speed(status)) {
case 0: case 0:
@ -1966,10 +1966,10 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
adapter->link_duplex = -1; adapter->link_duplex = -1;
break; break;
} }
if (adapter->phy_read if (adapter->phy_read &&
&& adapter->phy_read(adapter, adapter->phy_read(adapter,
NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
&autoneg) != 0) &autoneg) != 0)
adapter->link_autoneg = autoneg; adapter->link_autoneg = autoneg;
} else } else
goto link_down; goto link_down;

Просмотреть файл

@ -477,8 +477,8 @@ static int __init ni52_probe1(struct net_device *dev, int ioaddr)
for (i = 0; i < ETH_ALEN; i++) for (i = 0; i < ETH_ALEN; i++)
dev->dev_addr[i] = inb(dev->base_addr+i); dev->dev_addr[i] = inb(dev->base_addr+i);
if (dev->dev_addr[0] != NI52_ADDR0 || dev->dev_addr[1] != NI52_ADDR1 if (dev->dev_addr[0] != NI52_ADDR0 || dev->dev_addr[1] != NI52_ADDR1 ||
|| dev->dev_addr[2] != NI52_ADDR2) { dev->dev_addr[2] != NI52_ADDR2) {
retval = -ENODEV; retval = -ENODEV;
goto out; goto out;
} }

Просмотреть файл

@ -648,8 +648,8 @@ static void phy_intr(struct net_device *ndev)
dprintk("phy_intr: tbisr=%08x, tanar=%08x, tanlpar=%08x\n", dprintk("phy_intr: tbisr=%08x, tanar=%08x, tanlpar=%08x\n",
tbisr, tanar, tanlpar); tbisr, tanar, tanlpar);
if ( (fullduplex = (tanlpar & TANAR_FULL_DUP) if ( (fullduplex = (tanlpar & TANAR_FULL_DUP) &&
&& (tanar & TANAR_FULL_DUP)) ) { (tanar & TANAR_FULL_DUP)) ) {
/* both of us are full duplex */ /* both of us are full duplex */
writel(readl(dev->base + TXCFG) writel(readl(dev->base + TXCFG)
@ -661,12 +661,12 @@ static void phy_intr(struct net_device *ndev)
writel(readl(dev->base + GPIOR) | GPIOR_GP1_OUT, writel(readl(dev->base + GPIOR) | GPIOR_GP1_OUT,
dev->base + GPIOR); dev->base + GPIOR);
} else if(((tanlpar & TANAR_HALF_DUP) } else if (((tanlpar & TANAR_HALF_DUP) &&
&& (tanar & TANAR_HALF_DUP)) (tanar & TANAR_HALF_DUP)) ||
|| ((tanlpar & TANAR_FULL_DUP) ((tanlpar & TANAR_FULL_DUP) &&
&& (tanar & TANAR_HALF_DUP)) (tanar & TANAR_HALF_DUP)) ||
|| ((tanlpar & TANAR_HALF_DUP) ((tanlpar & TANAR_HALF_DUP) &&
&& (tanar & TANAR_FULL_DUP))) { (tanar & TANAR_FULL_DUP))) {
/* one or both of us are half duplex */ /* one or both of us are half duplex */
writel((readl(dev->base + TXCFG) writel((readl(dev->base + TXCFG)
@ -720,16 +720,16 @@ static void phy_intr(struct net_device *ndev)
newlinkstate = (cfg & CFG_LNKSTS) ? LINK_UP : LINK_DOWN; newlinkstate = (cfg & CFG_LNKSTS) ? LINK_UP : LINK_DOWN;
if (newlinkstate & LINK_UP if (newlinkstate & LINK_UP &&
&& dev->linkstate != newlinkstate) { dev->linkstate != newlinkstate) {
netif_start_queue(ndev); netif_start_queue(ndev);
netif_wake_queue(ndev); netif_wake_queue(ndev);
printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n", printk(KERN_INFO "%s: link now %s mbps, %s duplex and up.\n",
ndev->name, ndev->name,
speeds[speed], speeds[speed],
fullduplex ? "full" : "half"); fullduplex ? "full" : "half");
} else if (newlinkstate & LINK_DOWN } else if (newlinkstate & LINK_DOWN &&
&& dev->linkstate != newlinkstate) { dev->linkstate != newlinkstate) {
netif_stop_queue(ndev); netif_stop_queue(ndev);
printk(KERN_INFO "%s: link now down.\n", ndev->name); printk(KERN_INFO "%s: link now down.\n", ndev->name);
} }

Просмотреть файл

@ -1225,8 +1225,8 @@ static void netdrv_timer (unsigned long data)
mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA); mii_lpa = mdio_read (dev, tp->phys[0], MII_LPA);
if (!tp->duplex_lock && mii_lpa != 0xffff) { if (!tp->duplex_lock && mii_lpa != 0xffff) {
int duplex = (mii_lpa & LPA_100FULL) int duplex = ((mii_lpa & LPA_100FULL) ||
|| (mii_lpa & 0x01C0) == 0x0040; (mii_lpa & 0x01C0) == 0x0040);
if (tp->full_duplex != duplex) { if (tp->full_duplex != duplex) {
tp->full_duplex = duplex; tp->full_duplex = duplex;
printk (KERN_INFO printk (KERN_INFO
@ -1612,8 +1612,8 @@ static void netdrv_weird_interrupt (struct net_device *dev,
(tp->drv_flags & HAS_LNK_CHNG)) { (tp->drv_flags & HAS_LNK_CHNG)) {
/* Really link-change on new chips. */ /* Really link-change on new chips. */
int lpar = NETDRV_R16 (NWayLPAR); int lpar = NETDRV_R16 (NWayLPAR);
int duplex = (lpar & 0x0100) || (lpar & 0x01C0) == 0x0040 int duplex = ((lpar & 0x0100) || (lpar & 0x01C0) == 0x0040 ||
|| tp->duplex_lock; tp->duplex_lock);
if (tp->full_duplex != duplex) { if (tp->full_duplex != duplex) {
tp->full_duplex = duplex; tp->full_duplex = duplex;
NETDRV_W8 (Cfg9346, Cfg9346_Unlock); NETDRV_W8 (Cfg9346, Cfg9346_Unlock);
@ -1820,8 +1820,8 @@ static void netdrv_set_rx_mode (struct net_device *dev)
AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
AcceptAllPhys; AcceptAllPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff; mc_filter[1] = mc_filter[0] = 0xffffffff;
} else if ((dev->mc_count > multicast_filter_limit) } else if ((dev->mc_count > multicast_filter_limit) ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to filter perfectly -- accept all multicasts. */ /* Too many to filter perfectly -- accept all multicasts. */
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff; mc_filter[1] = mc_filter[0] = 0xffffffff;

Просмотреть файл

@ -1232,8 +1232,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
ei_local->irqlock = 1; ei_local->irqlock = 1;
/* !!Assumption!! -- we stay in page 0. Don't break this. */ /* !!Assumption!! -- we stay in page 0. Don't break this. */
while ((interrupts = inb_p(e8390_base + EN0_ISR)) != 0 while ((interrupts = inb_p(e8390_base + EN0_ISR)) != 0 &&
&& ++nr_serviced < MAX_SERVICE) ++nr_serviced < MAX_SERVICE)
{ {
if (!netif_running(dev) || (interrupts == 0xff)) { if (!netif_running(dev) || (interrupts == 0xff)) {
if (ei_debug > 1) if (ei_debug > 1)

Просмотреть файл

@ -371,9 +371,9 @@ static int fmvj18x_config(struct pcmcia_device *link)
switch (link->manf_id) { switch (link->manf_id) {
case MANFID_TDK: case MANFID_TDK:
cardtype = TDK; cardtype = TDK;
if (link->card_id == PRODID_TDK_GN3410 if (link->card_id == PRODID_TDK_GN3410 ||
|| link->card_id == PRODID_TDK_NP9610 link->card_id == PRODID_TDK_NP9610 ||
|| link->card_id == PRODID_TDK_MN3200) { link->card_id == PRODID_TDK_MN3200) {
/* MultiFunction Card */ /* MultiFunction Card */
link->conf.ConfigBase = 0x800; link->conf.ConfigBase = 0x800;
link->conf.ConfigIndex = 0x47; link->conf.ConfigIndex = 0x47;
@ -590,11 +590,11 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)
*/ */
for (i = 0; i < 0x200; i++) { for (i = 0; i < 0x200; i++) {
if (readb(base+i*2) == 0x22) { if (readb(base+i*2) == 0x22) {
if (readb(base+(i-1)*2) == 0xff if (readb(base+(i-1)*2) == 0xff &&
&& readb(base+(i+5)*2) == 0x04 readb(base+(i+5)*2) == 0x04 &&
&& readb(base+(i+6)*2) == 0x06 readb(base+(i+6)*2) == 0x06 &&
&& readb(base+(i+13)*2) == 0xff) readb(base+(i+13)*2) == 0xff)
break; break;
} }
} }
@ -1219,8 +1219,8 @@ static void set_rx_mode(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { if (dev->flags & IFF_PROMISC) {
memset(mc_filter, 0xff, sizeof(mc_filter)); memset(mc_filter, 0xff, sizeof(mc_filter));
outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */ outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */
} else if (dev->mc_count > MC_FILTERBREAK } else if (dev->mc_count > MC_FILTERBREAK ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to filter perfectly -- accept all multicasts. */ /* Too many to filter perfectly -- accept all multicasts. */
memset(mc_filter, 0xff, sizeof(mc_filter)); memset(mc_filter, 0xff, sizeof(mc_filter));
outb(2, ioaddr + RX_MODE); /* Use normal mode. */ outb(2, ioaddr + RX_MODE); /* Use normal mode. */

Просмотреть файл

@ -601,8 +601,8 @@ static int pcnet_config(struct pcmcia_device *link)
dev->if_port = 0; dev->if_port = 0;
} }
if ((link->conf.ConfigBase == 0x03c0) if ((link->conf.ConfigBase == 0x03c0) &&
&& (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n"); printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n");
printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n"); printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n");
goto failed; goto failed;

Просмотреть файл

@ -526,10 +526,10 @@ static int mhz_mfc_config(struct pcmcia_device *link)
mem.CardOffset = link->conf.ConfigBase; mem.CardOffset = link->conf.ConfigBase;
i = pcmcia_map_mem_page(link->win, &mem); i = pcmcia_map_mem_page(link->win, &mem);
if ((i == 0) if ((i == 0) &&
&& (smc->manfid == MANFID_MEGAHERTZ) (smc->manfid == MANFID_MEGAHERTZ) &&
&& (smc->cardid == PRODID_MEGAHERTZ_EM3288)) (smc->cardid == PRODID_MEGAHERTZ_EM3288))
mhz_3288_power(link); mhz_3288_power(link);
free_cfg_mem: free_cfg_mem:
kfree(cfg_mem); kfree(cfg_mem);

Просмотреть файл

@ -421,9 +421,9 @@ PrintRegisters(struct net_device *dev)
printk("\n"); printk("\n");
} }
for (page=0x40 ; page <= 0x5f; page++) { for (page=0x40 ; page <= 0x5f; page++) {
if (page == 0x43 || (page >= 0x46 && page <= 0x4f) if (page == 0x43 || (page >= 0x46 && page <= 0x4f) ||
|| (page >= 0x51 && page <=0x5e)) (page >= 0x51 && page <=0x5e))
continue; continue;
printk(KDBG_XIRC "Register page %2x: ", page); printk(KDBG_XIRC "Register page %2x: ", page);
SelectPage(page); SelectPage(page);
for (i = 8; i < 16; i++) for (i = 8; i < 16; i++)
@ -834,9 +834,9 @@ xirc2ps_config(struct pcmcia_device * link)
/* Once I saw two CISTPL_FUNCE_LAN_NODE_ID entries: /* Once I saw two CISTPL_FUNCE_LAN_NODE_ID entries:
* the first one with a length of zero the second correct - * the first one with a length of zero the second correct -
* so I skip all entries with length 0 */ * so I skip all entries with length 0 */
if (parse.funce.type == CISTPL_FUNCE_LAN_NODE_ID if (parse.funce.type == CISTPL_FUNCE_LAN_NODE_ID &&
&& ((cistpl_lan_node_id_t *)parse.funce.data)->nb) ((cistpl_lan_node_id_t *)parse.funce.data)->nb)
break; break;
} }
if (err) { /* not found: try to get the node-id from tuple 0x89 */ if (err) { /* not found: try to get the node-id from tuple 0x89 */
tuple.DesiredTuple = 0x89; /* data layout looks like tuple 0x22 */ tuple.DesiredTuple = 0x89; /* data layout looks like tuple 0x22 */
@ -852,8 +852,8 @@ xirc2ps_config(struct pcmcia_device * link)
tuple.DesiredTuple = CISTPL_FUNCE; tuple.DesiredTuple = CISTPL_FUNCE;
for (err = first_tuple(link, &tuple, &parse); !err; for (err = first_tuple(link, &tuple, &parse); !err;
err = next_tuple(link, &tuple, &parse)) { err = next_tuple(link, &tuple, &parse)) {
if (parse.funce.type == 0x02 && parse.funce.data[0] == 1 if (parse.funce.type == 0x02 && parse.funce.data[0] == 1 &&
&& parse.funce.data[1] == 6 && tuple.TupleDataLen == 13) { parse.funce.data[1] == 6 && tuple.TupleDataLen == 13) {
buf[1] = 4; buf[1] = 4;
memcpy(&parse, buf+1, 8); memcpy(&parse, buf+1, 8);
break; break;

Просмотреть файл

@ -1515,8 +1515,8 @@ static void __devinit pcnet32_probe_vlbus(unsigned int *pcnet32_portlist)
if (request_region if (request_region
(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_vlbus")) { (ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_vlbus")) {
/* check if there is really a pcnet chip on that ioaddr */ /* check if there is really a pcnet chip on that ioaddr */
if ((inb(ioaddr + 14) == 0x57) if ((inb(ioaddr + 14) == 0x57) &&
&& (inb(ioaddr + 15) == 0x57)) { (inb(ioaddr + 15) == 0x57)) {
pcnet32_probe1(ioaddr, 0, NULL); pcnet32_probe1(ioaddr, 0, NULL);
} else { } else {
release_region(ioaddr, PCNET32_TOTAL_SIZE); release_region(ioaddr, PCNET32_TOTAL_SIZE);
@ -1610,8 +1610,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
a = &pcnet32_wio; a = &pcnet32_wio;
} else { } else {
pcnet32_dwio_reset(ioaddr); pcnet32_dwio_reset(ioaddr);
if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 &&
&& pcnet32_dwio_check(ioaddr)) { pcnet32_dwio_check(ioaddr)) {
a = &pcnet32_dwio; a = &pcnet32_dwio;
} else { } else {
if (pcnet32_debug & NETIF_MSG_PROBE) if (pcnet32_debug & NETIF_MSG_PROBE)
@ -1750,8 +1750,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
promaddr[i] = inb(ioaddr + i); promaddr[i] = inb(ioaddr + i);
if (memcmp(promaddr, dev->dev_addr, 6) if (memcmp(promaddr, dev->dev_addr, 6) ||
|| !is_valid_ether_addr(dev->dev_addr)) { !is_valid_ether_addr(dev->dev_addr)) {
if (is_valid_ether_addr(promaddr)) { if (is_valid_ether_addr(promaddr)) {
if (pcnet32_debug & NETIF_MSG_PROBE) { if (pcnet32_debug & NETIF_MSG_PROBE) {
printk(" warning: CSR address invalid,\n"); printk(" warning: CSR address invalid,\n");
@ -1840,8 +1840,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
lp->mii = mii; lp->mii = mii;
lp->chip_version = chip_version; lp->chip_version = chip_version;
lp->msg_enable = pcnet32_debug; lp->msg_enable = pcnet32_debug;
if ((cards_found >= MAX_UNITS) if ((cards_found >= MAX_UNITS) ||
|| (options[cards_found] >= sizeof(options_mapping))) (options[cards_found] >= sizeof(options_mapping)))
lp->options = PCNET32_PORT_ASEL; lp->options = PCNET32_PORT_ASEL;
else else
lp->options = options_mapping[options[cards_found]]; lp->options = options_mapping[options[cards_found]];
@ -1866,8 +1866,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
goto err_free_ring; goto err_free_ring;
} }
/* detect special T1/E1 WAN card by checking for MAC address */ /* detect special T1/E1 WAN card by checking for MAC address */
if (dev->dev_addr[0] == 0x00 && dev->dev_addr[1] == 0xe0 if (dev->dev_addr[0] == 0x00 && dev->dev_addr[1] == 0xe0 &&
&& dev->dev_addr[2] == 0x75) dev->dev_addr[2] == 0x75)
lp->options = PCNET32_PORT_FD | PCNET32_PORT_GPSI; lp->options = PCNET32_PORT_FD | PCNET32_PORT_GPSI;
lp->init_block->mode = cpu_to_le16(0x0003); /* Disable Rx and Tx. */ lp->init_block->mode = cpu_to_le16(0x0003); /* Disable Rx and Tx. */

Просмотреть файл

@ -254,12 +254,12 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd)
if (cmd->autoneg == AUTONEG_ENABLE && cmd->advertising == 0) if (cmd->autoneg == AUTONEG_ENABLE && cmd->advertising == 0)
return -EINVAL; return -EINVAL;
if (cmd->autoneg == AUTONEG_DISABLE if (cmd->autoneg == AUTONEG_DISABLE &&
&& ((cmd->speed != SPEED_1000 ((cmd->speed != SPEED_1000 &&
&& cmd->speed != SPEED_100 cmd->speed != SPEED_100 &&
&& cmd->speed != SPEED_10) cmd->speed != SPEED_10) ||
|| (cmd->duplex != DUPLEX_HALF (cmd->duplex != DUPLEX_HALF &&
&& cmd->duplex != DUPLEX_FULL))) cmd->duplex != DUPLEX_FULL)))
return -EINVAL; return -EINVAL;
phydev->autoneg = cmd->autoneg; phydev->autoneg = cmd->autoneg;
@ -353,9 +353,9 @@ int phy_mii_ioctl(struct phy_device *phydev,
phy_write(phydev, mii_data->reg_num, val); phy_write(phydev, mii_data->reg_num, val);
if (mii_data->reg_num == MII_BMCR if (mii_data->reg_num == MII_BMCR &&
&& val & BMCR_RESET val & BMCR_RESET &&
&& phydev->drv->config_init) { phydev->drv->config_init) {
phy_scan_fixups(phydev); phy_scan_fixups(phydev);
phydev->drv->config_init(phydev); phydev->drv->config_init(phydev);
} }

Просмотреть файл

@ -372,8 +372,8 @@ plip_bh(struct work_struct *work)
nl->is_deferred = 0; nl->is_deferred = 0;
f = connection_state_table[nl->connection]; f = connection_state_table[nl->connection];
if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK if ((r = (*f)(nl->dev, nl, snd, rcv)) != OK &&
&& (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) { (r = plip_bh_timeout_error(nl->dev, nl, snd, rcv, r)) != OK) {
nl->is_deferred = 1; nl->is_deferred = 1;
schedule_delayed_work(&nl->deferred, 1); schedule_delayed_work(&nl->deferred, 1);
} }
@ -416,9 +416,8 @@ plip_bh_timeout_error(struct net_device *dev, struct net_local *nl,
if (error != ERROR) { /* Timeout */ if (error != ERROR) { /* Timeout */
nl->timeout_count++; nl->timeout_count++;
if ((error == HS_TIMEOUT if ((error == HS_TIMEOUT && nl->timeout_count <= 10) ||
&& nl->timeout_count <= 10) nl->timeout_count <= 3) {
|| nl->timeout_count <= 3) {
spin_unlock_irq(&nl->lock); spin_unlock_irq(&nl->lock);
/* Try again later */ /* Try again later */
return TIMEOUT; return TIMEOUT;
@ -624,8 +623,8 @@ plip_receive_packet(struct net_device *dev, struct net_local *nl,
if (plip_receive(nibble_timeout, dev, if (plip_receive(nibble_timeout, dev,
&rcv->nibble, &rcv->length.b.msb)) &rcv->nibble, &rcv->length.b.msb))
return TIMEOUT; return TIMEOUT;
if (rcv->length.h > dev->mtu + dev->hard_header_len if (rcv->length.h > dev->mtu + dev->hard_header_len ||
|| rcv->length.h < 8) { rcv->length.h < 8) {
printk(KERN_WARNING "%s: bogus packet size %d.\n", dev->name, rcv->length.h); printk(KERN_WARNING "%s: bogus packet size %d.\n", dev->name, rcv->length.h);
return ERROR; return ERROR;
} }

Просмотреть файл

@ -558,8 +558,8 @@ ppp_async_encode(struct asyncppp *ap)
* Start of a new packet - insert the leading FLAG * Start of a new packet - insert the leading FLAG
* character if necessary. * character if necessary.
*/ */
if (islcp || flag_time == 0 if (islcp || flag_time == 0 ||
|| time_after_eq(jiffies, ap->last_xmit + flag_time)) time_after_eq(jiffies, ap->last_xmit + flag_time))
*buf++ = PPP_FLAG; *buf++ = PPP_FLAG;
ap->last_xmit = jiffies; ap->last_xmit = jiffies;
fcs = PPP_INITFCS; fcs = PPP_INITFCS;
@ -696,8 +696,8 @@ ppp_async_push(struct asyncppp *ap)
*/ */
clear_bit(XMIT_BUSY, &ap->xmit_flags); clear_bit(XMIT_BUSY, &ap->xmit_flags);
/* any more work to do? if not, exit the loop */ /* any more work to do? if not, exit the loop */
if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) ||
|| (!tty_stuffed && ap->tpkt))) (!tty_stuffed && ap->tpkt)))
break; break;
/* more work to do, see if we can do it now */ /* more work to do, see if we can do it now */
if (test_and_set_bit(XMIT_BUSY, &ap->xmit_flags)) if (test_and_set_bit(XMIT_BUSY, &ap->xmit_flags))
@ -754,8 +754,8 @@ scan_ordinary(struct asyncppp *ap, const unsigned char *buf, int count)
for (i = 0; i < count; ++i) { for (i = 0; i < count; ++i) {
c = buf[i]; c = buf[i];
if (c == PPP_ESCAPE || c == PPP_FLAG if (c == PPP_ESCAPE || c == PPP_FLAG ||
|| (c < 0x20 && (ap->raccm & (1 << c)) != 0)) (c < 0x20 && (ap->raccm & (1 << c)) != 0))
break; break;
} }
return i; return i;

Просмотреть файл

@ -111,11 +111,11 @@ static void *z_comp_alloc(unsigned char *options, int opt_len)
struct ppp_deflate_state *state; struct ppp_deflate_state *state;
int w_size; int w_size;
if (opt_len != CILEN_DEFLATE if (opt_len != CILEN_DEFLATE ||
|| (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) ||
|| options[1] != CILEN_DEFLATE options[1] != CILEN_DEFLATE ||
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL ||
|| options[3] != DEFLATE_CHK_SEQUENCE) options[3] != DEFLATE_CHK_SEQUENCE)
return NULL; return NULL;
w_size = DEFLATE_SIZE(options[2]); w_size = DEFLATE_SIZE(options[2]);
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
@ -163,12 +163,12 @@ static int z_comp_init(void *arg, unsigned char *options, int opt_len,
{ {
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
if (opt_len < CILEN_DEFLATE if (opt_len < CILEN_DEFLATE ||
|| (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) ||
|| options[1] != CILEN_DEFLATE options[1] != CILEN_DEFLATE ||
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL ||
|| DEFLATE_SIZE(options[2]) != state->w_size DEFLATE_SIZE(options[2]) != state->w_size ||
|| options[3] != DEFLATE_CHK_SEQUENCE) options[3] != DEFLATE_CHK_SEQUENCE)
return 0; return 0;
state->seqno = 0; state->seqno = 0;
@ -330,11 +330,11 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len)
struct ppp_deflate_state *state; struct ppp_deflate_state *state;
int w_size; int w_size;
if (opt_len != CILEN_DEFLATE if (opt_len != CILEN_DEFLATE ||
|| (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) ||
|| options[1] != CILEN_DEFLATE options[1] != CILEN_DEFLATE ||
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL ||
|| options[3] != DEFLATE_CHK_SEQUENCE) options[3] != DEFLATE_CHK_SEQUENCE)
return NULL; return NULL;
w_size = DEFLATE_SIZE(options[2]); w_size = DEFLATE_SIZE(options[2]);
if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
@ -381,12 +381,12 @@ static int z_decomp_init(void *arg, unsigned char *options, int opt_len,
{ {
struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg; struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
if (opt_len < CILEN_DEFLATE if (opt_len < CILEN_DEFLATE ||
|| (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) (options[0] != CI_DEFLATE && options[0] != CI_DEFLATE_DRAFT) ||
|| options[1] != CILEN_DEFLATE options[1] != CILEN_DEFLATE ||
|| DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL ||
|| DEFLATE_SIZE(options[2]) != state->w_size DEFLATE_SIZE(options[2]) != state->w_size ||
|| options[3] != DEFLATE_CHK_SEQUENCE) options[3] != DEFLATE_CHK_SEQUENCE)
return 0; return 0;
state->seqno = 0; state->seqno = 0;

Просмотреть файл

@ -425,8 +425,8 @@ static ssize_t ppp_read(struct file *file, char __user *buf,
* network traffic (demand mode). * network traffic (demand mode).
*/ */
struct ppp *ppp = PF_TO_PPP(pf); struct ppp *ppp = PF_TO_PPP(pf);
if (ppp->n_channels == 0 if (ppp->n_channels == 0 &&
&& (ppp->flags & SC_LOOP_TRAFFIC) == 0) (ppp->flags & SC_LOOP_TRAFFIC) == 0)
break; break;
} }
ret = -EAGAIN; ret = -EAGAIN;
@ -511,8 +511,8 @@ static unsigned int ppp_poll(struct file *file, poll_table *wait)
else if (pf->kind == INTERFACE) { else if (pf->kind == INTERFACE) {
/* see comment in ppp_read */ /* see comment in ppp_read */
struct ppp *ppp = PF_TO_PPP(pf); struct ppp *ppp = PF_TO_PPP(pf);
if (ppp->n_channels == 0 if (ppp->n_channels == 0 &&
&& (ppp->flags & SC_LOOP_TRAFFIC) == 0) (ppp->flags & SC_LOOP_TRAFFIC) == 0)
mask |= POLLIN | POLLRDNORM; mask |= POLLIN | POLLRDNORM;
} }
@ -1057,8 +1057,8 @@ ppp_xmit_process(struct ppp *ppp)
ppp_xmit_lock(ppp); ppp_xmit_lock(ppp);
if (!ppp->closing) { if (!ppp->closing) {
ppp_push(ppp); ppp_push(ppp);
while (!ppp->xmit_pending while (!ppp->xmit_pending &&
&& (skb = skb_dequeue(&ppp->file.xq))) (skb = skb_dequeue(&ppp->file.xq)))
ppp_send_frame(ppp, skb); ppp_send_frame(ppp, skb);
/* If there's no work left to do, tell the core net /* If there's no work left to do, tell the core net
code that we can accept some more. */ code that we can accept some more. */
@ -1137,18 +1137,18 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
/* the filter instructions are constructed assuming /* the filter instructions are constructed assuming
a four-byte PPP header on each packet */ a four-byte PPP header on each packet */
*skb_push(skb, 2) = 1; *skb_push(skb, 2) = 1;
if (ppp->pass_filter if (ppp->pass_filter &&
&& sk_run_filter(skb, ppp->pass_filter, sk_run_filter(skb, ppp->pass_filter,
ppp->pass_len) == 0) { ppp->pass_len) == 0) {
if (ppp->debug & 1) if (ppp->debug & 1)
printk(KERN_DEBUG "PPP: outbound frame not passed\n"); printk(KERN_DEBUG "PPP: outbound frame not passed\n");
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
/* if this packet passes the active filter, record the time */ /* if this packet passes the active filter, record the time */
if (!(ppp->active_filter if (!(ppp->active_filter &&
&& sk_run_filter(skb, ppp->active_filter, sk_run_filter(skb, ppp->active_filter,
ppp->active_len) == 0)) ppp->active_len) == 0))
ppp->last_xmit = jiffies; ppp->last_xmit = jiffies;
skb_pull(skb, 2); skb_pull(skb, 2);
#else #else
@ -1202,8 +1202,8 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
} }
/* try to do packet compression */ /* try to do packet compression */
if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state &&
&& proto != PPP_LCP && proto != PPP_CCP) { proto != PPP_LCP && proto != PPP_CCP) {
if (!(ppp->flags & SC_CCP_UP) && (ppp->flags & SC_MUST_COMP)) { if (!(ppp->flags & SC_CCP_UP) && (ppp->flags & SC_MUST_COMP)) {
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n"); printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n");
@ -1577,8 +1577,8 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb)
/* put it on the channel queue */ /* put it on the channel queue */
skb_queue_tail(&pch->file.rq, skb); skb_queue_tail(&pch->file.rq, skb);
/* drop old frames if queue too long */ /* drop old frames if queue too long */
while (pch->file.rq.qlen > PPP_MAX_RQLEN while (pch->file.rq.qlen > PPP_MAX_RQLEN &&
&& (skb = skb_dequeue(&pch->file.rq))) (skb = skb_dequeue(&pch->file.rq)))
kfree_skb(skb); kfree_skb(skb);
wake_up_interruptible(&pch->file.rwait); wake_up_interruptible(&pch->file.rwait);
} else { } else {
@ -1654,8 +1654,8 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
* Note that some decompressors need to see uncompressed frames * Note that some decompressors need to see uncompressed frames
* that come in as well as compressed frames. * that come in as well as compressed frames.
*/ */
if (ppp->rc_state && (ppp->rstate & SC_DECOMP_RUN) if (ppp->rc_state && (ppp->rstate & SC_DECOMP_RUN) &&
&& (ppp->rstate & (SC_DC_FERROR | SC_DC_ERROR)) == 0) (ppp->rstate & (SC_DC_FERROR | SC_DC_ERROR)) == 0)
skb = ppp_decompress_frame(ppp, skb); skb = ppp_decompress_frame(ppp, skb);
if (ppp->flags & SC_MUST_COMP && ppp->rstate & SC_DC_FERROR) if (ppp->flags & SC_MUST_COMP && ppp->rstate & SC_DC_FERROR)
@ -1726,8 +1726,8 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
/* control or unknown frame - pass it to pppd */ /* control or unknown frame - pass it to pppd */
skb_queue_tail(&ppp->file.rq, skb); skb_queue_tail(&ppp->file.rq, skb);
/* limit queue length by dropping old frames */ /* limit queue length by dropping old frames */
while (ppp->file.rq.qlen > PPP_MAX_RQLEN while (ppp->file.rq.qlen > PPP_MAX_RQLEN &&
&& (skb = skb_dequeue(&ppp->file.rq))) (skb = skb_dequeue(&ppp->file.rq)))
kfree_skb(skb); kfree_skb(skb);
/* wake up any process polling or blocking on read */ /* wake up any process polling or blocking on read */
wake_up_interruptible(&ppp->file.rwait); wake_up_interruptible(&ppp->file.rwait);
@ -1745,26 +1745,26 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
goto err; goto err;
*skb_push(skb, 2) = 0; *skb_push(skb, 2) = 0;
if (ppp->pass_filter if (ppp->pass_filter &&
&& sk_run_filter(skb, ppp->pass_filter, sk_run_filter(skb, ppp->pass_filter,
ppp->pass_len) == 0) { ppp->pass_len) == 0) {
if (ppp->debug & 1) if (ppp->debug & 1)
printk(KERN_DEBUG "PPP: inbound frame " printk(KERN_DEBUG "PPP: inbound frame "
"not passed\n"); "not passed\n");
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
if (!(ppp->active_filter if (!(ppp->active_filter &&
&& sk_run_filter(skb, ppp->active_filter, sk_run_filter(skb, ppp->active_filter,
ppp->active_len) == 0)) ppp->active_len) == 0))
ppp->last_recv = jiffies; ppp->last_recv = jiffies;
__skb_pull(skb, 2); __skb_pull(skb, 2);
} else } else
#endif /* CONFIG_PPP_FILTER */ #endif /* CONFIG_PPP_FILTER */
ppp->last_recv = jiffies; ppp->last_recv = jiffies;
if ((ppp->dev->flags & IFF_UP) == 0 if ((ppp->dev->flags & IFF_UP) == 0 ||
|| ppp->npmode[npi] != NPMODE_PASS) { ppp->npmode[npi] != NPMODE_PASS) {
kfree_skb(skb); kfree_skb(skb);
} else { } else {
/* chop off protocol */ /* chop off protocol */
@ -2228,13 +2228,13 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg)
unsigned char ccp_option[CCP_MAX_OPTION_LENGTH]; unsigned char ccp_option[CCP_MAX_OPTION_LENGTH];
err = -EFAULT; err = -EFAULT;
if (copy_from_user(&data, (void __user *) arg, sizeof(data)) if (copy_from_user(&data, (void __user *) arg, sizeof(data)) ||
|| (data.length <= CCP_MAX_OPTION_LENGTH (data.length <= CCP_MAX_OPTION_LENGTH &&
&& copy_from_user(ccp_option, (void __user *) data.ptr, data.length))) copy_from_user(ccp_option, (void __user *) data.ptr, data.length)))
goto out; goto out;
err = -EINVAL; err = -EINVAL;
if (data.length > CCP_MAX_OPTION_LENGTH if (data.length > CCP_MAX_OPTION_LENGTH ||
|| ccp_option[1] < 2 || ccp_option[1] > data.length) ccp_option[1] < 2 || ccp_option[1] > data.length)
goto out; goto out;
cp = try_then_request_module( cp = try_then_request_module(

Просмотреть файл

@ -195,8 +195,8 @@ static void *mppe_alloc(unsigned char *options, int optlen)
struct ppp_mppe_state *state; struct ppp_mppe_state *state;
unsigned int digestsize; unsigned int digestsize;
if (optlen != CILEN_MPPE + sizeof(state->master_key) if (optlen != CILEN_MPPE + sizeof(state->master_key) ||
|| options[0] != CI_MPPE || options[1] != CILEN_MPPE) options[0] != CI_MPPE || options[1] != CILEN_MPPE)
goto out; goto out;
state = kzalloc(sizeof(*state), GFP_KERNEL); state = kzalloc(sizeof(*state), GFP_KERNEL);
@ -276,8 +276,8 @@ mppe_init(void *arg, unsigned char *options, int optlen, int unit, int debug,
struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg; struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg;
unsigned char mppe_opts; unsigned char mppe_opts;
if (optlen != CILEN_MPPE if (optlen != CILEN_MPPE ||
|| options[0] != CI_MPPE || options[1] != CILEN_MPPE) options[0] != CI_MPPE || options[1] != CILEN_MPPE)
return 0; return 0;
MPPE_CI_TO_OPTS(&options[2], mppe_opts); MPPE_CI_TO_OPTS(&options[2], mppe_opts);

Просмотреть файл

@ -662,8 +662,8 @@ ppp_sync_push(struct syncppp *ap)
} }
/* haven't made any progress */ /* haven't made any progress */
spin_unlock_bh(&ap->xmit_lock); spin_unlock_bh(&ap->xmit_lock);
if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) if (!(test_bit(XMIT_WAKEUP, &ap->xmit_flags) ||
|| (!tty_stuffed && ap->tpkt))) (!tty_stuffed && ap->tpkt)))
break; break;
if (!spin_trylock_bh(&ap->xmit_lock)) if (!spin_trylock_bh(&ap->xmit_lock))
break; break;

Просмотреть файл

@ -323,8 +323,8 @@ static void pppoe_flush_dev(struct net_device *dev)
write_unlock_bh(&pn->hash_lock); write_unlock_bh(&pn->hash_lock);
lock_sock(sk); lock_sock(sk);
if (po->pppoe_dev == dev if (po->pppoe_dev == dev &&
&& sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) {
pppox_unbind_sock(sk); pppox_unbind_sock(sk);
sk->sk_state = PPPOX_ZOMBIE; sk->sk_state = PPPOX_ZOMBIE;
sk->sk_state_change(sk); sk->sk_state_change(sk);

Просмотреть файл

@ -1969,8 +1969,8 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev)
struct ql_rcv_buf_cb *lrg_buf_cb; struct ql_rcv_buf_cb *lrg_buf_cb;
struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers;
if ((qdev->lrg_buf_free_count >= 8) if ((qdev->lrg_buf_free_count >= 8) &&
&& (qdev->lrg_buf_release_cnt >= 16)) { (qdev->lrg_buf_release_cnt >= 16)) {
if (qdev->lrg_buf_skb_check) if (qdev->lrg_buf_skb_check)
if (!ql_populate_free_queue(qdev)) if (!ql_populate_free_queue(qdev))
@ -1978,8 +1978,8 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev)
lrg_buf_q_ele = qdev->lrg_buf_next_free; lrg_buf_q_ele = qdev->lrg_buf_next_free;
while ((qdev->lrg_buf_release_cnt >= 16) while ((qdev->lrg_buf_release_cnt >= 16) &&
&& (qdev->lrg_buf_free_count >= 8)) { (qdev->lrg_buf_free_count >= 8)) {
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
lrg_buf_cb = lrg_buf_cb =

Просмотреть файл

@ -2347,8 +2347,8 @@ static int ql_alloc_tx_resources(struct ql_adapter *qdev,
pci_alloc_consistent(qdev->pdev, tx_ring->wq_size, pci_alloc_consistent(qdev->pdev, tx_ring->wq_size,
&tx_ring->wq_base_dma); &tx_ring->wq_base_dma);
if ((tx_ring->wq_base == NULL) if ((tx_ring->wq_base == NULL) ||
|| tx_ring->wq_base_dma & WQ_ADDR_ALIGN) { tx_ring->wq_base_dma & WQ_ADDR_ALIGN) {
QPRINTK(qdev, IFUP, ERR, "tx_ring alloc failed.\n"); QPRINTK(qdev, IFUP, ERR, "tx_ring alloc failed.\n");
return -ENOMEM; return -ENOMEM;
} }

Просмотреть файл

@ -958,8 +958,7 @@ static void r6040_multicast_list(struct net_device *dev)
} }
/* Too many multicast addresses /* Too many multicast addresses
* accept all traffic */ * accept all traffic */
else if ((dev->mc_count > MCAST_MAX) else if ((dev->mc_count > MCAST_MAX) || (dev->flags & IFF_ALLMULTI))
|| (dev->flags & IFF_ALLMULTI))
reg |= 0x0020; reg |= 0x0020;
iowrite16(reg, ioaddr); iowrite16(reg, ioaddr);

Просмотреть файл

@ -4763,8 +4763,8 @@ static void rtl_set_rx_mode(struct net_device *dev)
AcceptBroadcast | AcceptMulticast | AcceptMyPhys | AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
AcceptAllPhys; AcceptAllPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff; mc_filter[1] = mc_filter[0] = 0xffffffff;
} else if ((dev->mc_count > multicast_filter_limit) } else if ((dev->mc_count > multicast_filter_limit) ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to filter perfectly -- accept all multicasts. */ /* Too many to filter perfectly -- accept all multicasts. */
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
mc_filter[1] = mc_filter[0] = 0xffffffff; mc_filter[1] = mc_filter[0] = 0xffffffff;

Просмотреть файл

@ -373,9 +373,9 @@ struct s6gmac {
static void s6gmac_rx_fillfifo(struct s6gmac *pd) static void s6gmac_rx_fillfifo(struct s6gmac *pd)
{ {
struct sk_buff *skb; struct sk_buff *skb;
while ((((u8)(pd->rx_skb_i - pd->rx_skb_o)) < S6_NUM_RX_SKB) while ((((u8)(pd->rx_skb_i - pd->rx_skb_o)) < S6_NUM_RX_SKB) &&
&& (!s6dmac_fifo_full(pd->rx_dma, pd->rx_chan)) (!s6dmac_fifo_full(pd->rx_dma, pd->rx_chan)) &&
&& (skb = dev_alloc_skb(S6_MAX_FRLEN + 2))) { (skb = dev_alloc_skb(S6_MAX_FRLEN + 2))) {
pd->rx_skb[(pd->rx_skb_i++) % S6_NUM_RX_SKB] = skb; pd->rx_skb[(pd->rx_skb_i++) % S6_NUM_RX_SKB] = skb;
s6dmac_put_fifo_cache(pd->rx_dma, pd->rx_chan, s6dmac_put_fifo_cache(pd->rx_dma, pd->rx_chan,
pd->io, (u32)skb->data, S6_MAX_FRLEN); pd->io, (u32)skb->data, S6_MAX_FRLEN);

Просмотреть файл

@ -428,9 +428,9 @@ static void _sc92031_set_mar(struct net_device *dev)
void __iomem *port_base = priv->port_base; void __iomem *port_base = priv->port_base;
u32 mar0 = 0, mar1 = 0; u32 mar0 = 0, mar1 = 0;
if ((dev->flags & IFF_PROMISC) if ((dev->flags & IFF_PROMISC) ||
|| dev->mc_count > multicast_filter_limit dev->mc_count > multicast_filter_limit ||
|| (dev->flags & IFF_ALLMULTI)) (dev->flags & IFF_ALLMULTI))
mar0 = mar1 = 0xffffffff; mar0 = mar1 = 0xffffffff;
else if (dev->flags & IFF_MULTICAST) { else if (dev->flags & IFF_MULTICAST) {
struct dev_mc_list *mc_list; struct dev_mc_list *mc_list;
@ -777,10 +777,10 @@ static void _sc92031_rx_tasklet(struct net_device *dev)
rx_ring_offset = (rx_ring_offset + 4) % RX_BUF_LEN; rx_ring_offset = (rx_ring_offset + 4) % RX_BUF_LEN;
if (unlikely(rx_status == 0 if (unlikely(rx_status == 0 ||
|| rx_size > (MAX_ETH_FRAME_SIZE + 4) rx_size > (MAX_ETH_FRAME_SIZE + 4) ||
|| rx_size < 16 rx_size < 16 ||
|| !(rx_status & RxStatesOK))) { !(rx_status & RxStatesOK))) {
_sc92031_rx_tasklet_error(dev, rx_status, rx_size); _sc92031_rx_tasklet_error(dev, rx_status, rx_size);
break; break;
} }

Просмотреть файл

@ -238,8 +238,8 @@ static int skge_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = netdev_priv(dev);
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
if ((wol->wolopts & ~wol_supported(hw)) if ((wol->wolopts & ~wol_supported(hw)) ||
|| !device_can_wakeup(&hw->pdev->dev)) !device_can_wakeup(&hw->pdev->dev))
return -EOPNOTSUPP; return -EOPNOTSUPP;
skge->wol = wol->wolopts; skge->wol = wol->wolopts;
@ -576,9 +576,10 @@ static void skge_get_pauseparam(struct net_device *dev,
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = netdev_priv(dev);
ecmd->rx_pause = (skge->flow_control == FLOW_MODE_SYMMETRIC) ecmd->rx_pause = ((skge->flow_control == FLOW_MODE_SYMMETRIC) ||
|| (skge->flow_control == FLOW_MODE_SYM_OR_REM); (skge->flow_control == FLOW_MODE_SYM_OR_REM));
ecmd->tx_pause = ecmd->rx_pause || (skge->flow_control == FLOW_MODE_LOC_SEND); ecmd->tx_pause = (ecmd->rx_pause ||
(skge->flow_control == FLOW_MODE_LOC_SEND));
ecmd->autoneg = ecmd->rx_pause || ecmd->tx_pause; ecmd->autoneg = ecmd->rx_pause || ecmd->tx_pause;
} }
@ -2779,8 +2780,8 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
/* This seems backwards, but it is what the sk98lin /* This seems backwards, but it is what the sk98lin
* does. Looks like hardware is wrong? * does. Looks like hardware is wrong?
*/ */
if (ipip_hdr(skb)->protocol == IPPROTO_UDP if (ipip_hdr(skb)->protocol == IPPROTO_UDP &&
&& hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON) hw->chip_rev == 0 && hw->chip_id == CHIP_ID_YUKON)
control = BMU_TCP_CHECK; control = BMU_TCP_CHECK;
else else
control = BMU_UDP_CHECK; control = BMU_UDP_CHECK;
@ -2948,8 +2949,8 @@ static void genesis_set_multicast(struct net_device *dev)
else { else {
memset(filter, 0, sizeof(filter)); memset(filter, 0, sizeof(filter));
if (skge->flow_status == FLOW_STAT_REM_SEND if (skge->flow_status == FLOW_STAT_REM_SEND ||
|| skge->flow_status == FLOW_STAT_SYMMETRIC) skge->flow_status == FLOW_STAT_SYMMETRIC)
genesis_add_filter(filter, pause_mc_addr); genesis_add_filter(filter, pause_mc_addr);
for (i = 0; list && i < count; i++, list = list->next) for (i = 0; list && i < count; i++, list = list->next)
@ -2972,8 +2973,8 @@ static void yukon_set_multicast(struct net_device *dev)
struct skge_hw *hw = skge->hw; struct skge_hw *hw = skge->hw;
int port = skge->port; int port = skge->port;
struct dev_mc_list *list = dev->mc_list; struct dev_mc_list *list = dev->mc_list;
int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND int rx_pause = (skge->flow_status == FLOW_STAT_REM_SEND ||
|| skge->flow_status == FLOW_STAT_SYMMETRIC); skge->flow_status == FLOW_STAT_SYMMETRIC);
u16 reg; u16 reg;
u8 filter[8]; u8 filter[8];

Просмотреть файл

@ -374,8 +374,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO);
/* downshift on PHY 88E1112 and 88E1149 is changed */ /* downshift on PHY 88E1112 and 88E1149 is changed */
if ( (sky2->flags & SKY2_FLAG_AUTO_SPEED) if ( (sky2->flags & SKY2_FLAG_AUTO_SPEED) &&
&& (hw->flags & SKY2_HW_NEWER_PHY)) { (hw->flags & SKY2_HW_NEWER_PHY)) {
/* set downshift counter to 3x and enable downshift */ /* set downshift counter to 3x and enable downshift */
ctrl &= ~PHY_M_PC_DSC_MSK; ctrl &= ~PHY_M_PC_DSC_MSK;
ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA;
@ -619,8 +619,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
/* no effect on Yukon-XL */ /* no effect on Yukon-XL */
gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl);
if ( !(sky2->flags & SKY2_FLAG_AUTO_SPEED) if (!(sky2->flags & SKY2_FLAG_AUTO_SPEED) ||
|| sky2->speed == SPEED_100) { sky2->speed == SPEED_100) {
/* turn on 100 Mbps LED (LED_LINK100) */ /* turn on 100 Mbps LED (LED_LINK100) */
ledover |= PHY_M_LED_MO_100(MO_LED_ON); ledover |= PHY_M_LED_MO_100(MO_LED_ON);
} }
@ -937,8 +937,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
/* On chips without ram buffer, pause is controled by MAC level */ /* On chips without ram buffer, pause is controled by MAC level */
if (!(hw->flags & SKY2_HW_RAM_BUFFER)) { if (!(hw->flags & SKY2_HW_RAM_BUFFER)) {
/* Pause threshold is scaled by 8 in bytes */ /* Pause threshold is scaled by 8 in bytes */
if (hw->chip_id == CHIP_ID_YUKON_FE_P if (hw->chip_id == CHIP_ID_YUKON_FE_P &&
&& hw->chip_rev == CHIP_REV_YU_FE2_A0) hw->chip_rev == CHIP_REV_YU_FE2_A0)
reg = 1568 / 8; reg = 1568 / 8;
else else
reg = 1024 / 8; reg = 1024 / 8;
@ -1353,8 +1353,8 @@ static int sky2_rx_start(struct sky2_port *sky2)
/* These chips have no ram buffer? /* These chips have no ram buffer?
* MAC Rx RAM Read is controlled by hardware */ * MAC Rx RAM Read is controlled by hardware */
if (hw->chip_id == CHIP_ID_YUKON_EC_U && if (hw->chip_id == CHIP_ID_YUKON_EC_U &&
(hw->chip_rev == CHIP_REV_YU_EC_U_A1 (hw->chip_rev == CHIP_REV_YU_EC_U_A1 ||
|| hw->chip_rev == CHIP_REV_YU_EC_U_B0)) hw->chip_rev == CHIP_REV_YU_EC_U_B0))
sky2_write32(hw, Q_ADDR(rxq, Q_TEST), F_M_RX_RAM_DIS); sky2_write32(hw, Q_ADDR(rxq, Q_TEST), F_M_RX_RAM_DIS);
sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1); sky2_prefetch_init(hw, rxq, sky2->rx_le_map, RX_LE_SIZE - 1);
@ -1560,8 +1560,8 @@ static int sky2_up(struct net_device *dev)
sky2_write32(hw, Q_ADDR(txqaddr[port], Q_TEST), F_TX_CHK_AUTO_OFF); sky2_write32(hw, Q_ADDR(txqaddr[port], Q_TEST), F_TX_CHK_AUTO_OFF);
/* Set almost empty threshold */ /* Set almost empty threshold */
if (hw->chip_id == CHIP_ID_YUKON_EC_U if (hw->chip_id == CHIP_ID_YUKON_EC_U &&
&& hw->chip_rev == CHIP_REV_YU_EC_U_A0) hw->chip_rev == CHIP_REV_YU_EC_U_A0)
sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), ECU_TXFF_LEV); sky2_write16(hw, Q_ADDR(txqaddr[port], Q_AL), ECU_TXFF_LEV);
sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map, sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map,
@ -1907,8 +1907,8 @@ static int sky2_down(struct net_device *dev)
sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
/* Workaround shared GMAC reset */ /* Workaround shared GMAC reset */
if (!(hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0 if (!(hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev == 0 &&
&& port == 0 && hw->dev[1] && netif_running(hw->dev[1]))) port == 0 && hw->dev[1] && netif_running(hw->dev[1])))
sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET); sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_SET);
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
@ -2085,8 +2085,8 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux)
sky2->flow_status = FC_TX; sky2->flow_status = FC_TX;
} }
if (sky2->duplex == DUPLEX_HALF && sky2->speed < SPEED_1000 if (sky2->duplex == DUPLEX_HALF && sky2->speed < SPEED_1000 &&
&& !(hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX)) !(hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX))
sky2->flow_status = FC_NONE; sky2->flow_status = FC_NONE;
if (sky2->flow_status & FC_TX) if (sky2->flow_status & FC_TX)
@ -3244,8 +3244,8 @@ static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw; struct sky2_hw *hw = sky2->hw;
if ((wol->wolopts & ~sky2_wol_supported(sky2->hw)) if ((wol->wolopts & ~sky2_wol_supported(sky2->hw)) ||
|| !device_can_wakeup(&hw->pdev->dev)) !device_can_wakeup(&hw->pdev->dev))
return -EOPNOTSUPP; return -EOPNOTSUPP;
sky2->wol = wol->wolopts; sky2->wol = wol->wolopts;

Просмотреть файл

@ -956,8 +956,8 @@ static void slip_unesc(struct slip *sl, unsigned char s)
clear_bit(SLF_KEEPTEST, &sl->flags); clear_bit(SLF_KEEPTEST, &sl->flags);
#endif #endif
if (!test_and_clear_bit(SLF_ERROR, &sl->flags) if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
&& (sl->rcount > 2)) (sl->rcount > 2))
sl_bump(sl); sl_bump(sl);
clear_bit(SLF_ESCAPE, &sl->flags); clear_bit(SLF_ESCAPE, &sl->flags);
sl->rcount = 0; sl->rcount = 0;
@ -1039,8 +1039,8 @@ static void slip_unesc6(struct slip *sl, unsigned char s)
clear_bit(SLF_KEEPTEST, &sl->flags); clear_bit(SLF_KEEPTEST, &sl->flags);
#endif #endif
if (!test_and_clear_bit(SLF_ERROR, &sl->flags) if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
&& (sl->rcount > 2)) (sl->rcount > 2))
sl_bump(sl); sl_bump(sl);
sl->rcount = 0; sl->rcount = 0;
sl->xbits = 0; sl->xbits = 0;

Просмотреть файл

@ -268,9 +268,9 @@ static int __init ultramca_probe(struct device *gen_dev)
} }
} }
if(!tirq || !tbase if(!tirq || !tbase ||
|| (irq && irq != tirq) (irq && irq != tirq) ||
|| (base_addr && tbase != base_addr)) (base_addr && tbase != base_addr))
/* FIXME: we're trying to force the ordering of the /* FIXME: we're trying to force the ordering of the
* devices here, there should be a way of getting this * devices here, there should be a way of getting this
* to happen */ * to happen */

Просмотреть файл

@ -158,8 +158,8 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l)) #define SMC_outsb(a, r, p, l) writesb((a) + (r), p, (l))
#define SMC_IRQ_FLAGS (-1) /* from resource */ #define SMC_IRQ_FLAGS (-1) /* from resource */
#elif defined(CONFIG_MACH_LOGICPD_PXA270) \ #elif defined(CONFIG_MACH_LOGICPD_PXA270) || \
|| defined(CONFIG_MACH_NOMADIK_8815NHK) defined(CONFIG_MACH_NOMADIK_8815NHK)
#define SMC_CAN_USE_8BIT 0 #define SMC_CAN_USE_8BIT 0
#define SMC_CAN_USE_16BIT 1 #define SMC_CAN_USE_16BIT 1
@ -258,9 +258,9 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define RPC_LSA_DEFAULT RPC_LED_TX_RX #define RPC_LSA_DEFAULT RPC_LED_TX_RX
#define RPC_LSB_DEFAULT RPC_LED_100_10 #define RPC_LSB_DEFAULT RPC_LED_100_10
#elif defined(CONFIG_MACH_LPD79520) \ #elif defined(CONFIG_MACH_LPD79520) || \
|| defined(CONFIG_MACH_LPD7A400) \ defined(CONFIG_MACH_LPD7A400) || \
|| defined(CONFIG_MACH_LPD7A404) defined(CONFIG_MACH_LPD7A404)
/* The LPD7X_IOBARRIER is necessary to overcome a mismatch between the /* The LPD7X_IOBARRIER is necessary to overcome a mismatch between the
* way that the CPU handles chip selects and the way that the SMC chip * way that the CPU handles chip selects and the way that the SMC chip

Просмотреть файл

@ -748,8 +748,8 @@ static void smsc911x_phy_adjust_link(struct net_device *dev)
* usage is 10/100 indicator */ * usage is 10/100 indicator */
pdata->gpio_setting = smsc911x_reg_read(pdata, pdata->gpio_setting = smsc911x_reg_read(pdata,
GPIO_CFG); GPIO_CFG);
if ((pdata->gpio_setting & GPIO_CFG_LED1_EN_) if ((pdata->gpio_setting & GPIO_CFG_LED1_EN_) &&
&& (!pdata->using_extphy)) { (!pdata->using_extphy)) {
/* Force 10/100 LED off, after saving /* Force 10/100 LED off, after saving
* orginal GPIO configuration */ * orginal GPIO configuration */
pdata->gpio_orig_setting = pdata->gpio_setting; pdata->gpio_orig_setting = pdata->gpio_setting;

Просмотреть файл

@ -1482,8 +1482,8 @@ static int __netdev_rx(struct net_device *dev, int *quota)
printk(KERN_DEBUG " netdev_rx() normal Rx pkt length %d, quota %d.\n", pkt_len, *quota); printk(KERN_DEBUG " netdev_rx() normal Rx pkt length %d, quota %d.\n", pkt_len, *quota);
/* Check if the packet is long enough to accept without copying /* Check if the packet is long enough to accept without copying
to a minimally-sized skbuff. */ to a minimally-sized skbuff. */
if (pkt_len < rx_copybreak if (pkt_len < rx_copybreak &&
&& (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
skb_reserve(skb, 2); /* 16 byte align the IP header */ skb_reserve(skb, 2); /* 16 byte align the IP header */
pci_dma_sync_single_for_cpu(np->pci_dev, pci_dma_sync_single_for_cpu(np->pci_dev,
np->rx_info[entry].mapping, np->rx_info[entry].mapping,
@ -1793,8 +1793,8 @@ static void set_rx_mode(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
rx_mode |= AcceptAll; rx_mode |= AcceptAll;
} else if ((dev->mc_count > multicast_filter_limit) } else if ((dev->mc_count > multicast_filter_limit) ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to match, or accept all multicasts. */ /* Too many to match, or accept all multicasts. */
rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter; rx_mode |= AcceptBroadcast|AcceptAllMulticast|PerfectFilter;
} else if (dev->mc_count <= 14) { } else if (dev->mc_count <= 14) {

Просмотреть файл

@ -922,8 +922,7 @@ static void stmmac_dma_interrupt(struct net_device *dev)
DBG(intr, INFO, "CSR5[15] DMA ABNORMAL IRQ: "); DBG(intr, INFO, "CSR5[15] DMA ABNORMAL IRQ: ");
if (unlikely(intr_status & DMA_STATUS_UNF)) { if (unlikely(intr_status & DMA_STATUS_UNF)) {
DBG(intr, INFO, "transmit underflow\n"); DBG(intr, INFO, "transmit underflow\n");
if (unlikely(tc != SF_DMA_MODE) if (unlikely(tc != SF_DMA_MODE) && (tc <= 256)) {
&& (tc <= 256)) {
/* Try to bump up the threshold */ /* Try to bump up the threshold */
tc += 64; tc += 64;
priv->mac_type->ops->dma_mode(ioaddr, tc, priv->mac_type->ops->dma_mode(ioaddr, tc,

Просмотреть файл

@ -603,8 +603,8 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
strcmp (media[card_idx], "4") == 0) { strcmp (media[card_idx], "4") == 0) {
np->speed = 100; np->speed = 100;
np->mii_if.full_duplex = 1; np->mii_if.full_duplex = 1;
} else if (strcmp (media[card_idx], "100mbps_hd") == 0 } else if (strcmp (media[card_idx], "100mbps_hd") == 0 ||
|| strcmp (media[card_idx], "3") == 0) { strcmp (media[card_idx], "3") == 0) {
np->speed = 100; np->speed = 100;
np->mii_if.full_duplex = 0; np->mii_if.full_duplex = 0;
} else if (strcmp (media[card_idx], "10mbps_fd") == 0 || } else if (strcmp (media[card_idx], "10mbps_fd") == 0 ||
@ -1079,8 +1079,8 @@ start_tx (struct sk_buff *skb, struct net_device *dev)
tasklet_schedule(&np->tx_tasklet); tasklet_schedule(&np->tx_tasklet);
/* On some architectures: explicitly flush cache lines here. */ /* On some architectures: explicitly flush cache lines here. */
if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 if (np->cur_tx - np->dirty_tx < TX_QUEUE_LEN - 1 &&
&& !netif_queue_stopped(dev)) { !netif_queue_stopped(dev)) {
/* do nothing */ /* do nothing */
} else { } else {
netif_stop_queue (dev); netif_stop_queue (dev);
@ -1336,8 +1336,8 @@ static void rx_poll(unsigned long data)
#endif #endif
/* Check if the packet is long enough to accept without copying /* Check if the packet is long enough to accept without copying
to a minimally-sized skbuff. */ to a minimally-sized skbuff. */
if (pkt_len < rx_copybreak if (pkt_len < rx_copybreak &&
&& (skb = dev_alloc_skb(pkt_len + 2)) != NULL) { (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
skb_reserve(skb, 2); /* 16 byte align the IP header */ skb_reserve(skb, 2); /* 16 byte align the IP header */
pci_dma_sync_single_for_cpu(np->pci_dev, pci_dma_sync_single_for_cpu(np->pci_dev,
le32_to_cpu(desc->frag[0].addr), le32_to_cpu(desc->frag[0].addr),
@ -1517,8 +1517,8 @@ static void set_rx_mode(struct net_device *dev)
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
memset(mc_filter, 0xff, sizeof(mc_filter)); memset(mc_filter, 0xff, sizeof(mc_filter));
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys; rx_mode = AcceptBroadcast | AcceptMulticast | AcceptAll | AcceptMyPhys;
} else if ((dev->mc_count > multicast_filter_limit) } else if ((dev->mc_count > multicast_filter_limit) ||
|| (dev->flags & IFF_ALLMULTI)) { (dev->flags & IFF_ALLMULTI)) {
/* Too many to match, or accept all multicasts. */ /* Too many to match, or accept all multicasts. */
memset(mc_filter, 0xff, sizeof(mc_filter)); memset(mc_filter, 0xff, sizeof(mc_filter));
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;

Просмотреть файл

@ -1031,8 +1031,8 @@ struct gem {
#endif #endif
}; };
#define found_mii_phy(gp) ((gp->phy_type == phy_mii_mdio0 || gp->phy_type == phy_mii_mdio1) \ #define found_mii_phy(gp) ((gp->phy_type == phy_mii_mdio0 || gp->phy_type == phy_mii_mdio1) && \
&& gp->phy_mii.def && gp->phy_mii.def->ops) gp->phy_mii.def && gp->phy_mii.def->ops)
#define ALIGNED_RX_SKB_ADDR(addr) \ #define ALIGNED_RX_SKB_ADDR(addr) \
((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr)) ((((unsigned long)(addr) + (64UL - 1UL)) & ~(64UL - 1UL)) - (unsigned long)(addr))

Просмотреть файл

@ -3056,9 +3056,9 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
int len; int len;
if (qfe_slot != -1 && if (qfe_slot != -1 &&
(addr = of_get_property(dp, (addr = of_get_property(dp, "local-mac-address", &len))
"local-mac-address", &len)) != NULL != NULL &&
&& len == 6) { len == 6) {
memcpy(dev->dev_addr, addr, 6); memcpy(dev->dev_addr, addr, 6);
} else { } else {
memcpy(dev->dev_addr, idprom->id_ethaddr, 6); memcpy(dev->dev_addr, idprom->id_ethaddr, 6);

Просмотреть файл

@ -1784,9 +1784,9 @@ static void bdx_tx_cleanup(struct bdx_priv *priv)
} }
#endif #endif
if (unlikely(netif_queue_stopped(priv->ndev) if (unlikely(netif_queue_stopped(priv->ndev) &&
&& netif_carrier_ok(priv->ndev) netif_carrier_ok(priv->ndev) &&
&& (priv->tx_level >= BDX_MIN_TX_LEVEL))) { (priv->tx_level >= BDX_MIN_TX_LEVEL))) {
DBG("%s: %s: TX Q WAKE level %d\n", DBG("%s: %s: TX Q WAKE level %d\n",
BDX_DRV_NAME, priv->ndev->name, priv->tx_level); BDX_DRV_NAME, priv->ndev->name, priv->tx_level);
netif_wake_queue(priv->ndev); netif_wake_queue(priv->ndev);
@ -2273,8 +2273,8 @@ bdx_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ecoal)
(((tx_max_coal * BDX_TXF_DESC_SZ) + PCK_TH_MULT - 1) (((tx_max_coal * BDX_TXF_DESC_SZ) + PCK_TH_MULT - 1)
/ PCK_TH_MULT); / PCK_TH_MULT);
if ((rx_coal > 0x7FFF) || (tx_coal > 0x7FFF) if ((rx_coal > 0x7FFF) || (tx_coal > 0x7FFF) ||
|| (rx_max_coal > 0xF) || (tx_max_coal > 0xF)) (rx_max_coal > 0xF) || (tx_max_coal > 0xF))
return -EINVAL; return -EINVAL;
rdintcm = INT_REG_VAL(rx_coal, GET_INT_COAL_RC(priv->rdintcm), rdintcm = INT_REG_VAL(rx_coal, GET_INT_COAL_RC(priv->rdintcm),
@ -2347,8 +2347,8 @@ bdx_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
tx_size = 3; tx_size = 3;
/*Is there anything to do? */ /*Is there anything to do? */
if ((rx_size == priv->rxf_size) if ((rx_size == priv->rxf_size) &&
&& (tx_size == priv->txd_size)) (tx_size == priv->txd_size))
return 0; return 0;
priv->rxf_size = rx_size; priv->rxf_size = rx_size;

Просмотреть файл

@ -4621,13 +4621,12 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) -
ETH_FCS_LEN; ETH_FCS_LEN;
if (len > RX_COPY_THRESHOLD if (len > RX_COPY_THRESHOLD &&
&& tp->rx_offset == NET_IP_ALIGN tp->rx_offset == NET_IP_ALIGN) {
/* rx_offset will likely not equal NET_IP_ALIGN /* rx_offset will likely not equal NET_IP_ALIGN
* if this is a 5701 card running in PCI-X mode * if this is a 5701 card running in PCI-X mode
* [see tg3_get_invariants()] * [see tg3_get_invariants()]
*/ */
) {
int skb_size; int skb_size;
skb_size = tg3_alloc_rx_skb(tp, tpr, opaque_key, skb_size = tg3_alloc_rx_skb(tp, tpr, opaque_key,

Просмотреть файл

@ -1755,8 +1755,8 @@ static u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int )
! ( tlphy_ctl & TLAN_TC_SWAPOL ) ) { ! ( tlphy_ctl & TLAN_TC_SWAPOL ) ) {
tlphy_ctl |= TLAN_TC_SWAPOL; tlphy_ctl |= TLAN_TC_SWAPOL;
TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tlphy_ctl); TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tlphy_ctl);
} else if ( ( tlphy_sts & TLAN_TS_POLOK ) } else if ( ( tlphy_sts & TLAN_TS_POLOK ) &&
&& ( tlphy_ctl & TLAN_TC_SWAPOL ) ) { ( tlphy_ctl & TLAN_TC_SWAPOL ) ) {
tlphy_ctl &= ~TLAN_TC_SWAPOL; tlphy_ctl &= ~TLAN_TC_SWAPOL;
TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tlphy_ctl); TLan_MiiWriteReg( dev, phy, TLAN_TLPHY_CTL, tlphy_ctl);
} }

Просмотреть файл

@ -712,8 +712,8 @@ static int streamer_open(struct net_device *dev)
strcat(open_error, " - "); strcat(open_error, " - ");
strcat(open_error, open_min_error[(error_code & 0x0f)]); strcat(open_error, open_min_error[(error_code & 0x0f)]);
if (!streamer_priv->streamer_ring_speed if (!streamer_priv->streamer_ring_speed &&
&& ((error_code & 0x0f) == 0x0d)) ((error_code & 0x0f) == 0x0d))
{ {
printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n", dev->name); printk(KERN_WARNING "%s: Tried to autosense ring speed with no monitors present\n", dev->name);
printk(KERN_WARNING "%s: Please try again with a specified ring speed \n", dev->name); printk(KERN_WARNING "%s: Please try again with a specified ring speed \n", dev->name);
@ -1032,8 +1032,8 @@ static irqreturn_t streamer_interrupt(int irq, void *dev_id)
sisr = readw(streamer_mmio + SISR); sisr = readw(streamer_mmio + SISR);
while((sisr & (SISR_MI | SISR_SRB_REPLY | SISR_ADAPTER_CHECK | SISR_ASB_FREE | while((sisr & (SISR_MI | SISR_SRB_REPLY | SISR_ADAPTER_CHECK | SISR_ASB_FREE |
SISR_ARB_CMD | SISR_TRB_REPLY | SISR_PAR_ERR | SISR_SERR_ERR)) SISR_ARB_CMD | SISR_TRB_REPLY | SISR_PAR_ERR | SISR_SERR_ERR)) &&
&& (max_intr > 0)) { (max_intr > 0)) {
if(sisr & SISR_PAR_ERR) { if(sisr & SISR_PAR_ERR) {
writew(~SISR_PAR_ERR, streamer_mmio + SISR_RUM); writew(~SISR_PAR_ERR, streamer_mmio + SISR_RUM);

Просмотреть файл

@ -2309,9 +2309,9 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id)
else else
{ {
if((tp->acb_head->cmd if((tp->acb_head->cmd
== ACB_CMD_READ_TRC_STATUS) == ACB_CMD_READ_TRC_STATUS) &&
&& (tp->acb_head->subcmd (tp->acb_head->subcmd
== RW_TRC_STATUS_BLOCK)) == RW_TRC_STATUS_BLOCK))
{ {
if(tp->ptr_bcn_type) if(tp->ptr_bcn_type)
{ {
@ -2331,8 +2331,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id)
smctr_disable_16bit(dev); smctr_disable_16bit(dev);
err = smctr_ring_status_chg(dev); err = smctr_ring_status_chg(dev);
smctr_enable_16bit(dev); smctr_enable_16bit(dev);
if((tp->ring_status & REMOVE_RECEIVED) if((tp->ring_status & REMOVE_RECEIVED) &&
&& (tp->config_word0 & NO_AUTOREMOVE)) (tp->config_word0 & NO_AUTOREMOVE))
{ {
smctr_issue_remove_cmd(dev); smctr_issue_remove_cmd(dev);
} }
@ -2511,9 +2511,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev)
tp->config_word0 = THDREN | DMA_TRIGGER | USETPT | NO_AUTOREMOVE; tp->config_word0 = THDREN | DMA_TRIGGER | USETPT | NO_AUTOREMOVE;
tp->config_word1 = 0; tp->config_word1 = 0;
if((tp->media_type == MEDIA_STP_16) if((tp->media_type == MEDIA_STP_16) ||
|| (tp->media_type == MEDIA_UTP_16) (tp->media_type == MEDIA_UTP_16) ||
|| (tp->media_type == MEDIA_STP_16_UTP_16)) (tp->media_type == MEDIA_STP_16_UTP_16))
{ {
tp->config_word0 |= FREQ_16MB_BIT; tp->config_word0 |= FREQ_16MB_BIT;
} }
@ -2556,9 +2556,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev)
tp->config_word1 &= ~SOURCE_ROUTING_SPANNING_BITS; tp->config_word1 &= ~SOURCE_ROUTING_SPANNING_BITS;
} }
if((tp->media_type == MEDIA_STP_16) if((tp->media_type == MEDIA_STP_16) ||
|| (tp->media_type == MEDIA_UTP_16) (tp->media_type == MEDIA_UTP_16) ||
|| (tp->media_type == MEDIA_STP_16_UTP_16)) (tp->media_type == MEDIA_STP_16_UTP_16))
{ {
tp->config_word1 |= INTERFRAME_SPACING_16; tp->config_word1 |= INTERFRAME_SPACING_16;
} }
@ -2568,9 +2568,9 @@ static int smctr_issue_init_timers_cmd(struct net_device *dev)
*pTimer_Struc++ = tp->config_word0; *pTimer_Struc++ = tp->config_word0;
*pTimer_Struc++ = tp->config_word1; *pTimer_Struc++ = tp->config_word1;
if((tp->media_type == MEDIA_STP_4) if((tp->media_type == MEDIA_STP_4) ||
|| (tp->media_type == MEDIA_UTP_4) (tp->media_type == MEDIA_UTP_4) ||
|| (tp->media_type == MEDIA_STP_4_UTP_4)) (tp->media_type == MEDIA_STP_4_UTP_4))
{ {
*pTimer_Struc++ = 0x00FA; /* prescale */ *pTimer_Struc++ = 0x00FA; /* prescale */
*pTimer_Struc++ = 0x2710; /* TPT_limit */ *pTimer_Struc++ = 0x2710; /* TPT_limit */
@ -2990,8 +2990,8 @@ static int smctr_load_firmware(struct net_device *dev)
} }
/* Verify the firmware exists and is there in the right amount. */ /* Verify the firmware exists and is there in the right amount. */
if (!fw->data if (!fw->data ||
|| (*(fw->data + UCODE_VERSION_OFFSET) < UCODE_VERSION)) (*(fw->data + UCODE_VERSION_OFFSET) < UCODE_VERSION))
{ {
err = (UCODE_NOT_PRESENT); err = (UCODE_NOT_PRESENT);
goto out; goto out;
@ -3010,9 +3010,8 @@ static int smctr_load_firmware(struct net_device *dev)
smctr_enable_16bit(dev); smctr_enable_16bit(dev);
smctr_set_page(dev, (__u8 *)tp->ram_access); smctr_set_page(dev, (__u8 *)tp->ram_access);
if((smctr_checksum_firmware(dev)) if((smctr_checksum_firmware(dev)) ||
|| (*(fw->data + UCODE_VERSION_OFFSET) (*(fw->data + UCODE_VERSION_OFFSET) > tp->microcode_version))
> tp->microcode_version))
{ {
smctr_enable_adapter_ctrl_store(dev); smctr_enable_adapter_ctrl_store(dev);
@ -3117,9 +3116,9 @@ static int smctr_lobe_media_test(struct net_device *dev)
} }
/* Check if any frames received during test. */ /* Check if any frames received during test. */
if((tp->rx_fcb_curr[MAC_QUEUE]->frame_status) if((tp->rx_fcb_curr[MAC_QUEUE]->frame_status) ||
|| (tp->rx_fcb_curr[NON_MAC_QUEUE]->frame_status)) (tp->rx_fcb_curr[NON_MAC_QUEUE]->frame_status))
goto err; goto err;
/* Set receive mask to "Promisc" mode. */ /* Set receive mask to "Promisc" mode. */
tp->receive_mask = saved_rcv_mask; tp->receive_mask = saved_rcv_mask;
@ -3303,8 +3302,8 @@ static int smctr_make_group_addr(struct net_device *dev, MAC_SUB_VECTOR *tsv)
/* Set Group Address Sub-vector to all zeros if only the /* Set Group Address Sub-vector to all zeros if only the
* Group Address/Functional Address Indicator is set. * Group Address/Functional Address Indicator is set.
*/ */
if(tsv->svv[0] == 0x80 && tsv->svv[1] == 0x00 if(tsv->svv[0] == 0x80 && tsv->svv[1] == 0x00 &&
&& tsv->svv[2] == 0x00 && tsv->svv[3] == 0x00) tsv->svv[2] == 0x00 && tsv->svv[3] == 0x00)
tsv->svv[0] = 0x00; tsv->svv[0] = 0x00;
return (0); return (0);
@ -3876,10 +3875,10 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size,
/* NOTE: UNKNOWN MAC frames will NOT be passed up unless /* NOTE: UNKNOWN MAC frames will NOT be passed up unless
* ACCEPT_ATT_MAC_FRAMES is set. * ACCEPT_ATT_MAC_FRAMES is set.
*/ */
if(((tp->receive_mask & ACCEPT_ATT_MAC_FRAMES) if(((tp->receive_mask & ACCEPT_ATT_MAC_FRAMES) &&
&& (xframe == (__u8)0)) (xframe == (__u8)0)) ||
|| ((tp->receive_mask & ACCEPT_EXT_MAC_FRAMES) ((tp->receive_mask & ACCEPT_EXT_MAC_FRAMES) &&
&& (xframe == (__u8)1))) (xframe == (__u8)1)))
{ {
rmf->vl = SWAP_BYTES(rmf->vl); rmf->vl = SWAP_BYTES(rmf->vl);
@ -3934,8 +3933,8 @@ static int smctr_ram_memory_test(struct net_device *dev)
word_pattern = start_pattern; word_pattern = start_pattern;
for(j = 1; j < (__u32)(tp->ram_usable * 1024) - 1 for(j = 1; j < (__u32)(tp->ram_usable * 1024) - 1 && (~err);
&& (~err); j += 2, word_pattern++) j += 2, word_pattern++)
{ {
word_read = *(__u16 *)(pword + j); word_read = *(__u16 *)(pword + j);
if(word_read != word_pattern) if(word_read != word_pattern)
@ -3959,8 +3958,7 @@ static int smctr_ram_memory_test(struct net_device *dev)
for(j = 0; j < (__u32)tp->ram_usable * 1024; j +=2) for(j = 0; j < (__u32)tp->ram_usable * 1024; j +=2)
*(__u16 *)(pword + j) = word_pattern; *(__u16 *)(pword + j) = word_pattern;
for(j =0; j < (__u32)tp->ram_usable * 1024 for(j =0; j < (__u32)tp->ram_usable * 1024 && (~err); j += 2)
&& (~err); j += 2)
{ {
word_read = *(__u16 *)(pword + j); word_read = *(__u16 *)(pword + j);
if(word_read != word_pattern) if(word_read != word_pattern)
@ -4325,8 +4323,8 @@ static int smctr_restart_tx_chain(struct net_device *dev, short queue)
if(smctr_debug > 10) if(smctr_debug > 10)
printk(KERN_DEBUG "%s: smctr_restart_tx_chain\n", dev->name); printk(KERN_DEBUG "%s: smctr_restart_tx_chain\n", dev->name);
if(tp->num_tx_fcbs_used[queue] != 0 if(tp->num_tx_fcbs_used[queue] != 0 &&
&& tp->tx_queue_status[queue] == NOT_TRANSMITING) tp->tx_queue_status[queue] == NOT_TRANSMITING)
{ {
tp->tx_queue_status[queue] = TRANSMITING; tp->tx_queue_status[queue] = TRANSMITING;
err = smctr_issue_resume_tx_fcb_cmd(dev, queue); err = smctr_issue_resume_tx_fcb_cmd(dev, queue);
@ -4349,8 +4347,8 @@ static int smctr_ring_status_chg(struct net_device *dev)
*/ */
if(tp->ring_status_flags == MONITOR_STATE_CHANGED) if(tp->ring_status_flags == MONITOR_STATE_CHANGED)
{ {
if((tp->monitor_state == MS_ACTIVE_MONITOR_STATE) if((tp->monitor_state == MS_ACTIVE_MONITOR_STATE) ||
|| (tp->monitor_state == MS_STANDBY_MONITOR_STATE)) (tp->monitor_state == MS_STANDBY_MONITOR_STATE))
{ {
tp->monitor_state_ready = 1; tp->monitor_state_ready = 1;
} }
@ -4363,8 +4361,8 @@ static int smctr_ring_status_chg(struct net_device *dev)
tp->monitor_state_ready = 0; tp->monitor_state_ready = 0;
/* Ring speed problem, switching to auto mode. */ /* Ring speed problem, switching to auto mode. */
if(tp->monitor_state == MS_MONITOR_FSM_INACTIVE if(tp->monitor_state == MS_MONITOR_FSM_INACTIVE &&
&& !tp->cleanup) !tp->cleanup)
{ {
printk(KERN_INFO "%s: Incorrect ring speed switching.\n", printk(KERN_INFO "%s: Incorrect ring speed switching.\n",
dev->name); dev->name);
@ -4442,8 +4440,8 @@ static int smctr_rx_frame(struct net_device *dev)
{ {
err = HARDWARE_FAILED; err = HARDWARE_FAILED;
if(((status & 0x007f) == 0) if(((status & 0x007f) == 0) ||
|| ((tp->receive_mask & ACCEPT_ERR_PACKETS) != 0)) ((tp->receive_mask & ACCEPT_ERR_PACKETS) != 0))
{ {
/* frame length less the CRC (4 bytes) + FS (1 byte) */ /* frame length less the CRC (4 bytes) + FS (1 byte) */
rx_size = tp->rx_fcb_curr[queue]->frame_length - 5; rx_size = tp->rx_fcb_curr[queue]->frame_length - 5;
@ -4538,8 +4536,8 @@ static int smctr_send_dat(struct net_device *dev)
} }
/* Check if GOOD frame Tx'ed. */ /* Check if GOOD frame Tx'ed. */
if(!(fcb->frame_status & FCB_COMMAND_DONE) if(!(fcb->frame_status & FCB_COMMAND_DONE) ||
|| fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS))
{ {
return (INITIALIZE_FAILED); return (INITIALIZE_FAILED);
} }
@ -4653,8 +4651,8 @@ static int smctr_send_lobe_media_test(struct net_device *dev)
} }
/* Check if GOOD frame Tx'ed */ /* Check if GOOD frame Tx'ed */
if(!(fcb->frame_status & FCB_COMMAND_DONE) if(!(fcb->frame_status & FCB_COMMAND_DONE) ||
|| fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS)) fcb->frame_status & (FCB_TX_STATUS_E | FCB_TX_AC_BITS))
{ {
return (LOBE_MEDIA_TEST_FAILED); return (LOBE_MEDIA_TEST_FAILED);
} }

Просмотреть файл

@ -729,8 +729,8 @@ static void tms380tr_timer_chk(unsigned long data)
return; return;
tms380tr_chk_outstanding_cmds(dev); tms380tr_chk_outstanding_cmds(dev);
if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies) if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies) &&
&& (tp->TplFree != tp->TplBusy)) (tp->TplFree != tp->TplBusy))
{ {
/* Anything to send, but stalled too long */ /* Anything to send, but stalled too long */
tp->LastSendTime = jiffies; tp->LastSendTime = jiffies;
@ -830,8 +830,8 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id)
} }
/* Reset system interrupt if not already done. */ /* Reset system interrupt if not already done. */
if(irq_type != STS_IRQ_TRANSMIT_STATUS if(irq_type != STS_IRQ_TRANSMIT_STATUS &&
&& irq_type != STS_IRQ_RECEIVE_STATUS) { irq_type != STS_IRQ_RECEIVE_STATUS) {
tms380tr_reset_interrupt(dev); tms380tr_reset_interrupt(dev);
} }
@ -895,10 +895,10 @@ static unsigned char tms380tr_chk_ssb(struct net_local *tp, unsigned short IrqTy
/* Check if this interrupt does use the SSB. */ /* Check if this interrupt does use the SSB. */
if(IrqType != STS_IRQ_TRANSMIT_STATUS if(IrqType != STS_IRQ_TRANSMIT_STATUS &&
&& IrqType != STS_IRQ_RECEIVE_STATUS IrqType != STS_IRQ_RECEIVE_STATUS &&
&& IrqType != STS_IRQ_COMMAND_STATUS IrqType != STS_IRQ_COMMAND_STATUS &&
&& IrqType != STS_IRQ_RING_STATUS) IrqType != STS_IRQ_RING_STATUS)
{ {
return (1); /* SSB not involved. */ return (1); /* SSB not involved. */
} }
@ -1485,8 +1485,8 @@ static int tms380tr_init_adapter(struct net_device *dev)
/* Mask interesting status bits */ /* Mask interesting status bits */
Status = SIFREADW(SIFSTS); Status = SIFREADW(SIFSTS);
Status &= STS_MASK; Status &= STS_MASK;
} while(((Status &(STS_INITIALIZE | STS_ERROR | STS_TEST)) != 0) } while(((Status &(STS_INITIALIZE | STS_ERROR | STS_TEST)) != 0) &&
&& ((Status & STS_ERROR) == 0) && (loop_cnt != 0)); ((Status & STS_ERROR) == 0) && (loop_cnt != 0));
if((Status & (STS_INITIALIZE | STS_ERROR | STS_TEST)) == 0) if((Status & (STS_INITIALIZE | STS_ERROR | STS_TEST)) == 0)
{ {
@ -2183,8 +2183,8 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
} }
} }
if(skb && (rpl->SkbStat == SKB_DATA_COPY if(skb && (rpl->SkbStat == SKB_DATA_COPY ||
|| rpl->SkbStat == SKB_DMA_DIRECT)) rpl->SkbStat == SKB_DMA_DIRECT))
{ {
if(rpl->SkbStat == SKB_DATA_COPY) if(rpl->SkbStat == SKB_DATA_COPY)
skb_copy_to_linear_data(skb, ReceiveDataPtr, skb_copy_to_linear_data(skb, ReceiveDataPtr,

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше