diff options
Diffstat (limited to 'net/irda')
-rw-r--r-- | net/irda/af_irda.c | 83 | ||||
-rw-r--r-- | net/irda/discovery.c | 3 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_core.c | 10 | ||||
-rw-r--r-- | net/irda/irda_device.c | 22 | ||||
-rw-r--r-- | net/irda/iriap.c | 36 | ||||
-rw-r--r-- | net/irda/irlan/irlan_common.c | 6 | ||||
-rw-r--r-- | net/irda/irlap.c | 35 | ||||
-rw-r--r-- | net/irda/irlap_event.c | 47 | ||||
-rw-r--r-- | net/irda/irlap_frame.c | 4 | ||||
-rw-r--r-- | net/irda/irlmp.c | 7 | ||||
-rw-r--r-- | net/irda/irmod.c | 2 | ||||
-rw-r--r-- | net/irda/irproc.c | 22 | ||||
-rw-r--r-- | net/irda/irttp.c | 4 | ||||
-rw-r--r-- | net/irda/parameters.c | 5 | ||||
-rw-r--r-- | net/irda/qos.c | 4 |
15 files changed, 158 insertions, 132 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index ed9aa5f52..19bbae258 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -107,7 +107,7 @@ static void irda_disconnect_indication(void *instance, void *sap, return; sk->state = TCP_CLOSE; - sk->err = reason; + sk->err = ECONNRESET; sk->shutdown |= SEND_SHUTDOWN; if (!sk->dead) { sk->state_change(sk); @@ -341,6 +341,11 @@ static void irda_discovery_indication(hashbin_t *log) static int irda_open_tsap(struct irda_sock *self, __u8 tsap_sel, char *name) { notify_t notify; + + if (self->tsap) { + WARNING(__FUNCTION__ "(), busy!\n"); + return -EBUSY; + } /* Initialize callbacks to be used by the IrDA stack */ irda_notify_init(¬ify); @@ -356,7 +361,7 @@ static int irda_open_tsap(struct irda_sock *self, __u8 tsap_sel, char *name) ¬ify); if (self->tsap == NULL) { IRDA_DEBUG( 0, __FUNCTION__ "(), Unable to allocate TSAP!\n"); - return -1; + return -ENOMEM; } /* Remember which TSAP selector we actually got */ self->stsap_sel = self->tsap->stsap_sel; @@ -437,10 +442,12 @@ static int irda_getname(struct socket *sock, struct sockaddr *uaddr, * Just move to the listen state * */ -static int irda_listen( struct socket *sock, int backlog) +static int irda_listen(struct socket *sock, int backlog) { struct sock *sk = sock->sk; + IRDA_DEBUG(0, __FUNCTION__ "()\n"); + if (sk->type == SOCK_STREAM && sk->state != TCP_LISTEN) { sk->max_ack_backlog = backlog; sk->state = TCP_LISTEN; @@ -465,6 +472,8 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) __u16 hints = 0; int err; + IRDA_DEBUG(0, __FUNCTION__ "()\n"); + self = sk->protinfo.irda; ASSERT(self != NULL, return -1;); @@ -474,7 +483,7 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name); if (err < 0) - return -ENOMEM; + return err; /* Register with LM-IAS */ self->ias_obj = irias_new_object(addr->sir_name, jiffies); @@ -597,6 +606,8 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr, struct irda_sock *self; int err; + IRDA_DEBUG(0, __FUNCTION__ "()\n"); + self = sk->protinfo.irda; if (sk->state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { @@ -826,6 +837,9 @@ static int irda_sendmsg(struct socket *sock, struct msghdr *msg, int len, return -EPIPE; } + if (sk->state != TCP_ESTABLISHED) + return -ENOTCONN; + self = sk->protinfo.irda; ASSERT(self != NULL, return -1;); @@ -969,11 +983,6 @@ static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg, msg->msg_namelen = 0; - /* Lock the socket to prevent queue disordering - * while sleeps in memcpy_tomsg - */ -/* down(&self->readsem); */ - do { int chunk; struct sk_buff *skb; @@ -988,32 +997,20 @@ static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg, */ if (sk->err) { - /* up(&self->readsem); */ return sock_error(sk); } if (sk->shutdown & RCV_SHUTDOWN) break; - /* up(&self->readsem); */ - if (noblock) return -EAGAIN; irda_data_wait(sk); if (signal_pending(current)) return -ERESTARTSYS; - /* down(&self->readsem); */ continue; } - /* Never glue messages from different writers */ -/* if (check_creds && */ -/* memcmp(UNIXCREDS(skb), &scm->creds, sizeof(scm->creds)) != 0) */ -/* { */ -/* skb_queue_head(&sk->receive_queue, skb); */ -/* break; */ -/* } */ - chunk = min(skb->len, size); if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { skb_queue_head(&sk->receive_queue, skb); @@ -1024,17 +1021,10 @@ static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg, copied += chunk; size -= chunk; - /* Copy credentials */ -/* scm->creds = *UNIXCREDS(skb); */ -/* check_creds = 1; */ - /* Mark read part of skb as used */ if (!(flags & MSG_PEEK)) { skb_pull(skb, chunk); -/* if (UNIXCB(skb).fp) */ -/* unix_detach_fds(scm, skb); */ - /* put the skb back if we didn't use it up.. */ if (skb->len) { IRDA_DEBUG(1, __FUNCTION__ "(), back on q!\n"); @@ -1042,15 +1032,9 @@ static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg, break; } - kfree_skb(skb); - -/* if (scm->fp) */ -/* break; */ + kfree_skb(skb); } else { IRDA_DEBUG(0, __FUNCTION__ "() questionable!?\n"); - /* It is questionable, see note in unix_dgram_recvmsg. */ -/* if (UNIXCB(skb).fp) */ -/* scm->fp = scm_fp_dup(UNIXCB(skb).fp); */ /* put message back and return */ skb_queue_head(&sk->receive_queue, skb); @@ -1072,8 +1056,6 @@ static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg, } } - /* up(&self->readsem); */ - return copied; } @@ -1083,12 +1065,30 @@ static int irda_recvmsg_stream(struct socket *sock, struct msghdr *msg, * * */ -static int irda_shutdown( struct socket *sk, int how) +static int irda_shutdown(struct socket *sock, int how) { + struct irda_sock *self; + struct sock *sk = sock->sk; + IRDA_DEBUG( 0, __FUNCTION__ "()\n"); - /* FIXME - generate DM and RNR states */ - return -EOPNOTSUPP; + self = sk->protinfo.irda; + ASSERT(self != NULL, return -1;); + + sk->state = TCP_CLOSE; + sk->shutdown |= SEND_SHUTDOWN; + sk->state_change(sk); + + if (self->iriap) + iriap_close(self->iriap); + + if (self->tsap) { + irttp_disconnect_request(self->tsap, NULL, P_NORMAL); + irttp_close_tsap(self->tsap); + self->tsap = NULL; + } + + return 0; } /* @@ -1225,7 +1225,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname, switch (optname) { case IRLMP_IAS_SET: IRDA_DEBUG(0, __FUNCTION__ "(), sorry not impl. yet!\n"); - return 0; + return -ENOPROTOOPT; case IRTTP_MAX_SDU_SIZE: IRDA_DEBUG(2, __FUNCTION__ "(), setting max_sdu_size = %d\n", opt); self->max_sdu_size_rx = opt; @@ -1329,7 +1329,6 @@ static int irda_getsockopt(struct socket *sock, int level, int optname, break; case IRTTP_MAX_SDU_SIZE: val = self->max_data_size; - IRDA_DEBUG(2, __FUNCTION__ "(), getting max_sdu_size = %d\n", val); len = sizeof(int); if (put_user(len, optlen)) return -EFAULT; diff --git a/net/irda/discovery.c b/net/irda/discovery.c index 957426154..84d0239e3 100644 --- a/net/irda/discovery.c +++ b/net/irda/discovery.c @@ -209,8 +209,7 @@ __u32 irlmp_find_device(hashbin_t *cachelog, char *name, __u32 *saddr) * Print discovery information in /proc file system * */ -int discovery_proc_read(char *buf, char **start, off_t offset, int len, - int unused) +int discovery_proc_read(char *buf, char **start, off_t offset, int len) { discovery_t *discovery; unsigned long flags; diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index 379e342ad..ed45a509f 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c @@ -52,8 +52,7 @@ static void ircomm_control_indication(struct ircomm_cb *self, struct sk_buff *skb, int clen); #ifdef CONFIG_PROC_FS -static int ircomm_proc_read(char *buf, char **start, off_t offset, int len, - int unused); +static int ircomm_proc_read(char *buf, char **start, off_t offset, int len); extern struct proc_dir_entry *proc_irda; #endif /* CONFIG_PROC_FS */ @@ -69,7 +68,7 @@ int __init ircomm_init(void) } #ifdef CONFIG_PROC_FS - create_proc_entry("ircomm", 0, proc_irda)->get_info = ircomm_proc_read; + create_proc_info_entry("ircomm", 0, proc_irda, ircomm_proc_read); #endif /* CONFIG_PROC_FS */ MESSAGE("IrCOMM protocol (Dag Brattli)\n"); @@ -463,13 +462,12 @@ void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow) #ifdef CONFIG_PROC_FS /* - * Function ircomm_proc_read (buf, start, offset, len, unused) + * Function ircomm_proc_read (buf, start, offset, len) * * * */ -int ircomm_proc_read(char *buf, char **start, off_t offset, int len, - int unused) +int ircomm_proc_read(char *buf, char **start, off_t offset, int len) { struct ircomm_cb *self; unsigned long flags; diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index b4c6e6905..dd17e2dd3 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Sat Oct 9 09:22:27 1999 - * Modified at: Mon Oct 18 22:40:10 1999 + * Modified at: Tue Nov 16 12:54:13 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. @@ -204,6 +204,26 @@ int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts) return ret; } +int irda_device_change_speed(struct net_device *dev, __u32 speed) +{ + struct if_irda_req req; + int ret; + + IRDA_DEBUG(0, __FUNCTION__ "()\n"); + + if (!dev->do_ioctl) { + ERROR(__FUNCTION__ "(), do_ioctl not impl. by " + "device driver\n"); + return -1; + } + + req.ifr_baudrate = speed; + + ret = dev->do_ioctl(dev, (struct ifreq *) &req, SIOCSBANDWIDTH); + + return ret; +} + /* * Function irda_device_is_receiving (dev) * diff --git a/net/irda/iriap.c b/net/irda/iriap.c index bcd43e8c0..ad6c01183 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Thu Aug 21 00:02:07 1997 - * Modified at: Sun Oct 31 22:10:45 1999 + * Modified at: Fri Nov 5 20:25:42 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, @@ -100,7 +100,7 @@ int __init iriap_init(void) * Register some default services for IrLMP */ hints = irlmp_service_to_hint(S_COMPUTER); - hints |= irlmp_service_to_hint(S_PNP); + /*hints |= irlmp_service_to_hint(S_PNP);*/ service_handle = irlmp_register_service(hints); /* @@ -267,19 +267,16 @@ static void iriap_disconnect_indication(void *instance, void *sap, if (self->mode == IAS_CLIENT) { IRDA_DEBUG(4, __FUNCTION__ "(), disconnect as client\n"); + + iriap_do_client_event(self, IAP_LM_DISCONNECT_INDICATION, + NULL); /* * Inform service user that the request failed by sending - * it a NULL value. + * it a NULL value. Warning, the client might close us, so + * remember no to use self anymore after calling confirm */ if (self->confirm) self->confirm(IAS_DISCONNECT, 0, NULL, self->priv); - - - iriap_do_client_event(self, IAP_LM_DISCONNECT_INDICATION, - NULL); - /* Close instance only if client */ - /* iriap_close(self); */ - } else { IRDA_DEBUG(4, __FUNCTION__ "(), disconnect as server\n"); iriap_do_server_event(self, IAP_LM_DISCONNECT_INDICATION, @@ -497,6 +494,9 @@ void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb) /* Finished, close connection! */ iriap_disconnect_request(self); + /* Warning, the client might close us, so remember no to use self + * anymore after calling confirm + */ if (self->confirm) self->confirm(IAS_SUCCESS, obj_id, value, self->priv); } @@ -794,7 +794,11 @@ static int iriap_data_indication(void *instance, void *sap, WARNING(__FUNCTION__ "(), No such class!\n"); /* Finished, close connection! */ iriap_disconnect_request(self); - + + /* + * Warning, the client might close us, so remember + * no to use self anymore after calling confirm + */ if (self->confirm) self->confirm(IAS_CLASS_UNKNOWN, 0, NULL, self->priv); @@ -804,13 +808,15 @@ static int iriap_data_indication(void *instance, void *sap, /* Finished, close connection! */ iriap_disconnect_request(self); + /* + * Warning, the client might close us, so remember + * no to use self anymore after calling confirm + */ if (self->confirm) self->confirm(IAS_CLASS_UNKNOWN, 0, NULL, self->priv); break; - } - - /* iriap_close(self); */ + } break; default: IRDA_DEBUG(0, __FUNCTION__ "(), Unknown op-code: %02x\n", @@ -883,7 +889,7 @@ static char *ias_value_types[] = { "IAS_STRING" }; -int irias_proc_read(char *buf, char **start, off_t offset, int len, int unused) +int irias_proc_read(char *buf, char **start, off_t offset, int len) { struct ias_object *obj; struct ias_attrib *attrib; diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index caa3550c1..64593e319 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c @@ -96,8 +96,7 @@ static int __irlan_insert_param(struct sk_buff *skb, char *param, int type, void irlan_close_tsaps(struct irlan_cb *self); #ifdef CONFIG_PROC_FS -static int irlan_proc_read(char *buf, char **start, off_t offset, int len, - int unused); +static int irlan_proc_read(char *buf, char **start, off_t offset, int len); extern struct proc_dir_entry *proc_irda; #endif /* CONFIG_PROC_FS */ @@ -1155,8 +1154,7 @@ int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len) * * Give some info to the /proc file system */ -static int irlan_proc_read(char *buf, char **start, off_t offset, int len, - int unused) +static int irlan_proc_read(char *buf, char **start, off_t offset, int len) { struct irlan_cb *self; unsigned long flags; diff --git a/net/irda/irlap.c b/net/irda/irlap.c index ffa3665e3..09257bd45 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c @@ -6,7 +6,7 @@ * Status: Stable * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Mon Aug 4 20:40:53 1997 - * Modified at: Fri Oct 8 23:17:36 1999 + * Modified at: Tue Nov 16 10:01:06 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved. @@ -65,7 +65,7 @@ static char *lap_reasons[] = { }; #ifdef CONFIG_PROC_FS -int irlap_proc_read(char *, char **, off_t, int, int); +int irlap_proc_read(char *, char **, off_t, int); #endif /* CONFIG_PROC_FS */ @@ -849,16 +849,18 @@ void irlap_flush_all_queues(struct irlap_cb *self) * Change the speed of the IrDA port * */ -void irlap_change_speed(struct irlap_cb *self, __u32 speed) +void irlap_change_speed(struct irlap_cb *self, __u32 speed, int now) { - IRDA_DEBUG(4, __FUNCTION__ "(), setting speed to %d\n", speed); + IRDA_DEBUG(0, __FUNCTION__ "(), setting speed to %d\n", speed); ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); - /* Must use the same speed in both directions */ - self->qos_rx.baud_rate.value = speed; - self->qos_tx.baud_rate.value = speed; + self->speed = speed; + + /* Change speed now, or just piggyback speed on frames */ + if (now) + irda_device_change_speed(self->netdev, speed); } #ifdef CONFIG_IRDA_COMPRESSION @@ -878,16 +880,16 @@ void irlap_init_comp_qos_capabilities(struct irlap_cb *self) * you get when you do a little bit flicking :-) */ IRDA_DEBUG(4, __FUNCTION__ "(), comp bits 0x%02x\n", - self->qos_rx.compression.bits); + self->qos_rx.compression.bits); mask = 0x80; /* Start with testing MSB */ for (i=0;i<8;i++) { IRDA_DEBUG(4, __FUNCTION__ "(), testing bit %d\n", 8-i); if (self->qos_rx.compression.bits & mask) { - IRDA_DEBUG(4, __FUNCTION__ "(), bit %d is set by defalt\n", - 8-i); + IRDA_DEBUG(4, __FUNCTION__ + "(), bit %d is set by defalt\n", 8-i); comp = hashbin_find(irlap_compressors, - compression[ msb_index(mask)], - NULL); + compression[msb_index(mask)], + NULL); if (!comp) { /* Protocol not supported, so clear the bit */ IRDA_DEBUG(4, __FUNCTION__ "(), Compression " @@ -984,7 +986,7 @@ void irlap_apply_default_connection_parameters(struct irlap_cb *self) ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); - irlap_change_speed(self, 9600); + irlap_change_speed(self, 9600, TRUE); /* Default value in NDM */ self->bofs_count = 11; @@ -1017,7 +1019,7 @@ void irlap_apply_connection_parameters(struct irlap_cb *self, ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); - irlap_change_speed(self, qos->baud_rate.value); + irlap_change_speed(self, qos->baud_rate.value, FALSE); self->window_size = qos->window_size.value; self->window = qos->window_size.value; @@ -1085,13 +1087,12 @@ void irlap_set_local_busy(struct irlap_cb *self, int status) #ifdef CONFIG_PROC_FS /* - * Function irlap_proc_read (buf, start, offset, len, unused) + * Function irlap_proc_read (buf, start, offset, len) * * Give some info to the /proc file system * */ -int irlap_proc_read(char *buf, char **start, off_t offset, int len, - int unused) +int irlap_proc_read(char *buf, char **start, off_t offset, int len) { struct irlap_cb *self; unsigned long flags; diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c index fa9369863..7ddadc761 100644 --- a/net/irda/irlap_event.c +++ b/net/irda/irlap_event.c @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Sat Aug 16 00:59:29 1997 - * Modified at: Sun Oct 10 11:14:22 1999 + * Modified at: Tue Nov 16 12:33:41 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, @@ -343,8 +343,9 @@ static int irlap_state_ndm(struct irlap_cb *self, IRLAP_EVENT event, irlap_connect_indication(self, skb); } else { - IRDA_DEBUG(0, __FUNCTION__ "(), SNRM frame does not contain" - " and I field!\n"); + IRDA_DEBUG(0, __FUNCTION__ + "(), SNRM frame does not contain" + " and I field!\n"); dev_kfree_skb(skb); } break; @@ -601,36 +602,48 @@ static int irlap_state_conn(struct irlap_cb *self, IRLAP_EVENT event, irlap_qos_negotiate(self, skb); - irlap_initiate_connection_state( self); + irlap_initiate_connection_state(self); - /* - * We are allowed to send two frames! +#if 0 + /* + * We are allowed to send two frames, but this may increase + * the connect latency, so lets not do it for now. */ irlap_send_ua_response_frame(self, &self->qos_rx); - irlap_send_ua_response_frame(self, &self->qos_rx); - +#endif + + /* + * Applying the parameters now will make sure we change speed + * after we have sent the next frame + */ irlap_apply_connection_parameters(self, &self->qos_tx); + /* + * Sending this frame will force a speed change after it has + * been sent + */ + irlap_send_ua_response_frame(self, &self->qos_rx); + /* * The WD-timer could be set to the duration of the P-timer * for this case, but it is recommended to use twice the * value (note 3 IrLAP p. 60). */ irlap_start_wd_timer(self, self->wd_timeout); - irlap_next_state( self, LAP_NRM_S); + irlap_next_state(self, LAP_NRM_S); break; case RECV_DISCOVERY_XID_CMD: - IRDA_DEBUG( 3, __FUNCTION__ "(), event RECV_DISCOVER_XID_CMD!\n"); - irlap_next_state( self, LAP_NDM); + IRDA_DEBUG(3, __FUNCTION__ "(), event RECV_DISCOVER_XID_CMD!\n"); + irlap_next_state(self, LAP_NDM); break; case DISCONNECT_REQUEST: - irlap_send_dm_frame( self); + irlap_send_dm_frame(self); irlap_next_state( self, LAP_CONN); break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event, - irlap_event[event]); - + IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event, + irlap_event[event]); + if (skb) dev_kfree_skb(skb); @@ -739,8 +752,8 @@ static int irlap_state_setup(struct irlap_cb *self, IRLAP_EVENT event, irlap_apply_connection_parameters(self, &self->qos_tx); self->retry_count = 0; - /* This frame will just be sent at the old speed */ - /* irlap_send_rr_frame( self, CMD_FRAME); */ + /* This frame will actually force the speed change */ + irlap_send_rr_frame(self, CMD_FRAME); irlap_start_final_timer(self, self->final_timeout/2); irlap_next_state(self, LAP_NRM_P); diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index 160690889..5aa489cc2 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Tue Aug 19 10:27:26 1997 - * Modified at: Sat Oct 9 09:42:11 1999 + * Modified at: Fri Nov 5 09:45:58 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, @@ -60,7 +60,7 @@ static inline void irlap_insert_info(struct irlap_cb *self, */ cb->magic = LAP_MAGIC; cb->mtt = self->mtt_required; - cb->speed = self->qos_tx.baud_rate.value; + cb->speed = self->speed; /* Reset */ self->mtt_required = 0; diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c index bd2f906f9..c83d62f44 100644 --- a/net/irda/irlmp.c +++ b/net/irda/irlmp.c @@ -63,7 +63,7 @@ char *lmp_reasons[] = { __u8 *irlmp_hint_to_service(__u8 *hint); #ifdef CONFIG_PROC_FS -int irlmp_proc_read(char *buf, char **start, off_t offst, int len, int unused); +int irlmp_proc_read(char *buf, char **start, off_t offst, int len); #endif /* @@ -1431,13 +1431,12 @@ __u32 irlmp_get_daddr(struct lsap_cb *self) #ifdef CONFIG_PROC_FS /* - * Function irlmp_proc_read (buf, start, offset, len, unused) + * Function irlmp_proc_read (buf, start, offset, len) * * Give some info to the /proc file system * */ -int irlmp_proc_read(char *buf, char **start, off_t offset, int len, - int unused) +int irlmp_proc_read(char *buf, char **start, off_t offset, int len) { struct lsap_cb *self; struct lap_cb *lap; diff --git a/net/irda/irmod.c b/net/irda/irmod.c index 80c71d998..ca6c9d3ba 100644 --- a/net/irda/irmod.c +++ b/net/irda/irmod.c @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Mon Dec 15 13:55:39 1997 - * Modified at: Sun Oct 31 20:31:01 1999 + * Modified at: Sun Nov 14 08:57:52 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1997, 1999 Dag Brattli, All Rights Reserved. diff --git a/net/irda/irproc.c b/net/irda/irproc.c index 820fbd275..172e3cb18 100644 --- a/net/irda/irproc.c +++ b/net/irda/irproc.c @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Thomas Davis, <ratbert@radiks.net> * Created at: Sat Feb 21 21:33:24 1998 - * Modified at: Fri Oct 8 09:26:46 1999 + * Modified at: Sun Nov 14 08:54:54 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1998-1999, Dag Brattli <dagb@cs.uit.no> @@ -25,6 +25,7 @@ #include <linux/miscdevice.h> #include <linux/proc_fs.h> +#define __NO_VERSION__ #include <linux/module.h> #include <net/irda/irda.h> @@ -32,20 +33,15 @@ #include <net/irda/irlap.h> #include <net/irda/irlmp.h> -extern int irlap_proc_read(char *buf, char **start, off_t offset, int len, - int unused); -extern int irlmp_proc_read(char *buf, char **start, off_t offset, int len, - int unused); -extern int irttp_proc_read(char *buf, char **start, off_t offset, int len, - int unused); -extern int irias_proc_read(char *buf, char **start, off_t offset, int len, - int unused); -extern int discovery_proc_read(char *buf, char **start, off_t offset, int len, - int unused); +extern int irlap_proc_read(char *buf, char **start, off_t offset, int len); +extern int irlmp_proc_read(char *buf, char **start, off_t offset, int len); +extern int irttp_proc_read(char *buf, char **start, off_t offset, int len); +extern int irias_proc_read(char *buf, char **start, off_t offset, int len); +extern int discovery_proc_read(char *buf, char **start, off_t offset, int len); struct irda_entry { char *name; - int (*fn)(char*, char**, off_t, int, int); + int (*fn)(char*, char**, off_t, int); }; struct proc_dir_entry *proc_irda; @@ -70,7 +66,7 @@ void irda_proc_register(void) { int i; - proc_irda = create_proc_entry("net/irda", S_IFDIR, NULL); + proc_irda = proc_mkdir("net/irda", NULL); proc_irda->owner = THIS_MODULE; for (i=0;i<IRDA_ENTRIES_NUM;i++) diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 304f39e10..862360b4a 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c @@ -1477,11 +1477,11 @@ static void irttp_start_todo_timer(struct tsap_cb *self, int timeout) #ifdef CONFIG_PROC_FS /* - * Function irttp_proc_read (buf, start, offset, len, unused) + * Function irttp_proc_read (buf, start, offset, len) * * Give some info to the /proc file system */ -int irttp_proc_read(char *buf, char **start, off_t offset, int len, int unused) +int irttp_proc_read(char *buf, char **start, off_t offset, int len) { struct tsap_cb *self; unsigned long flags; diff --git a/net/irda/parameters.c b/net/irda/parameters.c index 9ca443f02..c6fd97e1e 100644 --- a/net/irda/parameters.c +++ b/net/irda/parameters.c @@ -6,7 +6,7 @@ * Status: Experimental. * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Mon Jun 7 10:25:11 1999 - * Modified at: Tue Oct 5 11:52:54 1999 + * Modified at: Fri Nov 5 08:20:38 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. @@ -468,9 +468,6 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, /* Find expected data type for this parameter identifier (pi)*/ type = pi_minor_info->type; - IRDA_DEBUG(3, __FUNCTION__ "(), pi=[%d,%d], type=%d\n", - pi_major, pi_minor, type); - /* Check if handler has been implemented */ if (!pi_minor_info->func) { MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", pi); diff --git a/net/irda/qos.c b/net/irda/qos.c index 0d9a2550b..df6ba6421 100644 --- a/net/irda/qos.c +++ b/net/irda/qos.c @@ -7,7 +7,7 @@ * Status: Experimental. * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Tue Sep 9 00:00:26 1997 - * Modified at: Tue Oct 5 11:50:41 1999 + * Modified at: Tue Nov 16 09:50:19 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>, @@ -289,7 +289,7 @@ static int irlap_param_baud_rate(void *instance, param_t *param, int get) IRDA_DEBUG(2, "Final BAUD_RATE: 0x%04x\n", final); self->qos_tx.baud_rate.bits = final; - self->qos_rx.baud_rate.bits = final; + self->qos_rx.baud_rate.bits = final; } return 0; |