Commit eafd6020 authored by Steve French's avatar Steve French

Merge bk://linux.bkbits.net/linux-2.5

into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
parents 35ae52a5 f6967f9a
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include <asm/page.h> #include <asm/page.h>
#include "irq_vectors.h" #include "irq_vectors.h"
#define nr_syscalls ((syscall_table_size)/4)
EBX = 0x00 EBX = 0x00
ECX = 0x04 ECX = 0x04
EDX = 0x08 EDX = 0x08
...@@ -881,4 +883,4 @@ ENTRY(sys_call_table) ...@@ -881,4 +883,4 @@ ENTRY(sys_call_table)
.long sys_fadvise64_64 .long sys_fadvise64_64
.long sys_ni_syscall /* sys_vserver */ .long sys_ni_syscall /* sys_vserver */
nr_syscalls=(.-sys_call_table)/4 syscall_table_size=(.-sys_call_table)
...@@ -327,152 +327,30 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, ...@@ -327,152 +327,30 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq,
#define PIRQ_SIS_IRQ_DISABLE 0x80 #define PIRQ_SIS_IRQ_DISABLE 0x80
#define PIRQ_SIS_USB_ENABLE 0x40 #define PIRQ_SIS_USB_ENABLE 0x40
/* return value: static int pirq_sis_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
* -1 on error
* 0 for PCI INTA-INTD
* 0 or enable bit mask to check or set for onchip functions
*/
static inline int pirq_sis5595_onchip(int pirq, int *reg)
{
int ret = -1;
*reg = pirq;
switch(pirq) {
case 0x01:
case 0x02:
case 0x03:
case 0x04:
*reg += 0x40;
case 0x41:
case 0x42:
case 0x43:
case 0x44:
ret = 0;
break;
case 0x62:
ret = PIRQ_SIS_USB_ENABLE; /* documented for 5595 */
break;
case 0x61:
case 0x6a:
case 0x7e:
printk(KERN_INFO "SiS pirq: IDE/ACPI/DAQ mapping not implemented: (%u)\n",
(unsigned) pirq);
/* fall thru */
default:
printk(KERN_INFO "SiS router unknown request: (%u)\n",
(unsigned) pirq);
break;
}
return ret;
}
/* return value:
* -1 on error
* 0 for PCI INTA-INTD
* 0 or enable bit mask to check or set for onchip functions
*/
static inline int pirq_sis96x_onchip(int pirq, int *reg)
{
int ret = -1;
*reg = pirq;
switch(pirq) {
case 0x01:
case 0x02:
case 0x03:
case 0x04:
*reg += 0x40;
case 0x41:
case 0x42:
case 0x43:
case 0x44:
case 0x60:
case 0x61:
case 0x62:
case 0x63:
ret = 0;
break;
default:
printk(KERN_INFO "SiS router unknown request: (%u)\n",
(unsigned) pirq);
break;
}
return ret;
}
static int pirq_sis5595_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
{ {
u8 x; u8 x;
int reg, check; int reg;
check = pirq_sis5595_onchip(pirq, &reg);
if (check < 0)
return 0;
reg = pirq;
if (reg >= 0x01 && reg <= 0x04)
reg += 0x40;
pci_read_config_byte(router, reg, &x); pci_read_config_byte(router, reg, &x);
if (check != 0 && !(x & check))
return 0;
return (x & PIRQ_SIS_IRQ_DISABLE) ? 0 : (x & PIRQ_SIS_IRQ_MASK); return (x & PIRQ_SIS_IRQ_DISABLE) ? 0 : (x & PIRQ_SIS_IRQ_MASK);
} }
static int pirq_sis96x_get(struct pci_dev *router, struct pci_dev *dev, int pirq) static int pirq_sis_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
{ {
u8 x; u8 x;
int reg, check; int reg;
check = pirq_sis96x_onchip(pirq, &reg);
if (check < 0)
return 0;
reg = pirq;
if (reg >= 0x01 && reg <= 0x04)
reg += 0x40;
pci_read_config_byte(router, reg, &x); pci_read_config_byte(router, reg, &x);
if (check != 0 && !(x & check)) x &= ~(PIRQ_SIS_IRQ_MASK | PIRQ_SIS_IRQ_DISABLE);
return 0; x |= irq ? irq: PIRQ_SIS_IRQ_DISABLE;
return (x & PIRQ_SIS_IRQ_DISABLE) ? 0 : (x & PIRQ_SIS_IRQ_MASK);
}
static int pirq_sis5595_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
{
u8 x;
int reg, set;
set = pirq_sis5595_onchip(pirq, &reg);
if (set < 0)
return 0;
x = (irq & PIRQ_SIS_IRQ_MASK);
if (x == 0)
x = PIRQ_SIS_IRQ_DISABLE;
else
x |= set;
pci_write_config_byte(router, reg, x);
return 1;
}
static int pirq_sis96x_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
{
u8 x;
int reg, set;
set = pirq_sis96x_onchip(pirq, &reg);
if (set < 0)
return 0;
x = (irq & PIRQ_SIS_IRQ_MASK);
if (x == 0)
x = PIRQ_SIS_IRQ_DISABLE;
else
x |= set;
pci_write_config_byte(router, reg, x); pci_write_config_byte(router, reg, x);
return 1; return 1;
} }
...@@ -657,26 +535,11 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, ...@@ -657,26 +535,11 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router,
if (device != PCI_DEVICE_ID_SI_503) if (device != PCI_DEVICE_ID_SI_503)
return 0; return 0;
/* r->name = "SIS";
* In case of SiS south bridge, we need to detect the two r->get = pirq_sis_get;
* kinds of routing tables we have seen so far (5595 and 96x). r->set = pirq_sis_set;
* DBG("PCI: Detecting SiS router at %02x:%02x\n",
* The 96x tends to still come with routing tables that claim rt->rtr_bus, rt->rtr_devfn);
* to be 503's.. Silly thing. Check the actual router chip.
*/
if ((router->device & 0xfff0) == 0x0960) {
r->name = "SIS96x";
r->get = pirq_sis96x_get;
r->set = pirq_sis96x_set;
DBG("PCI: Detecting SiS router at %02x:%02x : SiS096x detected\n",
rt->rtr_bus, rt->rtr_devfn);
} else {
r->name = "SIS5595";
r->get = pirq_sis5595_get;
r->set = pirq_sis5595_set;
DBG("PCI: Detecting SiS router at %02x:%02x : SiS5595 detected\n",
rt->rtr_bus, rt->rtr_devfn);
}
return 1; return 1;
} }
......
...@@ -776,23 +776,28 @@ static void pci_do_gettimeofday(struct timeval *tv) ...@@ -776,23 +776,28 @@ static void pci_do_gettimeofday(struct timeval *tv)
unsigned long flags; unsigned long flags;
unsigned long seq; unsigned long seq;
unsigned long usec, sec; unsigned long usec, sec;
unsigned long max_ntp_tick = tick_usec - tickadj;
do { do {
unsigned long lost;
seq = read_seqbegin_irqsave(&xtime_lock, flags); seq = read_seqbegin_irqsave(&xtime_lock, flags);
usec = do_gettimeoffset(); usec = do_gettimeoffset();
{ lost = jiffies - wall_jiffies;
unsigned long lost = jiffies - wall_jiffies;
if (lost)
usec += lost * (1000000 / HZ);
}
/* /*
* If time_adjust is negative then NTP is slowing the clock * If time_adjust is negative then NTP is slowing the clock
* so make sure not to go into next possible interval. * so make sure not to go into next possible interval.
* Better to lose some accuracy than have time go backwards.. * Better to lose some accuracy than have time go backwards..
*/ */
if (unlikely(time_adjust < 0) && usec > tickadj) if (unlikely(time_adjust < 0)) {
usec = tickadj; usec = min(usec, max_ntp_tick);
if (lost)
usec += lost * max_ntp_tick;
}
else if (unlikely(lost))
usec += lost * tick_usec;
sec = xtime.tv_sec; sec = xtime.tv_sec;
usec += (xtime.tv_nsec / 1000); usec += (xtime.tv_nsec / 1000);
......
...@@ -288,6 +288,10 @@ EXPORT_SYMBOL(__strncpy_from_user); ...@@ -288,6 +288,10 @@ EXPORT_SYMBOL(__strncpy_from_user);
/* Networking helper routines. */ /* Networking helper routines. */
/* XXX This is NOVERS because C_LABEL_STR doesn't get the version number. -DaveM */ /* XXX This is NOVERS because C_LABEL_STR doesn't get the version number. -DaveM */
EXPORT_SYMBOL_NOVERS(__csum_partial_copy_sparc_generic); EXPORT_SYMBOL_NOVERS(__csum_partial_copy_sparc_generic);
EXPORT_SYMBOL(csum_partial);
/* Cache flushing. */
EXPORT_SYMBOL(sparc_flush_page_to_ram);
/* No version information on this, heavily used in inline asm, /* No version information on this, heavily used in inline asm,
* and will always be 'void __ret_efault(void)'. * and will always be 'void __ret_efault(void)'.
......
...@@ -481,23 +481,28 @@ void do_gettimeofday(struct timeval *tv) ...@@ -481,23 +481,28 @@ void do_gettimeofday(struct timeval *tv)
unsigned long flags; unsigned long flags;
unsigned long seq; unsigned long seq;
unsigned long usec, sec; unsigned long usec, sec;
unsigned long max_ntp_tick = tick_usec - tickadj;
do { do {
unsigned long lost;
seq = read_seqbegin_irqsave(&xtime_lock, flags); seq = read_seqbegin_irqsave(&xtime_lock, flags);
usec = do_gettimeoffset(); usec = do_gettimeoffset();
{ lost = jiffies - wall_jiffies;
unsigned long lost = jiffies - wall_jiffies;
if (lost)
usec += lost * (1000000 / HZ);
}
/* /*
* If time_adjust is negative then NTP is slowing the clock * If time_adjust is negative then NTP is slowing the clock
* so make sure not to go into next possible interval. * so make sure not to go into next possible interval.
* Better to lose some accuracy than have time go backwards.. * Better to lose some accuracy than have time go backwards..
*/ */
if (unlikely(time_adjust < 0) && usec > tickadj) if (unlikely(time_adjust < 0)) {
usec = tickadj; usec = min(usec, max_ntp_tick);
if (lost)
usec += lost * max_ntp_tick;
}
else if (unlikely(lost))
usec += lost * tick_usec;
sec = xtime.tv_sec; sec = xtime.tv_sec;
usec += (xtime.tv_nsec / 1000); usec += (xtime.tv_nsec / 1000);
......
...@@ -58,12 +58,16 @@ ...@@ -58,12 +58,16 @@
#define EBUS_DMA_RESET_TIMEOUT 10000 #define EBUS_DMA_RESET_TIMEOUT 10000
static void __ebus_dma_reset(struct ebus_dma_info *p) static void __ebus_dma_reset(struct ebus_dma_info *p, int no_drain)
{ {
int i; int i;
u32 val = 0; u32 val = 0;
writel(EBDMA_CSR_RESET, p->regs + EBDMA_CSR); writel(EBDMA_CSR_RESET, p->regs + EBDMA_CSR);
udelay(1);
if (no_drain)
return;
for (i = EBUS_DMA_RESET_TIMEOUT; i > 0; i--) { for (i = EBUS_DMA_RESET_TIMEOUT; i > 0; i--) {
val = readl(p->regs + EBDMA_CSR); val = readl(p->regs + EBDMA_CSR);
...@@ -78,7 +82,7 @@ static irqreturn_t ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -78,7 +82,7 @@ static irqreturn_t ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct ebus_dma_info *p = dev_id; struct ebus_dma_info *p = dev_id;
unsigned long flags; unsigned long flags;
u32 csr; u32 csr = 0;
spin_lock_irqsave(&p->lock, flags); spin_lock_irqsave(&p->lock, flags);
csr = readl(p->regs + EBDMA_CSR); csr = readl(p->regs + EBDMA_CSR);
...@@ -98,20 +102,31 @@ static irqreturn_t ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -98,20 +102,31 @@ static irqreturn_t ebus_dma_irq(int irq, void *dev_id, struct pt_regs *regs)
} }
return IRQ_NONE; return IRQ_NONE;
} }
int ebus_dma_register(struct ebus_dma_info *p) int ebus_dma_register(struct ebus_dma_info *p)
{ {
u32 csr;
if (!p->regs) if (!p->regs)
return -EINVAL; return -EINVAL;
if (p->flags & ~(EBUS_DMA_FLAG_USE_EBDMA_HANDLER)) if (p->flags & ~(EBUS_DMA_FLAG_USE_EBDMA_HANDLER |
EBUS_DMA_FLAG_TCI_DISABLE))
return -EINVAL; return -EINVAL;
if ((p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) && !p->callback) if ((p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) && !p->callback)
return -EINVAL; return -EINVAL;
if (!strlen(p->name)) if (!strlen(p->name))
return -EINVAL; return -EINVAL;
__ebus_dma_reset(p); __ebus_dma_reset(p, 1);
csr = EBDMA_CSR_BURST_SZ_16 | EBDMA_CSR_EN_CNT;
if (p->flags & EBUS_DMA_FLAG_TCI_DISABLE)
csr |= EBDMA_CSR_TCI_DIS;
writel(csr, p->regs + EBDMA_CSR);
return 0; return 0;
} }
...@@ -201,14 +216,23 @@ EXPORT_SYMBOL(ebus_dma_request); ...@@ -201,14 +216,23 @@ EXPORT_SYMBOL(ebus_dma_request);
void ebus_dma_prepare(struct ebus_dma_info *p, int write) void ebus_dma_prepare(struct ebus_dma_info *p, int write)
{ {
unsigned long flags; unsigned long flags;
u32 csr;
spin_lock_irqsave(&p->lock, flags); spin_lock_irqsave(&p->lock, flags);
__ebus_dma_reset(p); __ebus_dma_reset(p, 0);
writel(EBDMA_CSR_INT_EN |
((write) ? EBDMA_CSR_WRITE : 0) | csr = (EBDMA_CSR_INT_EN |
EBDMA_CSR_EN_CNT | EBDMA_CSR_EN_CNT |
EBDMA_CSR_BURST_SZ_16 | EBDMA_CSR_BURST_SZ_16 |
EBDMA_CSR_EN_NEXT, p->regs + EBDMA_CSR); EBDMA_CSR_EN_NEXT);
if (write)
csr |= EBDMA_CSR_WRITE;
if (p->flags & EBUS_DMA_FLAG_TCI_DISABLE)
csr |= EBDMA_CSR_TCI_DIS;
writel(csr, p->regs + EBDMA_CSR);
spin_unlock_irqrestore(&p->lock, flags); spin_unlock_irqrestore(&p->lock, flags);
} }
EXPORT_SYMBOL(ebus_dma_prepare); EXPORT_SYMBOL(ebus_dma_prepare);
...@@ -228,15 +252,17 @@ EXPORT_SYMBOL(ebus_dma_addr); ...@@ -228,15 +252,17 @@ EXPORT_SYMBOL(ebus_dma_addr);
void ebus_dma_enable(struct ebus_dma_info *p, int on) void ebus_dma_enable(struct ebus_dma_info *p, int on)
{ {
unsigned long flags; unsigned long flags;
u32 csr; u32 orig_csr, csr;
spin_lock_irqsave(&p->lock, flags); spin_lock_irqsave(&p->lock, flags);
csr = readl(p->regs + EBDMA_CSR); orig_csr = csr = readl(p->regs + EBDMA_CSR);
if (on) if (on)
csr |= EBDMA_CSR_EN_DMA; csr |= EBDMA_CSR_EN_DMA;
else else
csr &= ~EBDMA_CSR_EN_DMA; csr &= ~EBDMA_CSR_EN_DMA;
writel(csr, p->regs + EBDMA_CSR); if ((orig_csr & EBDMA_CSR_EN_DMA) !=
(csr & EBDMA_CSR_EN_DMA))
writel(csr, p->regs + EBDMA_CSR);
spin_unlock_irqrestore(&p->lock, flags); spin_unlock_irqrestore(&p->lock, flags);
} }
EXPORT_SYMBOL(ebus_dma_enable); EXPORT_SYMBOL(ebus_dma_enable);
......
...@@ -1140,23 +1140,28 @@ void do_gettimeofday(struct timeval *tv) ...@@ -1140,23 +1140,28 @@ void do_gettimeofday(struct timeval *tv)
unsigned long flags; unsigned long flags;
unsigned long seq; unsigned long seq;
unsigned long usec, sec; unsigned long usec, sec;
unsigned long max_ntp_tick = tick_usec - tickadj;
do { do {
unsigned long lost;
seq = read_seqbegin_irqsave(&xtime_lock, flags); seq = read_seqbegin_irqsave(&xtime_lock, flags);
usec = do_gettimeoffset(); usec = do_gettimeoffset();
{ lost = jiffies - wall_jiffies;
unsigned long lost = jiffies - wall_jiffies;
if (lost)
usec += lost * (1000000 / HZ);
}
/* /*
* If time_adjust is negative then NTP is slowing the clock * If time_adjust is negative then NTP is slowing the clock
* so make sure not to go into next possible interval. * so make sure not to go into next possible interval.
* Better to lose some accuracy than have time go backwards.. * Better to lose some accuracy than have time go backwards..
*/ */
if (unlikely(time_adjust < 0) && usec > tickadj) if (unlikely(time_adjust < 0)) {
usec = tickadj; usec = min(usec, max_ntp_tick);
if (lost)
usec += lost * max_ntp_tick;
}
else if (unlikely(lost))
usec += lost * tick_usec;
sec = xtime.tv_sec; sec = xtime.tv_sec;
usec += (xtime.tv_nsec / 1000); usec += (xtime.tv_nsec / 1000);
......
...@@ -54,7 +54,7 @@ static void __init reserve_resources_of_dev( struct pnp_dev *dev ) ...@@ -54,7 +54,7 @@ static void __init reserve_resources_of_dev( struct pnp_dev *dev )
int i; int i;
for (i=0;i<PNP_MAX_PORT;i++) { for (i=0;i<PNP_MAX_PORT;i++) {
if (pnp_port_valid(dev, i)) if (!pnp_port_valid(dev, i))
/* end of resources */ /* end of resources */
continue; continue;
if (pnp_port_start(dev, i) == 0) if (pnp_port_start(dev, i) == 0)
......
...@@ -312,6 +312,9 @@ struct scsi_host_template usb_stor_host_template = { ...@@ -312,6 +312,9 @@ struct scsi_host_template usb_stor_host_template = {
/* lots of sg segments can be handled */ /* lots of sg segments can be handled */
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
/* limit the total size of a transfer to 120 KB */
.max_sectors = 240,
/* merge commands... this seems to help performance, but /* merge commands... this seems to help performance, but
* periodically someone should test to see which setting is more * periodically someone should test to see which setting is more
* optimal. * optimal.
......
...@@ -57,6 +57,7 @@ struct ebus_dma_info { ...@@ -57,6 +57,7 @@ struct ebus_dma_info {
unsigned int flags; unsigned int flags;
#define EBUS_DMA_FLAG_USE_EBDMA_HANDLER 0x00000001 #define EBUS_DMA_FLAG_USE_EBDMA_HANDLER 0x00000001
#define EBUS_DMA_FLAG_TCI_DISABLE 0x00000002
/* These are only valid is EBUS_DMA_FLAG_USE_EBDMA_HANDLER is /* These are only valid is EBUS_DMA_FLAG_USE_EBDMA_HANDLER is
* set. * set.
......
...@@ -340,12 +340,12 @@ static void sun_pci_fd_enable_dma(void) ...@@ -340,12 +340,12 @@ static void sun_pci_fd_enable_dma(void)
sun_pci_dma_current.len, sun_pci_dma_current.len,
sun_pci_dma_current.direction); sun_pci_dma_current.direction);
ebus_dma_enable(&sun_pci_fd_ebus_dma, 1);
if (ebus_dma_request(&sun_pci_fd_ebus_dma, if (ebus_dma_request(&sun_pci_fd_ebus_dma,
sun_pci_dma_current.addr, sun_pci_dma_current.addr,
sun_pci_dma_current.len)) sun_pci_dma_current.len))
BUG(); BUG();
ebus_dma_enable(&sun_pci_fd_ebus_dma, 1);
} }
static void sun_pci_fd_disable_dma(void) static void sun_pci_fd_disable_dma(void)
...@@ -361,6 +361,11 @@ static void sun_pci_fd_disable_dma(void) ...@@ -361,6 +361,11 @@ static void sun_pci_fd_disable_dma(void)
static void sun_pci_fd_set_dma_mode(int mode) static void sun_pci_fd_set_dma_mode(int mode)
{ {
if (mode == DMA_MODE_WRITE)
sun_pci_dma_pending.direction = PCI_DMA_TODEVICE;
else
sun_pci_dma_pending.direction = PCI_DMA_FROMDEVICE;
ebus_dma_prepare(&sun_pci_fd_ebus_dma, mode != DMA_MODE_WRITE); ebus_dma_prepare(&sun_pci_fd_ebus_dma, mode != DMA_MODE_WRITE);
} }
...@@ -630,11 +635,9 @@ static unsigned long __init sun_floppy_init(void) ...@@ -630,11 +635,9 @@ static unsigned long __init sun_floppy_init(void)
prom_getproperty(edev->prom_node, "status", prom_getproperty(edev->prom_node, "status",
state, sizeof(state)); state, sizeof(state));
if(!strncmp(state, "disabled", 8)) if (!strncmp(state, "disabled", 8))
return 0; return 0;
/* XXX ioremap */
sun_fdc = (struct sun_flpy_controller *)edev->resource[0].start;
FLOPPY_IRQ = edev->irqs[0]; FLOPPY_IRQ = edev->irqs[0];
/* Make sure the high density bit is set, some systems /* Make sure the high density bit is set, some systems
...@@ -646,11 +649,14 @@ static unsigned long __init sun_floppy_init(void) ...@@ -646,11 +649,14 @@ static unsigned long __init sun_floppy_init(void)
sun_pci_ebus_dev = ebus->self; sun_pci_ebus_dev = ebus->self;
spin_lock_init(&sun_pci_fd_ebus_dma.lock); spin_lock_init(&sun_pci_fd_ebus_dma.lock);
/* XXX ioremap */ /* XXX ioremap */
sun_pci_fd_ebus_dma.regs = edev->resource[1].start; sun_pci_fd_ebus_dma.regs = edev->resource[1].start;
if (!sun_pci_fd_ebus_dma.regs) if (!sun_pci_fd_ebus_dma.regs)
return 0; return 0;
sun_pci_fd_ebus_dma.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER;
sun_pci_fd_ebus_dma.flags = (EBUS_DMA_FLAG_USE_EBDMA_HANDLER |
EBUS_DMA_FLAG_TCI_DISABLE);
sun_pci_fd_ebus_dma.callback = sun_pci_fd_dma_callback; sun_pci_fd_ebus_dma.callback = sun_pci_fd_dma_callback;
sun_pci_fd_ebus_dma.client_cookie = NULL; sun_pci_fd_ebus_dma.client_cookie = NULL;
sun_pci_fd_ebus_dma.irq = FLOPPY_IRQ; sun_pci_fd_ebus_dma.irq = FLOPPY_IRQ;
...@@ -658,6 +664,9 @@ static unsigned long __init sun_floppy_init(void) ...@@ -658,6 +664,9 @@ static unsigned long __init sun_floppy_init(void)
if (ebus_dma_register(&sun_pci_fd_ebus_dma)) if (ebus_dma_register(&sun_pci_fd_ebus_dma))
return 0; return 0;
/* XXX ioremap */
sun_fdc = (struct sun_flpy_controller *)edev->resource[0].start;
sun_fdops.fd_inb = sun_pci_fd_inb; sun_fdops.fd_inb = sun_pci_fd_inb;
sun_fdops.fd_outb = sun_pci_fd_outb; sun_fdops.fd_outb = sun_pci_fd_outb;
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
#include <linux/igmp.h> #include <linux/igmp.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/times.h>
#include <net/ip.h> #include <net/ip.h>
#include <net/protocol.h> #include <net/protocol.h>
#include <net/route.h> #include <net/route.h>
...@@ -2215,7 +2216,7 @@ static int igmp_mc_seq_show(struct seq_file *seq, void *v) ...@@ -2215,7 +2216,7 @@ static int igmp_mc_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, seq_printf(seq,
"\t\t\t\t%08lX %5d %d:%08lX\t\t%d\n", "\t\t\t\t%08lX %5d %d:%08lX\t\t%d\n",
im->multiaddr, im->users, im->multiaddr, im->users,
im->tm_running, im->timer.expires-jiffies, im->reporter); im->tm_running, jiffies_to_clock_t(im->timer.expires-jiffies), im->reporter);
} }
return 0; return 0;
} }
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/socket.h> #include <linux/socket.h>
#include <linux/sockios.h> #include <linux/sockios.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/times.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/in6.h> #include <linux/in6.h>
...@@ -960,8 +961,9 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime) ...@@ -960,8 +961,9 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime)
{ {
unsigned long delay = resptime; unsigned long delay = resptime;
/* Do not start timer for addresses with link/host scope */ /* Do not start timer for these addresses */
if (ipv6_addr_type(&ma->mca_addr)&(IPV6_ADDR_LINKLOCAL|IPV6_ADDR_LOOPBACK)) if (ipv6_addr_is_ll_all_nodes(&ma->mca_addr) ||
IPV6_ADDR_MC_SCOPE(&ma->mca_addr) < IPV6_ADDR_SCOPE_LINKLOCAL)
return; return;
if (del_timer(&ma->mca_timer)) { if (del_timer(&ma->mca_timer)) {
...@@ -978,6 +980,7 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime) ...@@ -978,6 +980,7 @@ static void igmp6_group_queried(struct ifmcaddr6 *ma, unsigned long resptime)
ma->mca_timer.expires = jiffies + delay; ma->mca_timer.expires = jiffies + delay;
if (!mod_timer(&ma->mca_timer, jiffies + delay)) if (!mod_timer(&ma->mca_timer, jiffies + delay))
atomic_inc(&ma->mca_refcnt); atomic_inc(&ma->mca_refcnt);
ma->mca_flags |= MAF_TIMER_RUNNING;
} }
static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs, static void mld_marksources(struct ifmcaddr6 *pmc, int nsrcs,
...@@ -1014,7 +1017,9 @@ int igmp6_event_query(struct sk_buff *skb) ...@@ -1014,7 +1017,9 @@ int igmp6_event_query(struct sk_buff *skb)
if (!pskb_may_pull(skb, sizeof(struct in6_addr))) if (!pskb_may_pull(skb, sizeof(struct in6_addr)))
return -EINVAL; return -EINVAL;
len = ntohs(skb->nh.ipv6h->payload_len); /* compute payload length excluding extension headers */
len = ntohs(skb->nh.ipv6h->payload_len) + sizeof(struct ipv6hdr);
len -= (char *)skb->h.raw - (char *)skb->nh.ipv6h;
/* Drop queries with not link local source */ /* Drop queries with not link local source */
if (!(ipv6_addr_type(&skb->nh.ipv6h->saddr)&IPV6_ADDR_LINKLOCAL)) if (!(ipv6_addr_type(&skb->nh.ipv6h->saddr)&IPV6_ADDR_LINKLOCAL))
...@@ -2157,7 +2162,8 @@ static int igmp6_mc_seq_show(struct seq_file *seq, void *v) ...@@ -2157,7 +2162,8 @@ static int igmp6_mc_seq_show(struct seq_file *seq, void *v)
state->dev->ifindex, state->dev->name, state->dev->ifindex, state->dev->name,
NIP6(im->mca_addr), NIP6(im->mca_addr),
im->mca_users, im->mca_flags, im->mca_users, im->mca_flags,
(im->mca_flags&MAF_TIMER_RUNNING) ? im->mca_timer.expires-jiffies : 0); (im->mca_flags&MAF_TIMER_RUNNING) ?
jiffies_to_clock_t(im->mca_timer.expires-jiffies) : 0);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment