Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Jan 18, 2006
2 parents 8f28afa + 3860288 commit 15578ee
Show file tree
Hide file tree
Showing 37 changed files with 543 additions and 565 deletions.
4 changes: 2 additions & 2 deletions drivers/net/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -1925,8 +1925,8 @@ static void cas_tx(struct net_device *dev, struct cas *cp,
u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
#endif
if (netif_msg_intr(cp))
printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
cp->dev->name, status, compwb);
printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %llx\n",
cp->dev->name, status, (unsigned long long)compwb);
/* process all the rings */
for (ring = 0; ring < N_TX_RINGS; ring++) {
#ifdef USE_TX_COMPWB
Expand Down
82 changes: 54 additions & 28 deletions drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@

#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.47"
#define DRV_MODULE_RELDATE "Dec 28, 2005"
#define DRV_MODULE_VERSION "3.48"
#define DRV_MODULE_RELDATE "Jan 16, 2006"

#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
Expand Down Expand Up @@ -1325,10 +1325,12 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
val &= ~((1 << 16) | (1 << 4) | (1 << 2) | (1 << 1) | 1);
tw32(0x7d00, val);
if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
tg3_nvram_lock(tp);
int err;

err = tg3_nvram_lock(tp);
tg3_halt_cpu(tp, RX_CPU_BASE);
tw32_f(NVRAM_SWARB, SWARB_REQ_CLR0);
tg3_nvram_unlock(tp);
if (!err)
tg3_nvram_unlock(tp);
}
}

Expand Down Expand Up @@ -4193,23 +4195,32 @@ static int tg3_nvram_lock(struct tg3 *tp)
if (tp->tg3_flags & TG3_FLAG_NVRAM) {
int i;

tw32(NVRAM_SWARB, SWARB_REQ_SET1);
for (i = 0; i < 8000; i++) {
if (tr32(NVRAM_SWARB) & SWARB_GNT1)
break;
udelay(20);
if (tp->nvram_lock_cnt == 0) {
tw32(NVRAM_SWARB, SWARB_REQ_SET1);
for (i = 0; i < 8000; i++) {
if (tr32(NVRAM_SWARB) & SWARB_GNT1)
break;
udelay(20);
}
if (i == 8000) {
tw32(NVRAM_SWARB, SWARB_REQ_CLR1);
return -ENODEV;
}
}
if (i == 8000)
return -ENODEV;
tp->nvram_lock_cnt++;
}
return 0;
}

/* tp->lock is held. */
static void tg3_nvram_unlock(struct tg3 *tp)
{
if (tp->tg3_flags & TG3_FLAG_NVRAM)
tw32_f(NVRAM_SWARB, SWARB_REQ_CLR1);
if (tp->tg3_flags & TG3_FLAG_NVRAM) {
if (tp->nvram_lock_cnt > 0)
tp->nvram_lock_cnt--;
if (tp->nvram_lock_cnt == 0)
tw32_f(NVRAM_SWARB, SWARB_REQ_CLR1);
}
}

/* tp->lock is held. */
Expand Down Expand Up @@ -4320,8 +4331,13 @@ static int tg3_chip_reset(struct tg3 *tp)
void (*write_op)(struct tg3 *, u32, u32);
int i;

if (!(tp->tg3_flags2 & TG3_FLG2_SUN_570X))
if (!(tp->tg3_flags2 & TG3_FLG2_SUN_570X)) {
tg3_nvram_lock(tp);
/* No matching tg3_nvram_unlock() after this because
* chip reset below will undo the nvram lock.
*/
tp->nvram_lock_cnt = 0;
}

/*
* We must avoid the readl() that normally takes place.
Expand Down Expand Up @@ -4717,6 +4733,10 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
(offset == RX_CPU_BASE ? "RX" : "TX"));
return -ENODEV;
}

/* Clear firmware's nvram arbitration. */
if (tp->tg3_flags & TG3_FLAG_NVRAM)
tw32(NVRAM_SWARB, SWARB_REQ_CLR0);
return 0;
}

