#define TMCS 0x64
#define TEPR 0x65
+/*
+ * FIXME: DAR here clashed with asm-ppc/reg.h and asm-sh/.../dma.h
+ */
+#undef DAR
/* DMA Controller Register macros */
#define DAR 0x80
#define DARL 0x80
/* ioctl handlers */
-static int get_stats(SLMP_INFO *info, struct mgsl_icount *user_icount);
-static int get_params(SLMP_INFO *info, MGSL_PARAMS *params);
-static int set_params(SLMP_INFO *info, MGSL_PARAMS *params);
-static int get_txidle(SLMP_INFO *info, int*idle_mode);
+static int get_stats(SLMP_INFO *info, struct mgsl_icount __user *user_icount);
+static int get_params(SLMP_INFO *info, MGSL_PARAMS __user *params);
+static int set_params(SLMP_INFO *info, MGSL_PARAMS __user *params);
+static int get_txidle(SLMP_INFO *info, int __user *idle_mode);
static int set_txidle(SLMP_INFO *info, int idle_mode);
static int tx_enable(SLMP_INFO *info, int enable);
static int tx_abort(SLMP_INFO *info);
static int rx_enable(SLMP_INFO *info, int enable);
static int map_status(int signals);
static int modem_input_wait(SLMP_INFO *info,int arg);
-static int wait_mgsl_event(SLMP_INFO *info, int *mask_ptr);
+static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr);
static int tiocmget(struct tty_struct *tty, struct file *file);
static int tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear);
* This allows remote debugging of dynamically loadable modules.
*/
static void* synclinkmp_get_text_ptr(void);
-static void* synclinkmp_get_text_ptr() {return synclinkmp_get_text_ptr;}
+static void* synclinkmp_get_text_ptr(void) {return synclinkmp_get_text_ptr;}
static inline int sanity_check(SLMP_INFO *info,
char *name, const char *routine)
cleanup:
if (retval) {
if (tty->count == 1)
- info->tty = 0; /* tty layer will release tty struct */
+ info->tty = NULL;/* tty layer will release tty struct */
if(info->count)
info->count--;
}
shutdown(info);
tty->closing = 0;
- info->tty = 0;
+ info->tty = NULL;
if (info->blocked_open) {
if (info->close_delay) {
info->count = 0;
info->flags &= ~ASYNC_NORMAL_ACTIVE;
- info->tty = 0;
+ info->tty = NULL;
wake_up_interruptible(&info->open_wait);
}
SLMP_INFO *info = (SLMP_INFO *)tty->driver_data;
int error;
struct mgsl_icount cnow; /* kernel counter temps */
- struct serial_icounter_struct *p_cuser; /* user space */
+ struct serial_icounter_struct __user *p_cuser; /* user space */
unsigned long flags;
+ void __user *argp = (void __user *)arg;
if (debug_level >= DEBUG_LEVEL_INFO)
printk("%s(%d):%s ioctl() cmd=%08X\n", __FILE__,__LINE__,
switch (cmd) {
case MGSL_IOCGPARAMS:
- return get_params(info,(MGSL_PARAMS *)arg);
+ return get_params(info, argp);
case MGSL_IOCSPARAMS:
- return set_params(info,(MGSL_PARAMS *)arg);
+ return set_params(info, argp);
case MGSL_IOCGTXIDLE:
- return get_txidle(info,(int*)arg);
+ return get_txidle(info, argp);
case MGSL_IOCSTXIDLE:
- return set_txidle(info,(int)arg);
+ return set_txidle(info, (int)arg);
case MGSL_IOCTXENABLE:
- return tx_enable(info,(int)arg);
+ return tx_enable(info, (int)arg);
case MGSL_IOCRXENABLE:
- return rx_enable(info,(int)arg);
+ return rx_enable(info, (int)arg);
case MGSL_IOCTXABORT:
return tx_abort(info);
case MGSL_IOCGSTATS:
- return get_stats(info,(struct mgsl_icount*)arg);
+ return get_stats(info, argp);
case MGSL_IOCWAITEVENT:
- return wait_mgsl_event(info,(int*)arg);
+ return wait_mgsl_event(info, argp);
case MGSL_IOCLOOPTXDONE:
return 0; // TODO: Not supported, need to document
/* Wait for modem input (DCD,RI,DSR,CTS) change
spin_lock_irqsave(&info->lock,flags);
cnow = info->icount;
spin_unlock_irqrestore(&info->lock,flags);
- p_cuser = (struct serial_icounter_struct *) arg;
+ p_cuser = argp;
PUT_USER(error,cnow.cts, &p_cuser->cts);
if (error) return error;
PUT_USER(error,cnow.dsr, &p_cuser->dsr);
if (info->tx_buf) {
kfree(info->tx_buf);
- info->tx_buf = 0;
+ info->tx_buf = NULL;
}
spin_lock_irqsave(&info->lock,flags);
program_hw(info);
}
-static int get_stats(SLMP_INFO * info, struct mgsl_icount *user_icount)
+static int get_stats(SLMP_INFO * info, struct mgsl_icount __user *user_icount)
{
int err;
return 0;
}
-static int get_params(SLMP_INFO * info, MGSL_PARAMS *user_params)
+static int get_params(SLMP_INFO * info, MGSL_PARAMS __user *user_params)
{
int err;
if (debug_level >= DEBUG_LEVEL_INFO)
return 0;
}
-static int set_params(SLMP_INFO * info, MGSL_PARAMS *new_params)
+static int set_params(SLMP_INFO * info, MGSL_PARAMS __user *new_params)
{
unsigned long flags;
MGSL_PARAMS tmp_params;
return 0;
}
-static int get_txidle(SLMP_INFO * info, int*idle_mode)
+static int get_txidle(SLMP_INFO * info, int __user *idle_mode)
{
int err;
/* wait for specified event to occur
*/
-static int wait_mgsl_event(SLMP_INFO * info, int * mask_ptr)
+static int wait_mgsl_event(SLMP_INFO * info, int __user *mask_ptr)
{
unsigned long flags;
int s;
if (info->memory_base){
iounmap(info->memory_base);
- info->memory_base = 0;
+ info->memory_base = NULL;
}
if (info->sca_base) {
iounmap(info->sca_base - info->sca_offset);
- info->sca_base=0;
+ info->sca_base=NULL;
}
if (info->statctrl_base) {
iounmap(info->statctrl_base - info->statctrl_offset);
- info->statctrl_base=0;
+ info->statctrl_base=NULL;
}
if (info->lcr_base){
iounmap(info->lcr_base - info->lcr_offset);
- info->lcr_base = 0;
+ info->lcr_base = NULL;
}
if ( debug_level >= DEBUG_LEVEL_INFO )
u32 speed = info->params.clock_speed;
info->params.clock_speed = 3686400;
- info->tty = 0;
+ info->tty = NULL;
/* assume failure */
info->init_error = DiagStatus_DmaFailure;