Commit f799dada authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk/linux-2.6-mmc

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 5c577c16 6d91e54d
...@@ -91,8 +91,8 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len, ...@@ -91,8 +91,8 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
* braindamage (it can't really handle filesystems where the directory * braindamage (it can't really handle filesystems where the directory
* offset differences aren't the same as "d_reclen"). * offset differences aren't the same as "d_reclen").
*/ */
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) #define NAME_OFFSET offsetof (struct osf_dirent, d_name)
#define ROUND_UP(x) (((x)+3) & ~3) #define ROUND_UP(x) (((x)+3) & ~3)
struct osf_dirent { struct osf_dirent {
unsigned int d_ino; unsigned int d_ino;
...@@ -114,7 +114,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, ...@@ -114,7 +114,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
{ {
struct osf_dirent __user *dirent; struct osf_dirent __user *dirent;
struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf;
unsigned int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); unsigned int reclen = ROUND_UP(NAME_OFFSET + namlen + 1);
buf->error = -EINVAL; /* only used if we fail */ buf->error = -EINVAL; /* only used if we fail */
if (reclen > buf->count) if (reclen > buf->count)
...@@ -989,7 +989,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, ...@@ -989,7 +989,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
fd_set_bits fds; fd_set_bits fds;
char *bits; char *bits;
size_t size; size_t size;
unsigned long timeout; long timeout;
int ret; int ret;
timeout = MAX_SCHEDULE_TIMEOUT; timeout = MAX_SCHEDULE_TIMEOUT;
......
...@@ -91,15 +91,15 @@ static int regoff[] = { ...@@ -91,15 +91,15 @@ static int regoff[] = {
PT_REG( pc) PT_REG( pc)
}; };
static long zero; static unsigned long zero;
/* /*
* Get address of register REGNO in task TASK. * Get address of register REGNO in task TASK.
*/ */
static long * static unsigned long *
get_reg_addr(struct task_struct * task, unsigned long regno) get_reg_addr(struct task_struct * task, unsigned long regno)
{ {
long *addr; unsigned long *addr;
if (regno == 30) { if (regno == 30) {
addr = &task->thread_info->pcb.usp; addr = &task->thread_info->pcb.usp;
...@@ -109,7 +109,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) ...@@ -109,7 +109,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
zero = 0; zero = 0;
addr = &zero; addr = &zero;
} else { } else {
addr = (long *)((long)task->thread_info + regoff[regno]); addr = (void *)task->thread_info + regoff[regno];
} }
return addr; return addr;
} }
...@@ -117,7 +117,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) ...@@ -117,7 +117,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
/* /*
* Get contents of register REGNO in task TASK. * Get contents of register REGNO in task TASK.
*/ */
static long static unsigned long
get_reg(struct task_struct * task, unsigned long regno) get_reg(struct task_struct * task, unsigned long regno)
{ {
/* Special hack for fpcr -- combine hardware and software bits. */ /* Special hack for fpcr -- combine hardware and software bits. */
...@@ -135,7 +135,7 @@ get_reg(struct task_struct * task, unsigned long regno) ...@@ -135,7 +135,7 @@ get_reg(struct task_struct * task, unsigned long regno)
* Write contents of register REGNO in task TASK. * Write contents of register REGNO in task TASK.
*/ */
static int static int
put_reg(struct task_struct *task, unsigned long regno, long data) put_reg(struct task_struct *task, unsigned long regno, unsigned long data)
{ {
if (regno == 63) { if (regno == 63) {
task->thread_info->ieee_state task->thread_info->ieee_state
...@@ -168,11 +168,11 @@ int ...@@ -168,11 +168,11 @@ int
ptrace_set_bpt(struct task_struct * child) ptrace_set_bpt(struct task_struct * child)
{ {
int displ, i, res, reg_b, nsaved = 0; int displ, i, res, reg_b, nsaved = 0;
u32 insn, op_code; unsigned int insn, op_code;
unsigned long pc; unsigned long pc;
pc = get_reg(child, REG_PC); pc = get_reg(child, REG_PC);
res = read_int(child, pc, &insn); res = read_int(child, pc, (int *) &insn);
if (res < 0) if (res < 0)
return res; return res;
...@@ -203,7 +203,8 @@ ptrace_set_bpt(struct task_struct * child) ...@@ -203,7 +203,8 @@ ptrace_set_bpt(struct task_struct * child)
/* install breakpoints: */ /* install breakpoints: */
for (i = 0; i < nsaved; ++i) { for (i = 0; i < nsaved; ++i) {
res = read_int(child, child->thread_info->bpt_addr[i], &insn); res = read_int(child, child->thread_info->bpt_addr[i],
(int *) &insn);
if (res < 0) if (res < 0)
return res; return res;
child->thread_info->bpt_insn[i] = insn; child->thread_info->bpt_insn[i] = insn;
......
...@@ -228,6 +228,12 @@ struct rt_sigframe ...@@ -228,6 +228,12 @@ struct rt_sigframe
unsigned int retcode[3]; unsigned int retcode[3];
}; };
/* If this changes, userland unwinders that Know Things about our signal
frame will break. Do not undertake lightly. It also implies an ABI
change wrt the size of siginfo_t, which may cause some pain. */
extern char compile_time_assert
[offsetof(struct rt_sigframe, uc.uc_mcontext) == 176 ? 1 : -1];
#define INSN_MOV_R30_R16 0x47fe0410 #define INSN_MOV_R30_R16 0x47fe0410
#define INSN_LDI_R0 0x201f0000 #define INSN_LDI_R0 0x201f0000
#define INSN_CALLSYS 0x00000083 #define INSN_CALLSYS 0x00000083
......
...@@ -91,15 +91,15 @@ srmcons_receive_chars(unsigned long data) ...@@ -91,15 +91,15 @@ srmcons_receive_chars(unsigned long data)
/* called with callback_lock held */ /* called with callback_lock held */
static int static int
srmcons_do_write(struct tty_struct *tty, const unsigned char *buf, int count) srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
{ {
unsigned char *str_cr = "\r"; static char str_cr[1] = "\r";
long c, remaining = count; long c, remaining = count;
srmcons_result result; srmcons_result result;
unsigned char *cur; char *cur;
int need_cr; int need_cr;
for (cur = (unsigned char *)buf; remaining > 0; ) { for (cur = (char *)buf; remaining > 0; ) {
need_cr = 0; need_cr = 0;
/* /*
* Break it up into reasonable size chunks to allow a chance * Break it up into reasonable size chunks to allow a chance
...@@ -138,7 +138,7 @@ srmcons_write(struct tty_struct *tty, int from_user, ...@@ -138,7 +138,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
unsigned long flags; unsigned long flags;
if (from_user) { if (from_user) {
unsigned char tmp[512]; char tmp[512];
int ret = 0; int ret = 0;
size_t c; size_t c;
...@@ -167,7 +167,7 @@ srmcons_write(struct tty_struct *tty, int from_user, ...@@ -167,7 +167,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
} }
spin_lock_irqsave(&srmcons_callback_lock, flags); spin_lock_irqsave(&srmcons_callback_lock, flags);
srmcons_do_write(tty, buf, count); srmcons_do_write(tty, (const char *) buf, count);
spin_unlock_irqrestore(&srmcons_callback_lock, flags); spin_unlock_irqrestore(&srmcons_callback_lock, flags);
return count; return count;
......
...@@ -202,7 +202,7 @@ static void apm_suspend(void) ...@@ -202,7 +202,7 @@ static void apm_suspend(void)
} }
up_read(&user_list_lock); up_read(&user_list_lock);
wake_up_interruptible(&apm_suspend_waitqueue); wake_up(&apm_suspend_waitqueue);
} }
static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos) static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
...@@ -306,7 +306,15 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) ...@@ -306,7 +306,15 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
flags = current->flags; flags = current->flags;
current->flags |= PF_NOFREEZE; current->flags |= PF_NOFREEZE;
wait_event_interruptible(apm_suspend_waitqueue, /*
* Note: do not allow a thread which is acking the suspend
* to escape until the resume is complete.
*/
if (as->suspend_state == SUSPEND_ACKED)
wait_event(apm_suspend_waitqueue,
as->suspend_state == SUSPEND_DONE);
else
wait_event_interruptible(apm_suspend_waitqueue,
as->suspend_state == SUSPEND_DONE); as->suspend_state == SUSPEND_DONE);
current->flags = flags; current->flags = flags;
......
...@@ -1843,6 +1843,37 @@ void dump_stack(void) ...@@ -1843,6 +1843,37 @@ void dump_stack(void)
EXPORT_SYMBOL(dump_stack); EXPORT_SYMBOL(dump_stack);
static inline int is_kernel_stack(struct task_struct *task,
struct reg_window *rw)
{
unsigned long rw_addr = (unsigned long) rw;
unsigned long thread_base, thread_end;
if (rw_addr < PAGE_OFFSET) {
if (task != &init_task)
return 0;
}
thread_base = (unsigned long) task->thread_info;
thread_end = thread_base + sizeof(union thread_union);
if (rw_addr >= thread_base &&
rw_addr < thread_end &&
!(rw_addr & 0x7UL))
return 1;
return 0;
}
static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
{
unsigned long fp = rw->ins[6];
if (!fp)
return NULL;
return (struct reg_window *) (fp + STACK_BIAS);
}
void die_if_kernel(char *str, struct pt_regs *regs) void die_if_kernel(char *str, struct pt_regs *regs)
{ {
static int die_counter; static int die_counter;
...@@ -1868,17 +1899,14 @@ void die_if_kernel(char *str, struct pt_regs *regs) ...@@ -1868,17 +1899,14 @@ void die_if_kernel(char *str, struct pt_regs *regs)
/* Stop the back trace when we hit userland or we /* Stop the back trace when we hit userland or we
* find some badly aligned kernel stack. * find some badly aligned kernel stack.
*/ */
while (rw && while (rw &&
count++ < 30 && count++ < 30&&
(((unsigned long) rw) >= PAGE_OFFSET) && is_kernel_stack(current, rw)) {
(char *) rw < ((char *) current)
+ sizeof (union thread_union) &&
!(((unsigned long) rw) & 0x7)) {
printk("Caller[%016lx]", rw->ins[7]); printk("Caller[%016lx]", rw->ins[7]);
print_symbol(": %s", rw->ins[7]); print_symbol(": %s", rw->ins[7]);
printk("\n"); printk("\n");
rw = (struct reg_window *)
(rw->ins[6] + STACK_BIAS); rw = kernel_stack_up(rw);
} }
instruction_dump ((unsigned int *) regs->tpc); instruction_dump ((unsigned int *) regs->tpc);
} else { } else {
......
...@@ -52,10 +52,6 @@ ...@@ -52,10 +52,6 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef __HAVE_COUNTERS
#define __HAVE_COUNTERS 0
#endif
#ifndef DRIVER_IOCTLS #ifndef DRIVER_IOCTLS
#define DRIVER_IOCTLS #define DRIVER_IOCTLS
#endif #endif
...@@ -195,41 +191,6 @@ static int DRM(setup)( drm_device_t *dev ) ...@@ -195,41 +191,6 @@ static int DRM(setup)( drm_device_t *dev )
return i; return i;
} }
dev->counters = 6 + __HAVE_COUNTERS;
dev->types[0] = _DRM_STAT_LOCK;
dev->types[1] = _DRM_STAT_OPENS;
dev->types[2] = _DRM_STAT_CLOSES;
dev->types[3] = _DRM_STAT_IOCTLS;
dev->types[4] = _DRM_STAT_LOCKS;
dev->types[5] = _DRM_STAT_UNLOCKS;
#ifdef __HAVE_COUNTER6
dev->types[6] = __HAVE_COUNTER6;
#endif
#ifdef __HAVE_COUNTER7
dev->types[7] = __HAVE_COUNTER7;
#endif
#ifdef __HAVE_COUNTER8
dev->types[8] = __HAVE_COUNTER8;
#endif
#ifdef __HAVE_COUNTER9
dev->types[9] = __HAVE_COUNTER9;
#endif
#ifdef __HAVE_COUNTER10
dev->types[10] = __HAVE_COUNTER10;
#endif
#ifdef __HAVE_COUNTER11
dev->types[11] = __HAVE_COUNTER11;
#endif
#ifdef __HAVE_COUNTER12
dev->types[12] = __HAVE_COUNTER12;
#endif
#ifdef __HAVE_COUNTER13
dev->types[13] = __HAVE_COUNTER13;
#endif
#ifdef __HAVE_COUNTER14
dev->types[14] = __HAVE_COUNTER14;
#endif
for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ ) for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )
atomic_set( &dev->counts[i], 0 ); atomic_set( &dev->counts[i], 0 );
...@@ -510,7 +471,16 @@ static int DRM(probe)(struct pci_dev *pdev) ...@@ -510,7 +471,16 @@ static int DRM(probe)(struct pci_dev *pdev)
/* dev_priv_size can be changed by a driver in driver_register_fns */ /* dev_priv_size can be changed by a driver in driver_register_fns */
dev->dev_priv_size = sizeof(u32); dev->dev_priv_size = sizeof(u32);
/* the DRM has 6 basic counters - drivers add theirs in register_fns */
dev->counters = 6;
dev->types[0] = _DRM_STAT_LOCK;
dev->types[1] = _DRM_STAT_OPENS;
dev->types[2] = _DRM_STAT_CLOSES;
dev->types[3] = _DRM_STAT_IOCTLS;
dev->types[4] = _DRM_STAT_LOCKS;
dev->types[5] = _DRM_STAT_UNLOCKS;
DRM(init_fn_table)(dev); DRM(init_fn_table)(dev);
DRM(driver_register_fns)(dev); DRM(driver_register_fns)(dev);
......
...@@ -209,7 +209,7 @@ int DRM(sg_free)( struct inode *inode, struct file *filp, ...@@ -209,7 +209,7 @@ int DRM(sg_free)( struct inode *inode, struct file *filp,
drm_scatter_gather_t request; drm_scatter_gather_t request;
drm_sg_mem_t *entry; drm_sg_mem_t *entry;
if (drm_core_check_feature(dev, DRIVER_SG)) if (!drm_core_check_feature(dev, DRIVER_SG))
return -EINVAL; return -EINVAL;
if ( copy_from_user( &request, if ( copy_from_user( &request,
......
...@@ -74,10 +74,4 @@ ...@@ -74,10 +74,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus, 1, 0 }, \ [DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] = { i810_flip_bufs, 1, 0 } [DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] = { i810_flip_bufs, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
#endif #endif
...@@ -1412,5 +1412,11 @@ void i810_driver_register_fns(drm_device_t *dev) ...@@ -1412,5 +1412,11 @@ void i810_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.release = i810_driver_release; dev->fn_tbl.release = i810_driver_release;
dev->fn_tbl.dma_quiescent = i810_driver_dma_quiescent; dev->fn_tbl.dma_quiescent = i810_driver_dma_quiescent;
dev->fn_tbl.reclaim_buffers = i810_reclaim_buffers; dev->fn_tbl.reclaim_buffers = i810_reclaim_buffers;
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
} }
...@@ -73,12 +73,6 @@ ...@@ -73,12 +73,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam, 1, 0 }, \ [DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam, 1, 0 } [DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
/* Driver will work either way: IRQ's save cpu time when waiting for /* Driver will work either way: IRQ's save cpu time when waiting for
* the card, but are subject to subtle interactions between bios, * the card, but are subject to subtle interactions between bios,
* hardware and the driver. * hardware and the driver.
......
...@@ -1615,5 +1615,10 @@ void i830_driver_register_fns(drm_device_t *dev) ...@@ -1615,5 +1615,10 @@ void i830_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_uninstall = i830_driver_irq_uninstall; dev->fn_tbl.irq_uninstall = i830_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i830_driver_irq_handler; dev->fn_tbl.irq_handler = i830_driver_irq_handler;
#endif #endif
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
} }
...@@ -45,12 +45,6 @@ ...@@ -45,12 +45,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I915_INIT_HEAP)] = { i915_mem_init_heap, 1, 1 }, \ [DRM_IOCTL_NR(DRM_IOCTL_I915_INIT_HEAP)] = { i915_mem_init_heap, 1, 1 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I915_CMDBUFFER)] = { i915_cmdbuffer, 1, 0 } [DRM_IOCTL_NR(DRM_IOCTL_I915_CMDBUFFER)] = { i915_cmdbuffer, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
/* We use our own dma mechanisms, not the drm template code. However, /* We use our own dma mechanisms, not the drm template code. However,
* the shared IRQ code is useful to us: * the shared IRQ code is useful to us:
*/ */
......
...@@ -746,4 +746,10 @@ void i915_driver_register_fns(drm_device_t *dev) ...@@ -746,4 +746,10 @@ void i915_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = i915_driver_irq_postinstall; dev->fn_tbl.irq_postinstall = i915_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = i915_driver_irq_uninstall; dev->fn_tbl.irq_uninstall = i915_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i915_driver_irq_handler; dev->fn_tbl.irq_handler = i915_driver_irq_handler;
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
} }
...@@ -60,9 +60,4 @@ ...@@ -60,9 +60,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)] = { mga_dma_blit, 1, 0 }, \ [DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)] = { mga_dma_blit, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_MGA_GETPARAM)]= { mga_getparam, 1, 0 }, [DRM_IOCTL_NR(DRM_IOCTL_MGA_GETPARAM)]= { mga_getparam, 1, 0 },
#define __HAVE_COUNTERS 3
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#endif #endif
...@@ -819,4 +819,9 @@ void mga_driver_register_fns(drm_device_t *dev) ...@@ -819,4 +819,9 @@ void mga_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = mga_driver_irq_postinstall; dev->fn_tbl.irq_postinstall = mga_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = mga_driver_irq_uninstall; dev->fn_tbl.irq_uninstall = mga_driver_irq_uninstall;
dev->fn_tbl.irq_handler = mga_driver_irq_handler; dev->fn_tbl.irq_handler = mga_driver_irq_handler;
dev->counters += 3;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
} }
...@@ -58,6 +58,4 @@ ...@@ -58,6 +58,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_SIS_AGP_FREE)] = { sis_ioctl_agp_free, 1, 0 }, \ [DRM_IOCTL_NR(DRM_IOCTL_SIS_AGP_FREE)] = { sis_ioctl_agp_free, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_SIS_FB_INIT)] = { sis_fb_init, 1, 1 } [DRM_IOCTL_NR(DRM_IOCTL_SIS_FB_INIT)] = { sis_fb_init, 1, 1 }
#define __HAVE_COUNTERS 5
#endif #endif
...@@ -132,7 +132,7 @@ struct eth1394_node_info { ...@@ -132,7 +132,7 @@ struct eth1394_node_info {
}; };
/* Our ieee1394 highlevel driver */ /* Our ieee1394 highlevel driver */
#define ETH1394_DRIVER_NAME "ip1394" #define ETH1394_DRIVER_NAME "eth1394"
static const char driver_name[] = ETH1394_DRIVER_NAME; static const char driver_name[] = ETH1394_DRIVER_NAME;
static kmem_cache_t *packet_task_cache; static kmem_cache_t *packet_task_cache;
......
...@@ -200,7 +200,7 @@ source "drivers/net/arm/Kconfig" ...@@ -200,7 +200,7 @@ source "drivers/net/arm/Kconfig"
config MACE config MACE
tristate "MACE (Power Mac ethernet) support" tristate "MACE (Power Mac ethernet) support"
depends on NET_ETHERNET && PPC32 && PPC_PMAC depends on NET_ETHERNET && PPC_PMAC && PPC32
select CRC32 select CRC32
help help
Power Macintoshes and clones with Ethernet built-in on the Power Macintoshes and clones with Ethernet built-in on the
...@@ -223,7 +223,7 @@ config MACE_AAUI_PORT ...@@ -223,7 +223,7 @@ config MACE_AAUI_PORT
config BMAC config BMAC
tristate "BMAC (G3 ethernet) support" tristate "BMAC (G3 ethernet) support"
depends on NET_ETHERNET && PPC32 && PPC_PMAC depends on NET_ETHERNET && PPC_PMAC && PPC32
select CRC32 select CRC32
help help
Say Y for support of BMAC Ethernet interfaces. These are used on G3 Say Y for support of BMAC Ethernet interfaces. These are used on G3
......
...@@ -156,6 +156,7 @@ static struct pci_device_id rtl8169_pci_tbl[] = { ...@@ -156,6 +156,7 @@ static struct pci_device_id rtl8169_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl); MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);
static int rx_copybreak = 200; static int rx_copybreak = 200;
static int use_dac;
enum RTL8169_registers { enum RTL8169_registers {
MAC0 = 0, /* Ethernet hardware address. */ MAC0 = 0, /* Ethernet hardware address. */
...@@ -358,6 +359,8 @@ MODULE_AUTHOR("Realtek"); ...@@ -358,6 +359,8 @@ MODULE_AUTHOR("Realtek");
MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
MODULE_PARM(media, "1-" __MODULE_STRING(MAX_UNITS) "i"); MODULE_PARM(media, "1-" __MODULE_STRING(MAX_UNITS) "i");
MODULE_PARM(rx_copybreak, "i"); MODULE_PARM(rx_copybreak, "i");
MODULE_PARM(use_dac, "i");
MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static int rtl8169_open(struct net_device *dev); static int rtl8169_open(struct net_device *dev);
...@@ -375,7 +378,7 @@ static int rtl8169_poll(struct net_device *dev, int *budget); ...@@ -375,7 +378,7 @@ static int rtl8169_poll(struct net_device *dev, int *budget);
#endif #endif
static const u16 rtl8169_intr_mask = static const u16 rtl8169_intr_mask =
LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK; SYSErr | LinkChg | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK;
static const u16 rtl8169_napi_event = static const u16 rtl8169_napi_event =
RxOK | RxOverflow | RxFIFOOver | TxOK | TxErr; RxOK | RxOverflow | RxFIFOOver | TxOK | TxErr;
static const unsigned int rtl8169_rx_config = static const unsigned int rtl8169_rx_config =
...@@ -984,7 +987,7 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out, ...@@ -984,7 +987,7 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
tp->cp_cmd = PCIMulRW | RxChkSum; tp->cp_cmd = PCIMulRW | RxChkSum;
if ((sizeof(dma_addr_t) > 4) && if ((sizeof(dma_addr_t) > 4) &&
!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) !pci_set_dma_mask(pdev, DMA_64BIT_MASK) && use_dac)
tp->cp_cmd |= PCIDAC; tp->cp_cmd |= PCIDAC;
else { else {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
...@@ -1761,6 +1764,15 @@ rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs) ...@@ -1761,6 +1764,15 @@ rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (!(status & rtl8169_intr_mask)) if (!(status & rtl8169_intr_mask))
break; break;
if (unlikely(status & SYSErr)) {
printk(KERN_ERR PFX "%s: PCI error (status: 0x%04x)."
" Device disabled.\n", dev->name, status);
RTL_W8(ChipCmd, 0x00);
RTL_W16(IntrMask, 0x0000);
RTL_R16(IntrMask);
break;
}
if (status & LinkChg) if (status & LinkChg)
rtl8169_check_link_status(dev, tp, ioaddr); rtl8169_check_link_status(dev, tp, ioaddr);
......
...@@ -1816,7 +1816,8 @@ static int writeConfigRid(struct airo_info*ai, int lock) { ...@@ -1816,7 +1816,8 @@ static int writeConfigRid(struct airo_info*ai, int lock) {
if (!test_bit (FLAG_COMMIT, &ai->flags)) if (!test_bit (FLAG_COMMIT, &ai->flags))
return SUCCESS; return SUCCESS;
clear_bit (FLAG_COMMIT | FLAG_RESET, &ai->flags); clear_bit (FLAG_COMMIT, &ai->flags);
clear_bit (FLAG_RESET, &ai->flags);
checkThrottle(ai); checkThrottle(ai);
cfgr = ai->config; cfgr = ai->config;
...@@ -1980,9 +1981,6 @@ static int mpi_send_packet (struct net_device *dev) ...@@ -1980,9 +1981,6 @@ static int mpi_send_packet (struct net_device *dev)
ai->txfids[0].tx_desc.eoc = 1; ai->txfids[0].tx_desc.eoc = 1;
ai->txfids[0].tx_desc.len =len+sizeof(WifiHdr); ai->txfids[0].tx_desc.len =len+sizeof(WifiHdr);
memcpy((char *)ai->txfids[0].card_ram_off,
(char *)&ai->txfids[0].tx_desc, sizeof(TxFid));
/* /*
* Magic, the cards firmware needs a length count (2 bytes) in the host buffer * Magic, the cards firmware needs a length count (2 bytes) in the host buffer
* right after TXFID_HDR.The TXFID_HDR contains the status short so payloadlen * right after TXFID_HDR.The TXFID_HDR contains the status short so payloadlen
...@@ -2012,6 +2010,7 @@ static int mpi_send_packet (struct net_device *dev) ...@@ -2012,6 +2010,7 @@ static int mpi_send_packet (struct net_device *dev)
return ERROR; return ERROR;
*payloadLen = cpu_to_le16(len-sizeof(etherHead)+sizeof(pMic)); *payloadLen = cpu_to_le16(len-sizeof(etherHead)+sizeof(pMic));
ai->txfids[0].tx_desc.len += sizeof(pMic);
/* copy data into airo dma buffer */ /* copy data into airo dma buffer */
memcpy (sendbuf, buffer, sizeof(etherHead)); memcpy (sendbuf, buffer, sizeof(etherHead));
buffer += sizeof(etherHead); buffer += sizeof(etherHead);
...@@ -2030,6 +2029,9 @@ static int mpi_send_packet (struct net_device *dev) ...@@ -2030,6 +2029,9 @@ static int mpi_send_packet (struct net_device *dev)
memcpy(sendbuf, buffer, len); memcpy(sendbuf, buffer, len);
} }
memcpy((char *)ai->txfids[0].card_ram_off,
(char *)&ai->txfids[0].tx_desc, sizeof(TxFid));
OUT4500(ai, EVACK, 8); OUT4500(ai, EVACK, 8);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
...@@ -2184,6 +2186,12 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) { ...@@ -2184,6 +2186,12 @@ static int airo_start_xmit11(struct sk_buff *skb, struct net_device *dev) {
struct airo_info *priv = dev->priv; struct airo_info *priv = dev->priv;
u32 *fids = priv->fids; u32 *fids = priv->fids;
if (test_bit(FLAG_MPI, &priv->flags)) {
/* Not implemented yet for MPI350 */
netif_stop_queue(dev);
return -ENETDOWN;
}
if ( skb == NULL ) { if ( skb == NULL ) {
printk( KERN_ERR "airo: skb == NULL!!!\n" ); printk( KERN_ERR "airo: skb == NULL!!!\n" );
return 0; return 0;
...@@ -2249,12 +2257,14 @@ struct net_device_stats *airo_get_stats(struct net_device *dev) ...@@ -2249,12 +2257,14 @@ struct net_device_stats *airo_get_stats(struct net_device *dev)
{ {
struct airo_info *local = dev->priv; struct airo_info *local = dev->priv;
/* Get stats out of the card if available */ if (!test_bit(JOB_STATS, &local->flags)) {
if (down_trylock(&local->sem) != 0) { /* Get stats out of the card if available */
set_bit(JOB_STATS, &local->flags); if (down_trylock(&local->sem) != 0) {
wake_up_interruptible(&local->thr_wait); set_bit(JOB_STATS, &local->flags);
} else wake_up_interruptible(&local->thr_wait);
airo_read_stats(local); } else
airo_read_stats(local);
}
return &local->stats; return &local->stats;
} }
...@@ -2340,6 +2350,9 @@ static void del_airo_dev( struct net_device *dev ); ...@@ -2340,6 +2350,9 @@ static void del_airo_dev( struct net_device *dev );
void stop_airo_card( struct net_device *dev, int freeres ) void stop_airo_card( struct net_device *dev, int freeres )
{ {
struct airo_info *ai = dev->priv; struct airo_info *ai = dev->priv;
set_bit(FLAG_RADIO_DOWN, &ai->flags);
disable_MAC(ai, 1);
disable_interrupts(ai); disable_interrupts(ai);
free_irq( dev->irq, dev ); free_irq( dev->irq, dev );
takedown_proc_entry( dev, ai ); takedown_proc_entry( dev, ai );
...@@ -3406,13 +3419,8 @@ static void disable_MAC( struct airo_info *ai, int lock ) { ...@@ -3406,13 +3419,8 @@ static void disable_MAC( struct airo_info *ai, int lock ) {
} }
static void enable_interrupts( struct airo_info *ai ) { static void enable_interrupts( struct airo_info *ai ) {
/* Reset the status register */
u16 status = IN4500( ai, EVSTAT );
OUT4500( ai, EVACK, status );
/* Enable the interrupts */ /* Enable the interrupts */
OUT4500( ai, EVINTEN, STATUS_INTS ); OUT4500( ai, EVINTEN, STATUS_INTS );
/* Note there is a race condition between the last two lines that
I don't know how to get rid of right now... */
} }
static void disable_interrupts( struct airo_info *ai ) { static void disable_interrupts( struct airo_info *ai ) {
...@@ -3460,7 +3468,7 @@ static void mpi_receive_802_3(struct airo_info *ai) ...@@ -3460,7 +3468,7 @@ static void mpi_receive_802_3(struct airo_info *ai)
memcpy(buffer + ETH_ALEN * 2, memcpy(buffer + ETH_ALEN * 2,
ai->rxfids[0].virtual_host_addr + ETH_ALEN * 2 + off, ai->rxfids[0].virtual_host_addr + ETH_ALEN * 2 + off,
len - ETH_ALEN * 2 - off); len - ETH_ALEN * 2 - off);
if (decapsulate (ai, &micbuf, (etherHead*)buffer, len - off)) { if (decapsulate (ai, &micbuf, (etherHead*)buffer, len - off - ETH_ALEN * 2)) {
badmic: badmic:
dev_kfree_skb_irq (skb); dev_kfree_skb_irq (skb);
goto badrx; goto badrx;
...@@ -3670,18 +3678,6 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) ...@@ -3670,18 +3678,6 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
status = readCapabilityRid(ai, &cap_rid, lock); status = readCapabilityRid(ai, &cap_rid, lock);
if ( status != SUCCESS ) return ERROR; if ( status != SUCCESS ) return ERROR;
/*
* This driver supports MPI350 firmwares up to, and
* including 5.30.17
*/
if (test_bit(FLAG_MPI, &ai->flags) &&
strncmp (cap_rid.prodVer, "5.00.", 5) &&
strncmp (cap_rid.prodVer, "5b00.", 5) &&
strncmp (cap_rid.prodVer, "5.02.", 5) &&
strncmp (cap_rid.prodVer, "5.20.", 5) &&
strncmp (cap_rid.prodVer, "5.30.", 5))
printk(KERN_ERR "airo: Firmware version %s is not supported. Use it at your own risk!\n", cap_rid.prodVer);
status = PC4500_readrid(ai,RID_RSSI,&rssi_rid,sizeof(rssi_rid),lock); status = PC4500_readrid(ai,RID_RSSI,&rssi_rid,sizeof(rssi_rid),lock);
if ( status == SUCCESS ) { if ( status == SUCCESS ) {
if (ai->rssi || (ai->rssi = kmalloc(512, GFP_KERNEL)) != NULL) if (ai->rssi || (ai->rssi = kmalloc(512, GFP_KERNEL)) != NULL)
...@@ -3716,9 +3712,9 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) ...@@ -3716,9 +3712,9 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
/* Check to see if there are any insmod configured /* Check to see if there are any insmod configured
rates to add */ rates to add */
if ( rates ) { if ( rates[0] ) {
int i = 0; int i = 0;
if ( rates[0] ) memset(ai->config.rates,0,sizeof(ai->config.rates)); memset(ai->config.rates,0,sizeof(ai->config.rates));
for( i = 0; i < 8 && rates[i]; i++ ) { for( i = 0; i < 8 && rates[i]; i++ ) {
ai->config.rates[i] = rates[i]; ai->config.rates[i] = rates[i];
} }
...@@ -3785,7 +3781,6 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock) ...@@ -3785,7 +3781,6 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) { static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) {
// Im really paranoid about letting it run forever! // Im really paranoid about letting it run forever!
int max_tries = 600000; int max_tries = 600000;
u16 cmd;
if (IN4500(ai, EVSTAT) & EV_CMD) if (IN4500(ai, EVSTAT) & EV_CMD)
OUT4500(ai, EVACK, EV_CMD); OUT4500(ai, EVACK, EV_CMD);
...@@ -3794,26 +3789,23 @@ static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) { ...@@ -3794,26 +3789,23 @@ static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) {
OUT4500(ai, PARAM1, pCmd->parm1); OUT4500(ai, PARAM1, pCmd->parm1);
OUT4500(ai, PARAM2, pCmd->parm2); OUT4500(ai, PARAM2, pCmd->parm2);
OUT4500(ai, COMMAND, pCmd->cmd); OUT4500(ai, COMMAND, pCmd->cmd);
while ( max_tries-- && (IN4500(ai, EVSTAT) & EV_CMD) == 0 &&
(cmd = IN4500(ai, COMMAND)) != 0 )
if (cmd == pCmd->cmd)
// PC4500 didn't notice command, try again
OUT4500(ai, COMMAND, pCmd->cmd);
if ( max_tries == -1 ) {
printk( KERN_ERR
"airo: Max tries exceeded when issueing command\n" );
return ERROR;
}
while (max_tries-- && (IN4500(ai, EVSTAT) & EV_CMD) == 0) { while (max_tries-- && (IN4500(ai, EVSTAT) & EV_CMD) == 0) {
if ((IN4500(ai, COMMAND)) == pCmd->cmd)
// PC4500 didn't notice command, try again
OUT4500(ai, COMMAND, pCmd->cmd);
if (!in_atomic() && (max_tries & 255) == 0) if (!in_atomic() && (max_tries & 255) == 0)
schedule(); schedule();
} }
if ( max_tries == -1 ) { if ( max_tries == -1 ) {
printk( KERN_ERR printk( KERN_ERR
"airo: Max tries exceeded waiting for command\n" ); "airo: Max tries exceeded when issueing command\n" );
return ERROR; if (IN4500(ai, COMMAND) & COMMAND_BUSY)
OUT4500(ai, EVACK, EV_CLEARCOMMANDBUSY);
return ERROR;
} }
// command completed // command completed
pRsp->status = IN4500(ai, STATUS); pRsp->status = IN4500(ai, STATUS);
pRsp->rsp0 = IN4500(ai, RESP0); pRsp->rsp0 = IN4500(ai, RESP0);
...@@ -4509,8 +4501,6 @@ static ssize_t proc_read( struct file *file, ...@@ -4509,8 +4501,6 @@ static ssize_t proc_read( struct file *file,
len = priv->readlen - pos; len = priv->readlen - pos;
if (copy_to_user(buffer, priv->rbuffer + pos, len)) if (copy_to_user(buffer, priv->rbuffer + pos, len))
return -EFAULT; return -EFAULT;
if (pos + len > priv->writelen)
priv->writelen = pos + len;
*offset = pos + len; *offset = pos + len;
return len; return len;
} }
...@@ -5521,7 +5511,6 @@ static int airo_pci_resume(struct pci_dev *pdev) ...@@ -5521,7 +5511,6 @@ static int airo_pci_resume(struct pci_dev *pdev)
mpi_init_descriptors(ai); mpi_init_descriptors(ai);
setup_card(ai, dev->dev_addr, 0); setup_card(ai, dev->dev_addr, 0);
clear_bit(FLAG_RADIO_OFF, &ai->flags); clear_bit(FLAG_RADIO_OFF, &ai->flags);
clear_bit(FLAG_RADIO_DOWN, &ai->flags);
clear_bit(FLAG_PENDING_XMIT, &ai->flags); clear_bit(FLAG_PENDING_XMIT, &ai->flags);
} else { } else {
OUT4500(ai, EVACK, EV_AWAKEN); OUT4500(ai, EVACK, EV_AWAKEN);
...@@ -5606,6 +5595,30 @@ static void __exit airo_cleanup_module( void ) ...@@ -5606,6 +5595,30 @@ static void __exit airo_cleanup_module( void )
* would not work at all... - Jean II * would not work at all... - Jean II
*/ */
static int airo_get_quality (StatusRid *status_rid, CapabilityRid *cap_rid)
{
int quality = 0;
if ((status_rid->mode & 0x3f) == 0x3f && (cap_rid->hardCap & 8)) {
if (memcmp(cap_rid->prodName, "350", 3))
if (status_rid->signalQuality > 0x20)
quality = 0;
else
quality = 0x20 - status_rid->signalQuality;
else
if (status_rid->signalQuality > 0xb0)
quality = 0;
else if (status_rid->signalQuality < 0x10)
quality = 0xa0;
else
quality = 0xb0 - status_rid->signalQuality;
}
return quality;
}
#define airo_get_max_quality(cap_rid) (memcmp((cap_rid)->prodName, "350", 3) ? 0x20 : 0xa0)
#define airo_get_avg_quality(cap_rid) (memcmp((cap_rid)->prodName, "350", 3) ? 0x10 : 0x50);
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* /*
* Wireless Handler : get protocol name * Wireless Handler : get protocol name
...@@ -6293,7 +6306,8 @@ static int airo_set_txpow(struct net_device *dev, ...@@ -6293,7 +6306,8 @@ static int airo_set_txpow(struct net_device *dev,
readCapabilityRid(local, &cap_rid, 1); readCapabilityRid(local, &cap_rid, 1);
if (vwrq->disabled) { if (vwrq->disabled) {
set_bit (FLAG_RADIO_OFF | FLAG_COMMIT, &local->flags); set_bit (FLAG_RADIO_OFF, &local->flags);
set_bit (FLAG_COMMIT, &local->flags);
return -EINPROGRESS; /* Call commit handler */ return -EINPROGRESS; /* Call commit handler */
} }
if (vwrq->flags != IW_TXPOW_MWATT) { if (vwrq->flags != IW_TXPOW_MWATT) {
...@@ -6432,7 +6446,7 @@ static int airo_get_range(struct net_device *dev, ...@@ -6432,7 +6446,7 @@ static int airo_get_range(struct net_device *dev,
range->num_frequency = k; range->num_frequency = k;
/* Hum... Should put the right values there */ /* Hum... Should put the right values there */
range->max_qual.qual = 10; range->max_qual.qual = airo_get_max_quality(&cap_rid);
range->max_qual.level = 0x100 - 120; /* -120 dBm */ range->max_qual.level = 0x100 - 120; /* -120 dBm */
range->max_qual.noise = 0; range->max_qual.noise = 0;
range->sensitivity = 65535; range->sensitivity = 65535;
...@@ -6499,7 +6513,7 @@ static int airo_get_range(struct net_device *dev, ...@@ -6499,7 +6513,7 @@ static int airo_get_range(struct net_device *dev,
/* Experimental measurements - boundary 11/5.5 Mb/s */ /* Experimental measurements - boundary 11/5.5 Mb/s */
/* Note : with or without the (local->rssi), results /* Note : with or without the (local->rssi), results
* are somewhat different. - Jean II */ * are somewhat different. - Jean II */
range->avg_qual.qual = 6; range->avg_qual.qual = airo_get_avg_quality(&cap_rid);
if (local->rssi) if (local->rssi)
range->avg_qual.level = 186; /* -70 dBm */ range->avg_qual.level = 186; /* -70 dBm */
else else
...@@ -7113,6 +7127,7 @@ static void airo_read_wireless_stats(struct airo_info *local) ...@@ -7113,6 +7127,7 @@ static void airo_read_wireless_stats(struct airo_info *local)
{ {
StatusRid status_rid; StatusRid status_rid;
StatsRid stats_rid; StatsRid stats_rid;
CapabilityRid cap_rid;
u32 *vals = stats_rid.vals; u32 *vals = stats_rid.vals;
/* Get stats out of the card */ /* Get stats out of the card */
...@@ -7121,6 +7136,7 @@ static void airo_read_wireless_stats(struct airo_info *local) ...@@ -7121,6 +7136,7 @@ static void airo_read_wireless_stats(struct airo_info *local)
up(&local->sem); up(&local->sem);
return; return;
} }
readCapabilityRid(local, &cap_rid, 0);
readStatusRid(local, &status_rid, 0); readStatusRid(local, &status_rid, 0);
readStatsRid(local, &stats_rid, RID_STATS, 0); readStatsRid(local, &stats_rid, RID_STATS, 0);
up(&local->sem); up(&local->sem);
...@@ -7129,7 +7145,7 @@ static void airo_read_wireless_stats(struct airo_info *local) ...@@ -7129,7 +7145,7 @@ static void airo_read_wireless_stats(struct airo_info *local)
local->wstats.status = status_rid.mode; local->wstats.status = status_rid.mode;
/* Signal quality and co. But where is the noise level ??? */ /* Signal quality and co. But where is the noise level ??? */
local->wstats.qual.qual = status_rid.signalQuality; local->wstats.qual.qual = airo_get_quality(&status_rid, &cap_rid);
if (local->rssi) if (local->rssi)
local->wstats.qual.level = 0x100 - local->rssi[status_rid.sigQuality].rssidBm; local->wstats.qual.level = 0x100 - local->rssi[status_rid.sigQuality].rssidBm;
else else
...@@ -7156,12 +7172,14 @@ struct iw_statistics *airo_get_wireless_stats(struct net_device *dev) ...@@ -7156,12 +7172,14 @@ struct iw_statistics *airo_get_wireless_stats(struct net_device *dev)
{ {
struct airo_info *local = dev->priv; struct airo_info *local = dev->priv;
/* Get stats out of the card if available */ if (!test_bit(JOB_WSTATS, &local->flags)) {
if (down_trylock(&local->sem) != 0) { /* Get stats out of the card if available */
set_bit(JOB_WSTATS, &local->flags); if (down_trylock(&local->sem) != 0) {
wake_up_interruptible(&local->thr_wait); set_bit(JOB_WSTATS, &local->flags);
} else wake_up_interruptible(&local->thr_wait);
airo_read_wireless_stats(local); } else
airo_read_wireless_stats(local);
}
return &local->wstats; return &local->wstats;
} }
...@@ -7188,9 +7206,11 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) { ...@@ -7188,9 +7206,11 @@ static int readrids(struct net_device *dev, aironet_ioctl *comp) {
{ {
case AIROGCAP: ridcode = RID_CAPABILITIES; break; case AIROGCAP: ridcode = RID_CAPABILITIES; break;
case AIROGCFG: ridcode = RID_CONFIG; case AIROGCFG: ridcode = RID_CONFIG;
disable_MAC (ai, 1); if (test_bit(FLAG_COMMIT, &ai->flags)) {
writeConfigRid (ai, 1); disable_MAC (ai, 1);
enable_MAC (ai, &rsp, 1); writeConfigRid (ai, 1);
enable_MAC (ai, &rsp, 1);
}
break; break;
case AIROGSLIST: ridcode = RID_SSID; break; case AIROGSLIST: ridcode = RID_SSID; break;
case AIROGVLIST: ridcode = RID_APLIST; break; case AIROGVLIST: ridcode = RID_APLIST; break;
...@@ -7270,6 +7290,7 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) { ...@@ -7270,6 +7290,7 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) {
case AIROPCAP: ridcode = RID_CAPABILITIES; break; case AIROPCAP: ridcode = RID_CAPABILITIES; break;
case AIROPAPLIST: ridcode = RID_APLIST; break; case AIROPAPLIST: ridcode = RID_APLIST; break;
case AIROPCFG: ai->config.len = 0; case AIROPCFG: ai->config.len = 0;
clear_bit(FLAG_COMMIT, &ai->flags);
ridcode = RID_CONFIG; break; ridcode = RID_CONFIG; break;
case AIROPWEPKEYNV: ridcode = RID_WEP_PERM; break; case AIROPWEPKEYNV: ridcode = RID_WEP_PERM; break;
case AIROPLEAPUSR: ridcode = RID_LEAPUSERNAME; break; case AIROPLEAPUSR: ridcode = RID_LEAPUSERNAME; break;
......
...@@ -1309,7 +1309,7 @@ static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up, int channel) ...@@ -1309,7 +1309,7 @@ static int __init sunsu_kbd_ms_init(struct uart_sunsu_port *up, int channel)
#ifdef CONFIG_SERIO #ifdef CONFIG_SERIO
up->serio = serio = kmalloc(sizeof(struct serio), GFP_KERNEL); up->serio = serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (serio) { if (serio) {
memset(serio, 0, sizeof(serio)); memset(serio, 0, sizeof(*serio));
serio->port_data = up; serio->port_data = up;
......
...@@ -1556,8 +1556,7 @@ static void __init sunzilog_register_serio(struct uart_sunzilog_port *up, int ch ...@@ -1556,8 +1556,7 @@ static void __init sunzilog_register_serio(struct uart_sunzilog_port *up, int ch
up->serio = serio = kmalloc(sizeof(struct serio), GFP_KERNEL); up->serio = serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
if (serio) { if (serio) {
memset(serio, 0, sizeof(*serio));
memset(serio, 0, sizeof(serio));
serio->port_data = up; serio->port_data = up;
......
...@@ -86,7 +86,7 @@ flush_tlb(void) ...@@ -86,7 +86,7 @@ flush_tlb(void)
static inline void static inline void
flush_tlb_other(struct mm_struct *mm) flush_tlb_other(struct mm_struct *mm)
{ {
long *mmc = &mm->context[smp_processor_id()]; unsigned long *mmc = &mm->context[smp_processor_id()];
/* Check it's not zero first to avoid cacheline ping pong /* Check it's not zero first to avoid cacheline ping pong
when possible. */ when possible. */
if (*mmc) *mmc = 0; if (*mmc) *mmc = 0;
......
...@@ -618,7 +618,7 @@ static inline long read(int fd, char * buf, size_t nr) ...@@ -618,7 +618,7 @@ static inline long read(int fd, char * buf, size_t nr)
return sys_read(fd, buf, nr); return sys_read(fd, buf, nr);
} }
extern long execve(char *, char **, char **); extern int execve(char *, char **, char **);
static inline long setsid(void) static inline long setsid(void)
{ {
......
...@@ -71,35 +71,35 @@ extern unsigned long pci_io_base; ...@@ -71,35 +71,35 @@ extern unsigned long pci_io_base;
static inline unsigned char __raw_readb(const volatile void __iomem *addr) static inline unsigned char __raw_readb(const volatile void __iomem *addr)
{ {
return *(unsigned char __force *)addr; return *(volatile unsigned char __force *)addr;
} }
static inline unsigned short __raw_readw(const volatile void __iomem *addr) static inline unsigned short __raw_readw(const volatile void __iomem *addr)
{ {
return *(unsigned short __force *)addr; return *(volatile unsigned short __force *)addr;
} }
static inline unsigned int __raw_readl(const volatile void __iomem *addr) static inline unsigned int __raw_readl(const volatile void __iomem *addr)
{ {
return *(unsigned int __force *)addr; return *(volatile unsigned int __force *)addr;
} }
static inline unsigned long __raw_readq(const volatile void __iomem *addr) static inline unsigned long __raw_readq(const volatile void __iomem *addr)
{ {
return *(unsigned long __force *)addr; return *(volatile unsigned long __force *)addr;
} }
static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr) static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr)
{ {
*(unsigned char __force *)addr = v; *(volatile unsigned char __force *)addr = v;
} }
static inline void __raw_writew(unsigned short v, volatile void __iomem *addr) static inline void __raw_writew(unsigned short v, volatile void __iomem *addr)
{ {
*(unsigned short __force *)addr = v; *(volatile unsigned short __force *)addr = v;
} }
static inline void __raw_writel(unsigned int v, volatile void __iomem *addr) static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
{ {
*(unsigned int __force *)addr = v; *(volatile unsigned int __force *)addr = v;
} }
static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
{ {
*(unsigned long __force *)addr = v; *(volatile unsigned long __force *)addr = v;
} }
#define readb(addr) eeh_readb(addr) #define readb(addr) eeh_readb(addr)
#define readw(addr) eeh_readw(addr) #define readw(addr) eeh_readw(addr)
......
...@@ -160,11 +160,11 @@ asmlinkage long sys_kexec_load(void *entry, unsigned long nr_segments, ...@@ -160,11 +160,11 @@ asmlinkage long sys_kexec_load(void *entry, unsigned long nr_segments,
asmlinkage long sys_exit(int error_code); asmlinkage long sys_exit(int error_code);
asmlinkage void sys_exit_group(int error_code); asmlinkage void sys_exit_group(int error_code);
asmlinkage long sys_wait4(pid_t pid, unsigned int __user *stat_addr, asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
int options, struct rusage __user *ru); int options, struct rusage __user *ru);
asmlinkage long sys_waitid(int which, pid_t pid, asmlinkage long sys_waitid(int which, pid_t pid,
struct siginfo __user *infop, int options); struct siginfo __user *infop, int options);
asmlinkage long sys_waitpid(pid_t pid, unsigned int __user *stat_addr, int options); asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options);
asmlinkage long sys_set_tid_address(int __user *tidptr); asmlinkage long sys_set_tid_address(int __user *tidptr);
asmlinkage long sys_futex(u32 __user *uaddr, int op, int val, asmlinkage long sys_futex(u32 __user *uaddr, int op, int val,
struct timespec __user *utime, u32 __user *uaddr2, struct timespec __user *utime, u32 __user *uaddr2,
......
...@@ -1401,8 +1401,8 @@ asmlinkage long sys_waitid(int which, pid_t pid, ...@@ -1401,8 +1401,8 @@ asmlinkage long sys_waitid(int which, pid_t pid,
return do_wait(pid, options, infop, NULL, ru); return do_wait(pid, options, infop, NULL, ru);
} }
asmlinkage long sys_wait4(pid_t pid, unsigned int __user *stat_addr, asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
int options, struct rusage __user *ru) int options, struct rusage __user *ru)
{ {
if (options & ~(WNOHANG|WUNTRACED|__WNOTHREAD|__WCLONE|__WALL)) if (options & ~(WNOHANG|WUNTRACED|__WNOTHREAD|__WCLONE|__WALL))
return -EINVAL; return -EINVAL;
...@@ -1415,7 +1415,7 @@ asmlinkage long sys_wait4(pid_t pid, unsigned int __user *stat_addr, ...@@ -1415,7 +1415,7 @@ asmlinkage long sys_wait4(pid_t pid, unsigned int __user *stat_addr,
* sys_waitpid() remains for compatibility. waitpid() should be * sys_waitpid() remains for compatibility. waitpid() should be
* implemented by calling sys_wait4() from libc.a. * implemented by calling sys_wait4() from libc.a.
*/ */
asmlinkage long sys_waitpid(pid_t pid, unsigned __user *stat_addr, int options) asmlinkage long sys_waitpid(pid_t pid, int __user *stat_addr, int options)
{ {
return sys_wait4(pid, stat_addr, options, NULL); return sys_wait4(pid, stat_addr, options, NULL);
} }
......
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