Expand All @@ -4736,7 +4756,7 @@ struct fw_info {
static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_base,
int cpu_scratch_size, struct fw_info *info)
{
int err, i;
int err, lock_err, i;
void (*write_op)(struct tg3 *, u32, u32);

if (cpu_base == TX_CPU_BASE &&
Expand All @@ -4755,9 +4775,10 @@ static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_b
/* It is possible that bootcode is still loading at this point.
* Get the nvram lock first before halting the cpu.
*/
tg3_nvram_lock(tp);
lock_err = tg3_nvram_lock(tp);
err = tg3_halt_cpu(tp, cpu_base);
tg3_nvram_unlock(tp);
if (!lock_err)
tg3_nvram_unlock(tp);
if (err)
goto out;

Expand Down Expand Up @@ -8182,7 +8203,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
data[1] = 1;
}
if (etest->flags & ETH_TEST_FL_OFFLINE) {
int irq_sync = 0;
int err, irq_sync = 0;

if (netif_running(dev)) {
tg3_netif_stop(tp);
Expand All @@ -8192,11 +8213,12 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
tg3_full_lock(tp, irq_sync);

tg3_halt(tp, RESET_KIND_SUSPEND, 1);
tg3_nvram_lock(tp);
err = tg3_nvram_lock(tp);
tg3_halt_cpu(tp, RX_CPU_BASE);
if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
tg3_halt_cpu(tp, TX_CPU_BASE);
tg3_nvram_unlock(tp);
if (!err)
tg3_nvram_unlock(tp);

if (tg3_test_registers(tp) != 0) {
etest->flags |= ETH_TEST_FL_FAILED;
Expand Down Expand Up @@ -8588,7 +8610,11 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) {
tp->tg3_flags |= TG3_FLAG_NVRAM;

tg3_nvram_lock(tp);
if (tg3_nvram_lock(tp)) {
printk(KERN_WARNING PFX "%s: Cannot get nvarm lock, "
"tg3_nvram_init failed.\n", tp->dev->name);
return;
}
tg3_enable_nvram_access(tp);

if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752)
Expand Down Expand Up @@ -8686,7 +8712,9 @@ static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val)
if (offset > NVRAM_ADDR_MSK)
return -EINVAL;

tg3_nvram_lock(tp);
ret = tg3_nvram_lock(tp);
if (ret)
return ret;

tg3_enable_nvram_access(tp);

Expand Down Expand Up @@ -8785,10 +8813,6 @@ static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len,

offset = offset + (pagesize - page_off);

/* Nvram lock released by tg3_nvram_read() above,
* so need to get it again.
*/
tg3_nvram_lock(tp);
tg3_enable_nvram_access(tp);

/*
Expand Down Expand Up @@ -8925,7 +8949,9 @@ static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf)
else {
u32 grc_mode;

tg3_nvram_lock(tp);
ret = tg3_nvram_lock(tp);
if (ret)
return ret;

tg3_enable_nvram_access(tp);
if ((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) &&
Expand Down
1 change: 1 addition & 0 deletions drivers/net/tg3.h
Original file line number Diff line number Diff line change
Expand Up @@ -2275,6 +2275,7 @@ struct tg3 {
dma_addr_t stats_mapping;
struct work_struct reset_task;

int nvram_lock_cnt;
u32 nvram_size;
u32 nvram_pagesize;
u32 nvram_jedecnum;
Expand Down
1 change: 1 addition & 0 deletions include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ extern void dump_stack(void);
ntohs((addr).s6_addr16[6]), \
ntohs((addr).s6_addr16[7])
#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
#define NIP6_SEQFMT "%04x%04x%04x%04x%04x%04x%04x%04x"

#if defined(__LITTLE_ENDIAN)
#define HIPQUAD(addr) \
Expand Down
9 changes: 0 additions & 9 deletions include/linux/netfilter_ipv6/ip6t_ah.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,4 @@ struct ip6t_ah
#define IP6T_AH_INV_LEN 0x02 /* Invert the sense of length. */
#define IP6T_AH_INV_MASK 0x03 /* All possible flags. */

#define MASK_HOPOPTS 128
#define MASK_DSTOPTS 64
#define MASK_ROUTING 32
#define MASK_FRAGMENT 16
#define MASK_AH 8
#define MASK_ESP 4
#define MASK_NONE 2
#define MASK_PROTO 1

#endif /*_IP6T_AH_H*/
9 changes: 0 additions & 9 deletions include/linux/netfilter_ipv6/ip6t_esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ struct ip6t_esp
u_int8_t invflags; /* Inverse flags */
};

#define MASK_HOPOPTS 128
#define MASK_DSTOPTS 64
#define MASK_ROUTING 32
#define MASK_FRAGMENT 16
#define MASK_AH 8
#define MASK_ESP 4
#define MASK_NONE 2
#define MASK_PROTO 1

/* Values for "invflags" field in struct ip6t_esp. */
#define IP6T_ESP_INV_SPI 0x01 /* Invert the sense of spi. */
#define IP6T_ESP_INV_MASK 0x01 /* All possible flags. */
Expand Down
9 changes: 0 additions & 9 deletions include/linux/netfilter_ipv6/ip6t_frag.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,4 @@ struct ip6t_frag
#define IP6T_FRAG_INV_LEN 0x02 /* Invert the sense of length. */
#define IP6T_FRAG_INV_MASK 0x03 /* All possible flags. */

#define MASK_HOPOPTS 128
#define MASK_DSTOPTS 64
#define MASK_ROUTING 32
#define MASK_FRAGMENT 16
#define MASK_AH 8
#define MASK_ESP 4
#define MASK_NONE 2
#define MASK_PROTO 1

#endif /*_IP6T_FRAG_H*/
9 changes: 0 additions & 9 deletions include/linux/netfilter_ipv6/ip6t_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,4 @@ struct ip6t_opts
#define IP6T_OPTS_INV_LEN 0x01 /* Invert the sense of length. */
#define IP6T_OPTS_INV_MASK 0x01 /* All possible flags. */

#define MASK_HOPOPTS 128
#define MASK_DSTOPTS 64
#define MASK_ROUTING 32
#define MASK_FRAGMENT 16
#define MASK_AH 8
#define MASK_ESP 4
#define MASK_NONE 2
#define MASK_PROTO 1

#endif /*_IP6T_OPTS_H*/
9 changes: 0 additions & 9 deletions include/linux/netfilter_ipv6/ip6t_rt.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,4 @@ struct ip6t_rt
#define IP6T_RT_INV_LEN 0x04 /* Invert the sense of length. */
#define IP6T_RT_INV_MASK 0x07 /* All possible flags. */

#define MASK_HOPOPTS 128
#define MASK_DSTOPTS 64
#define MASK_ROUTING 32
#define MASK_FRAGMENT 16
#define MASK_AH 8
#define MASK_ESP 4
#define MASK_NONE 2
#define MASK_PROTO 1

#endif /*_IP6T_RT_H*/
2 changes: 1 addition & 1 deletion include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ static inline int skb_tailroom(const struct sk_buff *skb)
* Increase the headroom of an empty &sk_buff by reducing the tail
* room. This is only allowed for an empty buffer.
*/
static inline void skb_reserve(struct sk_buff *skb, unsigned int len)
static inline void skb_reserve(struct sk_buff *skb, int len)
{
skb->data += len;
skb->tail += len;
Expand Down
4 changes: 3 additions & 1 deletion net/bridge/netfilter/ebt_ip.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ static int ebt_ip_check(const char *tablename, unsigned int hookmask,
if (info->invflags & EBT_IP_PROTO)
return -EINVAL;
if (info->protocol != IPPROTO_TCP &&
info->protocol != IPPROTO_UDP)
info->protocol != IPPROTO_UDP &&
info->protocol != IPPROTO_SCTP &&
info->protocol != IPPROTO_DCCP)
return -EINVAL;
}
if (info->bitmask & EBT_IP_DPORT && info->dport[0] > info->dport[1])
Expand Down
4 changes: 3 additions & 1 deletion net/bridge/netfilter/ebt_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ ebt_log_packet(unsigned int pf, unsigned int hooknum,
"tos=0x%02X, IP proto=%d", NIPQUAD(ih->saddr),
NIPQUAD(ih->daddr), ih->tos, ih->protocol);
if (ih->protocol == IPPROTO_TCP ||
ih->protocol == IPPROTO_UDP) {
ih->protocol == IPPROTO_UDP ||
ih->protocol == IPPROTO_SCTP ||
ih->protocol == IPPROTO_DCCP) {
struct tcpudphdr _ports, *pptr;

pptr = skb_header_pointer(skb, ih->ihl*4,
Expand Down
13 changes: 6 additions & 7 deletions net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ static inline void *load_pointer(struct sk_buff *skb, int k,
* filtering, filter is the array of filter instructions, and
* len is the number of filter blocks in the array.
*/

unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
{
struct sock_filter *fentry; /* We walk down these */
Expand Down Expand Up @@ -175,7 +174,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
continue;
case BPF_LD|BPF_W|BPF_ABS:
k = fentry->k;
load_w:
load_w:
ptr = load_pointer(skb, k, 4, &tmp);
if (ptr != NULL) {
A = ntohl(*(u32 *)ptr);
Expand All @@ -184,7 +183,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
break;
case BPF_LD|BPF_H|BPF_ABS:
k = fentry->k;
load_h:
load_h:
ptr = load_pointer(skb, k, 2, &tmp);
if (ptr != NULL) {
A = ntohs(*(u16 *)ptr);
Expand Down Expand Up @@ -374,7 +373,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
case BPF_JMP|BPF_JSET|BPF_K:
case BPF_JMP|BPF_JSET|BPF_X:
/* for conditionals both must be safe */
if (pc + ftest->jt + 1 >= flen ||
if (pc + ftest->jt + 1 >= flen ||
pc + ftest->jf + 1 >= flen)
return -EINVAL;
break;
Expand All @@ -384,7 +383,7 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
}
}

return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
}

/**
Expand All @@ -404,8 +403,8 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk)
int err;

/* Make sure new filter is there and in the right amounts. */
if (fprog->filter == NULL)
return -EINVAL;
if (fprog->filter == NULL)
return -EINVAL;

fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL);
if (!fp)
Expand Down
2 changes: 1 addition & 1 deletion net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ int netpoll_setup(struct netpoll *np)
}
}

if (!memcmp(np->local_mac, "\0\0\0\0\0\0", 6) && ndev->dev_addr)
if (is_zero_ether_addr(np->local_mac) && ndev->dev_addr)
memcpy(np->local_mac, ndev->dev_addr, 6);

if (!np->local_ip) {
Expand Down
Loading

0 comments on commit 15578ee

Please sign in to comment.