Commit d9ba9c91 authored by Tilman Schmidt's avatar Tilman Schmidt Committed by David S. Miller

gigaset: checkpatch cleanup

Dum sanctis checkpatch.pl'ae legibus obsequimur.

Impact: cosmetic
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2032e2c2
...@@ -108,7 +108,7 @@ int gigaset_enterconfigmode(struct cardstate *cs) ...@@ -108,7 +108,7 @@ int gigaset_enterconfigmode(struct cardstate *cs)
{ {
int i, r; int i, r;
cs->control_state = TIOCM_RTS; //FIXME cs->control_state = TIOCM_RTS;
r = setflags(cs, TIOCM_DTR, 200); r = setflags(cs, TIOCM_DTR, 200);
if (r < 0) if (r < 0)
...@@ -132,10 +132,10 @@ int gigaset_enterconfigmode(struct cardstate *cs) ...@@ -132,10 +132,10 @@ int gigaset_enterconfigmode(struct cardstate *cs)
error: error:
dev_err(cs->dev, "error %d on setuartbits\n", -r); dev_err(cs->dev, "error %d on setuartbits\n", -r);
cs->control_state = TIOCM_RTS|TIOCM_DTR; // FIXME is this a good value? cs->control_state = TIOCM_RTS|TIOCM_DTR;
cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR); cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR);
return -1; //r return -1;
} }
static int test_timeout(struct at_state_t *at_state) static int test_timeout(struct at_state_t *at_state)
...@@ -150,10 +150,9 @@ static int test_timeout(struct at_state_t *at_state) ...@@ -150,10 +150,9 @@ static int test_timeout(struct at_state_t *at_state)
} }
if (!gigaset_add_event(at_state->cs, at_state, EV_TIMEOUT, NULL, if (!gigaset_add_event(at_state->cs, at_state, EV_TIMEOUT, NULL,
at_state->timer_index, NULL)) { at_state->timer_index, NULL))
//FIXME what should we do? dev_err(at_state->cs->dev, "%s: out of memory\n",
} __func__);
return 1; return 1;
} }
...@@ -393,9 +392,8 @@ static void gigaset_freebcs(struct bc_state *bcs) ...@@ -393,9 +392,8 @@ static void gigaset_freebcs(struct bc_state *bcs)
int i; int i;
gig_dbg(DEBUG_INIT, "freeing bcs[%d]->hw", bcs->channel); gig_dbg(DEBUG_INIT, "freeing bcs[%d]->hw", bcs->channel);
if (!bcs->cs->ops->freebcshw(bcs)) { if (!bcs->cs->ops->freebcshw(bcs))
gig_dbg(DEBUG_INIT, "failed"); gig_dbg(DEBUG_INIT, "failed");
}
gig_dbg(DEBUG_INIT, "clearing bcs[%d]->at_state", bcs->channel); gig_dbg(DEBUG_INIT, "clearing bcs[%d]->at_state", bcs->channel);
clear_at_state(&bcs->at_state); clear_at_state(&bcs->at_state);
...@@ -503,8 +501,6 @@ void gigaset_freecs(struct cardstate *cs) ...@@ -503,8 +501,6 @@ void gigaset_freecs(struct cardstate *cs)
gig_dbg(DEBUG_INIT, "clearing hw"); gig_dbg(DEBUG_INIT, "clearing hw");
cs->ops->freecshw(cs); cs->ops->freecshw(cs);
//FIXME cmdbuf
/* fall through */ /* fall through */
case 2: /* error in initcshw */ case 2: /* error in initcshw */
/* Deregister from LL */ /* Deregister from LL */
...@@ -622,7 +618,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs, ...@@ -622,7 +618,7 @@ static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
{ {
int i; int i;
bcs->tx_skb = NULL; //FIXME -> hw part bcs->tx_skb = NULL;
skb_queue_head_init(&bcs->squeue); skb_queue_head_init(&bcs->squeue);
...@@ -696,12 +692,13 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, ...@@ -696,12 +692,13 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
int onechannel, int ignoreframes, int onechannel, int ignoreframes,
int cidmode, const char *modulename) int cidmode, const char *modulename)
{ {
struct cardstate *cs = NULL; struct cardstate *cs;
unsigned long flags; unsigned long flags;
int i; int i;
gig_dbg(DEBUG_INIT, "allocating cs"); gig_dbg(DEBUG_INIT, "allocating cs");
if (!(cs = alloc_cs(drv))) { cs = alloc_cs(drv);
if (!cs) {
pr_err("maximum number of devices exceeded\n"); pr_err("maximum number of devices exceeded\n");
return NULL; return NULL;
} }
...@@ -931,15 +928,13 @@ int gigaset_start(struct cardstate *cs) ...@@ -931,15 +928,13 @@ int gigaset_start(struct cardstate *cs)
cs->ops->baud_rate(cs, B115200); cs->ops->baud_rate(cs, B115200);
cs->ops->set_line_ctrl(cs, CS8); cs->ops->set_line_ctrl(cs, CS8);
cs->control_state = TIOCM_DTR|TIOCM_RTS; cs->control_state = TIOCM_DTR|TIOCM_RTS;
} else {
//FIXME use some saved values?
} }
cs->waiting = 1; cs->waiting = 1;
if (!gigaset_add_event(cs, &cs->at_state, EV_START, NULL, 0, NULL)) { if (!gigaset_add_event(cs, &cs->at_state, EV_START, NULL, 0, NULL)) {
cs->waiting = 0; cs->waiting = 0;
//FIXME what should we do? dev_err(cs->dev, "%s: out of memory\n", __func__);
goto error; goto error;
} }
...@@ -979,7 +974,7 @@ int gigaset_shutdown(struct cardstate *cs) ...@@ -979,7 +974,7 @@ int gigaset_shutdown(struct cardstate *cs)
cs->waiting = 1; cs->waiting = 1;
if (!gigaset_add_event(cs, &cs->at_state, EV_SHUTDOWN, NULL, 0, NULL)) { if (!gigaset_add_event(cs, &cs->at_state, EV_SHUTDOWN, NULL, 0, NULL)) {
//FIXME what should we do? dev_err(cs->dev, "%s: out of memory\n", __func__);
goto exit; goto exit;
} }
...@@ -1010,7 +1005,7 @@ void gigaset_stop(struct cardstate *cs) ...@@ -1010,7 +1005,7 @@ void gigaset_stop(struct cardstate *cs)
cs->waiting = 1; cs->waiting = 1;
if (!gigaset_add_event(cs, &cs->at_state, EV_STOP, NULL, 0, NULL)) { if (!gigaset_add_event(cs, &cs->at_state, EV_STOP, NULL, 0, NULL)) {
//FIXME what should we do? dev_err(cs->dev, "%s: out of memory\n", __func__);
goto exit; goto exit;
} }
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include <linux/list.h> #include <linux/list.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#define GIG_VERSION {0,5,0,0} #define GIG_VERSION {0, 5, 0, 0}
#define GIG_COMPAT {0,4,0,0} #define GIG_COMPAT {0, 4, 0, 0}
#define MAX_REC_PARAMS 10 /* Max. number of params in response string */ #define MAX_REC_PARAMS 10 /* Max. number of params in response string */
#define MAX_RESP_SIZE 512 /* Max. size of a response string */ #define MAX_RESP_SIZE 512 /* Max. size of a response string */
...@@ -133,35 +133,32 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, ...@@ -133,35 +133,32 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
#define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) #define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
#define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT) #define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
/* int-in-events 3070 */ /* interrupt pipe messages */
#define HD_B1_FLOW_CONTROL 0x80 #define HD_B1_FLOW_CONTROL 0x80
#define HD_B2_FLOW_CONTROL 0x81 #define HD_B2_FLOW_CONTROL 0x81
#define HD_RECEIVEATDATA_ACK (0x35) // 3070 #define HD_RECEIVEATDATA_ACK (0x35) /* 3070 */
// att: HD_RECEIVE>>AT<<DATA_ACK #define HD_READY_SEND_ATDATA (0x36) /* 3070 */
#define HD_READY_SEND_ATDATA (0x36) // 3070 #define HD_OPEN_ATCHANNEL_ACK (0x37) /* 3070 */
#define HD_OPEN_ATCHANNEL_ACK (0x37) // 3070 #define HD_CLOSE_ATCHANNEL_ACK (0x38) /* 3070 */
#define HD_CLOSE_ATCHANNEL_ACK (0x38) // 3070 #define HD_DEVICE_INIT_OK (0x11) /* ISurf USB + 3070 */
#define HD_DEVICE_INIT_OK (0x11) // ISurf USB + 3070 #define HD_OPEN_B1CHANNEL_ACK (0x51) /* ISurf USB + 3070 */
#define HD_OPEN_B1CHANNEL_ACK (0x51) // ISurf USB + 3070 #define HD_OPEN_B2CHANNEL_ACK (0x52) /* ISurf USB + 3070 */
#define HD_OPEN_B2CHANNEL_ACK (0x52) // ISurf USB + 3070 #define HD_CLOSE_B1CHANNEL_ACK (0x53) /* ISurf USB + 3070 */
#define HD_CLOSE_B1CHANNEL_ACK (0x53) // ISurf USB + 3070 #define HD_CLOSE_B2CHANNEL_ACK (0x54) /* ISurf USB + 3070 */
#define HD_CLOSE_B2CHANNEL_ACK (0x54) // ISurf USB + 3070 #define HD_SUSPEND_END (0x61) /* ISurf USB */
// Powermangment #define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) /* ISurf USB + 3070 */
#define HD_SUSPEND_END (0x61) // ISurf USB
// Configuration /* control requests */
#define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) // ISurf USB + 3070 #define HD_OPEN_B1CHANNEL (0x23) /* ISurf USB + 3070 */
#define HD_CLOSE_B1CHANNEL (0x24) /* ISurf USB + 3070 */
/* control requests 3070 */ #define HD_OPEN_B2CHANNEL (0x25) /* ISurf USB + 3070 */
#define HD_OPEN_B1CHANNEL (0x23) // ISurf USB + 3070 #define HD_CLOSE_B2CHANNEL (0x26) /* ISurf USB + 3070 */
#define HD_CLOSE_B1CHANNEL (0x24) // ISurf USB + 3070 #define HD_RESET_INTERRUPT_PIPE (0x27) /* ISurf USB + 3070 */
#define HD_OPEN_B2CHANNEL (0x25) // ISurf USB + 3070 #define HD_DEVICE_INIT_ACK (0x34) /* ISurf USB + 3070 */
#define HD_CLOSE_B2CHANNEL (0x26) // ISurf USB + 3070 #define HD_WRITE_ATMESSAGE (0x12) /* 3070 */
#define HD_RESET_INTERRUPT_PIPE (0x27) // ISurf USB + 3070 #define HD_READ_ATMESSAGE (0x13) /* 3070 */
#define HD_DEVICE_INIT_ACK (0x34) // ISurf USB + 3070 #define HD_OPEN_ATCHANNEL (0x28) /* 3070 */
#define HD_WRITE_ATMESSAGE (0x12) // 3070 #define HD_CLOSE_ATCHANNEL (0x29) /* 3070 */
#define HD_READ_ATMESSAGE (0x13) // 3070
#define HD_OPEN_ATCHANNEL (0x28) // 3070
#define HD_CLOSE_ATCHANNEL (0x29) // 3070
/* number of B channels supported by base driver */ /* number of B channels supported by base driver */
#define BAS_CHANNELS 2 #define BAS_CHANNELS 2
...@@ -631,7 +628,8 @@ struct gigaset_ops { ...@@ -631,7 +628,8 @@ struct gigaset_ops {
}; };
/* = Common structures and definitions ======================================= */ /* = Common structures and definitions =======================================
*/
/* Parser states for DLE-Event: /* Parser states for DLE-Event:
* <DLE-EVENT>: <DLE_FLAG> "X" <EVENT> <DLE_FLAG> "." * <DLE-EVENT>: <DLE_FLAG> "X" <EVENT> <DLE_FLAG> "."
...@@ -776,7 +774,7 @@ struct event_t *gigaset_add_event(struct cardstate *cs, ...@@ -776,7 +774,7 @@ struct event_t *gigaset_add_event(struct cardstate *cs,
void *ptr, int parameter, void *arg); void *ptr, int parameter, void *arg);
/* Called on CONFIG1 command from frontend. */ /* Called on CONFIG1 command from frontend. */
int gigaset_enterconfigmode(struct cardstate *cs); //0: success <0: errorcode int gigaset_enterconfigmode(struct cardstate *cs);
/* cs->lock must not be locked */ /* cs->lock must not be locked */
static inline void gigaset_schedule_event(struct cardstate *cs) static inline void gigaset_schedule_event(struct cardstate *cs)
......
...@@ -39,12 +39,12 @@ ...@@ -39,12 +39,12 @@
static int writebuf_from_LL(int driverID, int channel, int ack, static int writebuf_from_LL(int driverID, int channel, int ack,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct cardstate *cs; struct cardstate *cs = gigaset_get_cs_by_id(driverID);
struct bc_state *bcs; struct bc_state *bcs;
unsigned char *ack_header; unsigned char *ack_header;
unsigned len; unsigned len;
if (!(cs = gigaset_get_cs_by_id(driverID))) { if (!cs) {
pr_err("%s: invalid driver ID (%d)\n", __func__, driverID); pr_err("%s: invalid driver ID (%d)\n", __func__, driverID);
return -ENODEV; return -ENODEV;
} }
...@@ -391,22 +391,19 @@ static int command_from_LL(isdn_ctrl *cntrl) ...@@ -391,22 +391,19 @@ static int command_from_LL(isdn_ctrl *cntrl)
break; break;
case ISDN_CMD_PROCEED: case ISDN_CMD_PROCEED:
gig_dbg(DEBUG_ANY, "ISDN_CMD_PROCEED"); //FIXME gig_dbg(DEBUG_ANY, "ISDN_CMD_PROCEED");
break; break;
case ISDN_CMD_ALERT: case ISDN_CMD_ALERT:
gig_dbg(DEBUG_ANY, "ISDN_CMD_ALERT"); //FIXME gig_dbg(DEBUG_ANY, "ISDN_CMD_ALERT");
if (cntrl->arg >= cs->channels) { if (cntrl->arg >= cs->channels) {
dev_err(cs->dev, dev_err(cs->dev,
"ISDN_CMD_ALERT: invalid channel (%d)\n", "ISDN_CMD_ALERT: invalid channel (%d)\n",
(int) cntrl->arg); (int) cntrl->arg);
return -EINVAL; return -EINVAL;
} }
//bcs = cs->bcs + cntrl->arg;
//bcs->proto2 = -1;
// FIXME
break; break;
case ISDN_CMD_REDIR: case ISDN_CMD_REDIR:
gig_dbg(DEBUG_ANY, "ISDN_CMD_REDIR"); //FIXME gig_dbg(DEBUG_ANY, "ISDN_CMD_REDIR");
break; break;
case ISDN_CMD_PROT_IO: case ISDN_CMD_PROT_IO:
gig_dbg(DEBUG_ANY, "ISDN_CMD_PROT_IO"); gig_dbg(DEBUG_ANY, "ISDN_CMD_PROT_IO");
...@@ -486,7 +483,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state) ...@@ -486,7 +483,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
/* fill ICALL structure */ /* fill ICALL structure */
response.parm.setup.si1 = 0; /* default: unknown */ response.parm.setup.si1 = 0; /* default: unknown */
response.parm.setup.si2 = 0; response.parm.setup.si2 = 0;
response.parm.setup.screen = 0; //FIXME how to set these? response.parm.setup.screen = 0;
response.parm.setup.plan = 0; response.parm.setup.plan = 0;
if (!at_state->str_var[STR_ZBC]) { if (!at_state->str_var[STR_ZBC]) {
/* no BC (internal call): assume speech, A-law */ /* no BC (internal call): assume speech, A-law */
...@@ -507,26 +504,24 @@ int gigaset_isdn_icall(struct at_state_t *at_state) ...@@ -507,26 +504,24 @@ int gigaset_isdn_icall(struct at_state_t *at_state)
return ICALL_IGNORE; return ICALL_IGNORE;
} }
if (at_state->str_var[STR_NMBR]) { if (at_state->str_var[STR_NMBR]) {
strncpy(response.parm.setup.phone, at_state->str_var[STR_NMBR], strlcpy(response.parm.setup.phone, at_state->str_var[STR_NMBR],
sizeof response.parm.setup.phone - 1); sizeof response.parm.setup.phone);
response.parm.setup.phone[sizeof response.parm.setup.phone - 1] = 0;
} else } else
response.parm.setup.phone[0] = 0; response.parm.setup.phone[0] = 0;
if (at_state->str_var[STR_ZCPN]) { if (at_state->str_var[STR_ZCPN]) {
strncpy(response.parm.setup.eazmsn, at_state->str_var[STR_ZCPN], strlcpy(response.parm.setup.eazmsn, at_state->str_var[STR_ZCPN],
sizeof response.parm.setup.eazmsn - 1); sizeof response.parm.setup.eazmsn);
response.parm.setup.eazmsn[sizeof response.parm.setup.eazmsn - 1] = 0;
} else } else
response.parm.setup.eazmsn[0] = 0; response.parm.setup.eazmsn[0] = 0;
if (!bcs) { if (!bcs) {
dev_notice(cs->dev, "no channel for incoming call\n"); dev_notice(cs->dev, "no channel for incoming call\n");
response.command = ISDN_STAT_ICALLW; response.command = ISDN_STAT_ICALLW;
response.arg = 0; //FIXME response.arg = 0;
} else { } else {
gig_dbg(DEBUG_CMD, "Sending ICALL"); gig_dbg(DEBUG_CMD, "Sending ICALL");
response.command = ISDN_STAT_ICALL; response.command = ISDN_STAT_ICALL;
response.arg = bcs->channel; //FIXME response.arg = bcs->channel;
} }
response.driver = cs->myid; response.driver = cs->myid;
retval = iif->statcallb(&response); retval = iif->statcallb(&response);
......
...@@ -162,7 +162,7 @@ static int if_open(struct tty_struct *tty, struct file *filp) ...@@ -162,7 +162,7 @@ static int if_open(struct tty_struct *tty, struct file *filp)
return -ENODEV; return -ENODEV;
if (mutex_lock_interruptible(&cs->mutex)) if (mutex_lock_interruptible(&cs->mutex))
return -ERESTARTSYS; // FIXME -EINTR? return -ERESTARTSYS;
tty->driver_data = cs; tty->driver_data = cs;
++cs->open_count; ++cs->open_count;
...@@ -171,7 +171,7 @@ static int if_open(struct tty_struct *tty, struct file *filp) ...@@ -171,7 +171,7 @@ static int if_open(struct tty_struct *tty, struct file *filp)
spin_lock_irqsave(&cs->lock, flags); spin_lock_irqsave(&cs->lock, flags);
cs->tty = tty; cs->tty = tty;
spin_unlock_irqrestore(&cs->lock, flags); spin_unlock_irqrestore(&cs->lock, flags);
tty->low_latency = 1; //FIXME test tty->low_latency = 1;
} }
mutex_unlock(&cs->mutex); mutex_unlock(&cs->mutex);
...@@ -228,7 +228,7 @@ static int if_ioctl(struct tty_struct *tty, struct file *file, ...@@ -228,7 +228,7 @@ static int if_ioctl(struct tty_struct *tty, struct file *file,
gig_dbg(DEBUG_IF, "%u: %s(0x%x)", cs->minor_index, __func__, cmd); gig_dbg(DEBUG_IF, "%u: %s(0x%x)", cs->minor_index, __func__, cmd);
if (mutex_lock_interruptible(&cs->mutex)) if (mutex_lock_interruptible(&cs->mutex))
return -ERESTARTSYS; // FIXME -EINTR? return -ERESTARTSYS;
if (!cs->connected) { if (!cs->connected) {
gig_dbg(DEBUG_IF, "not connected"); gig_dbg(DEBUG_IF, "not connected");
...@@ -299,9 +299,8 @@ static int if_tiocmget(struct tty_struct *tty, struct file *file) ...@@ -299,9 +299,8 @@ static int if_tiocmget(struct tty_struct *tty, struct file *file)
gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__);
if (mutex_lock_interruptible(&cs->mutex)) if (mutex_lock_interruptible(&cs->mutex))
return -ERESTARTSYS; // FIXME -EINTR? return -ERESTARTSYS;
// FIXME read from device?
retval = cs->control_state & (TIOCM_RTS|TIOCM_DTR); retval = cs->control_state & (TIOCM_RTS|TIOCM_DTR);
mutex_unlock(&cs->mutex); mutex_unlock(&cs->mutex);
...@@ -326,7 +325,7 @@ static int if_tiocmset(struct tty_struct *tty, struct file *file, ...@@ -326,7 +325,7 @@ static int if_tiocmset(struct tty_struct *tty, struct file *file,
cs->minor_index, __func__, set, clear); cs->minor_index, __func__, set, clear);
if (mutex_lock_interruptible(&cs->mutex)) if (mutex_lock_interruptible(&cs->mutex))
return -ERESTARTSYS; // FIXME -EINTR? return -ERESTARTSYS;
if (!cs->connected) { if (!cs->connected) {
gig_dbg(DEBUG_IF, "not connected"); gig_dbg(DEBUG_IF, "not connected");
...@@ -356,7 +355,7 @@ static int if_write(struct tty_struct *tty, const unsigned char *buf, int count) ...@@ -356,7 +355,7 @@ static int if_write(struct tty_struct *tty, const unsigned char *buf, int count)
gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__);
if (mutex_lock_interruptible(&cs->mutex)) if (mutex_lock_interruptible(&cs->mutex))
return -ERESTARTSYS; // FIXME -EINTR? return -ERESTARTSYS;
if (!cs->connected) { if (!cs->connected) {
gig_dbg(DEBUG_IF, "not connected"); gig_dbg(DEBUG_IF, "not connected");
...@@ -390,7 +389,7 @@ static int if_write_room(struct tty_struct *tty) ...@@ -390,7 +389,7 @@ static int if_write_room(struct tty_struct *tty)
gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__);
if (mutex_lock_interruptible(&cs->mutex)) if (mutex_lock_interruptible(&cs->mutex))
return -ERESTARTSYS; // FIXME -EINTR? return -ERESTARTSYS;
if (!cs->connected) { if (!cs->connected) {
gig_dbg(DEBUG_IF, "not connected"); gig_dbg(DEBUG_IF, "not connected");
...@@ -455,9 +454,8 @@ static void if_throttle(struct tty_struct *tty) ...@@ -455,9 +454,8 @@ static void if_throttle(struct tty_struct *tty)
gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */ gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */
else if (!cs->open_count) else if (!cs->open_count)
dev_warn(cs->dev, "%s: device not opened\n", __func__); dev_warn(cs->dev, "%s: device not opened\n", __func__);
else { else
//FIXME gig_dbg(DEBUG_ANY, "%s: not implemented\n", __func__);
}
mutex_unlock(&cs->mutex); mutex_unlock(&cs->mutex);
} }
...@@ -480,9 +478,8 @@ static void if_unthrottle(struct tty_struct *tty) ...@@ -480,9 +478,8 @@ static void if_unthrottle(struct tty_struct *tty)
gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */ gig_dbg(DEBUG_IF, "not connected"); /* nothing to do */
else if (!cs->open_count) else if (!cs->open_count)
dev_warn(cs->dev, "%s: device not opened\n", __func__); dev_warn(cs->dev, "%s: device not opened\n", __func__);
else { else
//FIXME gig_dbg(DEBUG_ANY, "%s: not implemented\n", __func__);
}
mutex_unlock(&cs->mutex); mutex_unlock(&cs->mutex);
} }
...@@ -515,10 +512,9 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old) ...@@ -515,10 +512,9 @@ static void if_set_termios(struct tty_struct *tty, struct ktermios *old)
goto out; goto out;
} }
// stolen from mct_u232.c
iflag = tty->termios->c_iflag; iflag = tty->termios->c_iflag;
cflag = tty->termios->c_cflag; cflag = tty->termios->c_cflag;
old_cflag = old ? old->c_cflag : cflag; //FIXME? old_cflag = old ? old->c_cflag : cflag;
gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x", gig_dbg(DEBUG_IF, "%u: iflag %x cflag %x old %x",
cs->minor_index, iflag, cflag, old_cflag); cs->minor_index, iflag, cflag, old_cflag);
...@@ -632,7 +628,8 @@ void gigaset_if_receive(struct cardstate *cs, ...@@ -632,7 +628,8 @@ void gigaset_if_receive(struct cardstate *cs,
struct tty_struct *tty; struct tty_struct *tty;
spin_lock_irqsave(&cs->lock, flags); spin_lock_irqsave(&cs->lock, flags);
if ((tty = cs->tty) == NULL) tty = cs->tty;
if (tty == NULL)
gig_dbg(DEBUG_ANY, "receive on closed device"); gig_dbg(DEBUG_ANY, "receive on closed device");
else { else {
tty_buffer_request_room(tty, len); tty_buffer_request_room(tty, len);
...@@ -659,9 +656,9 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname, ...@@ -659,9 +656,9 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
drv->have_tty = 0; drv->have_tty = 0;
if ((drv->tty = alloc_tty_driver(minors)) == NULL) drv->tty = tty = alloc_tty_driver(minors);
if (tty == NULL)
goto enomem; goto enomem;
tty = drv->tty;
tty->magic = TTY_DRIVER_MAGIC, tty->magic = TTY_DRIVER_MAGIC,
tty->major = GIG_MAJOR, tty->major = GIG_MAJOR,
...@@ -676,8 +673,8 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname, ...@@ -676,8 +673,8 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
tty->owner = THIS_MODULE; tty->owner = THIS_MODULE;
tty->init_termios = tty_std_termios; //FIXME tty->init_termios = tty_std_termios;
tty->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; //FIXME tty->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
tty_set_operations(tty, &if_ops); tty_set_operations(tty, &if_ops);
ret = tty_register_driver(tty); ret = tty_register_driver(tty);
......
...@@ -39,7 +39,7 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, ...@@ -39,7 +39,7 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr,
return -EINVAL; return -EINVAL;
if (mutex_lock_interruptible(&cs->mutex)) if (mutex_lock_interruptible(&cs->mutex))
return -ERESTARTSYS; // FIXME -EINTR? return -ERESTARTSYS;
cs->waiting = 1; cs->waiting = 1;
if (!gigaset_add_event(cs, &cs->at_state, EV_PROC_CIDMODE, if (!gigaset_add_event(cs, &cs->at_state, EV_PROC_CIDMODE,
......
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