Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
aef84e55
Commit
aef84e55
authored
Sep 20, 2002
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge mandrakesoft.com:/home/jgarzik/repo/linus-2.5
into mandrakesoft.com:/home/jgarzik/repo/irda-2.5
parents
c9b0864a
085e897b
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
246 additions
and
201 deletions
+246
-201
drivers/net/irda/actisys.c
drivers/net/irda/actisys.c
+1
-1
drivers/net/irda/irda-usb.c
drivers/net/irda/irda-usb.c
+52
-50
drivers/net/irda/irtty.c
drivers/net/irda/irtty.c
+12
-12
drivers/net/irda/ma600.c
drivers/net/irda/ma600.c
+14
-14
drivers/net/irda/nsc-ircc.c
drivers/net/irda/nsc-ircc.c
+118
-64
net/irda/af_irda.c
net/irda/af_irda.c
+29
-35
net/irda/ircomm/ircomm_core.c
net/irda/ircomm/ircomm_core.c
+1
-1
net/irda/ircomm/ircomm_lmp.c
net/irda/ircomm/ircomm_lmp.c
+1
-1
net/irda/ircomm/ircomm_param.c
net/irda/ircomm/ircomm_param.c
+1
-1
net/irda/ircomm/ircomm_ttp.c
net/irda/ircomm/ircomm_ttp.c
+3
-3
net/irda/ircomm/ircomm_tty.c
net/irda/ircomm/ircomm_tty.c
+7
-8
net/irda/ircomm/ircomm_tty_attach.c
net/irda/ircomm/ircomm_tty_attach.c
+3
-6
net/irda/ircomm/ircomm_tty_ioctl.c
net/irda/ircomm/ircomm_tty_ioctl.c
+1
-1
net/irda/irlan/irlan_client.c
net/irda/irlan/irlan_client.c
+1
-1
net/irda/irlan/irlan_client_event.c
net/irda/irlan/irlan_client_event.c
+1
-2
net/irda/irlan/irlan_common.c
net/irda/irlan/irlan_common.c
+1
-1
No files found.
drivers/net/irda/actisys.c
View file @
aef84e55
...
...
@@ -165,7 +165,7 @@ static int actisys_change_speed(struct irda_task *task)
int
ret
=
0
;
int
i
=
0
;
IRDA_DEBUG
(
4
,
__FUNCTION__
"(), speed=%d (was %d)
\n
"
,
speed
,
IRDA_DEBUG
(
4
,
"%s(), speed=%d (was %d)
\n
"
,
__FUNCTION__
,
speed
,
self
->
speed
);
/* Go to a known state by reseting the dongle */
...
...
drivers/net/irda/irda-usb.c
View file @
aef84e55
...
...
@@ -156,12 +156,12 @@ static void irda_usb_build_header(struct irda_usb_cb *self,
(
!
force
)
&&
(
self
->
speed
!=
-
1
))
{
/* No speed and xbofs change here
* (we'll do it later in the write callback) */
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), not changing speed yet
\n
"
);
IRDA_DEBUG
(
2
,
"%s(), not changing speed yet
\n
"
,
__FUNCTION__
);
*
header
=
0
;
return
;
}
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), changing speed to %d
\n
"
,
self
->
new_speed
);
IRDA_DEBUG
(
2
,
"%s(), changing speed to %d
\n
"
,
__FUNCTION__
,
self
->
new_speed
);
self
->
speed
=
self
->
new_speed
;
/* We will do ` self->new_speed = -1; ' in the completion
* handler just in case the current URB fail - Jean II */
...
...
@@ -203,7 +203,7 @@ static void irda_usb_build_header(struct irda_usb_cb *self,
/* Set the negotiated additional XBOFS */
if
(
self
->
new_xbofs
!=
-
1
)
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), changing xbofs to %d
\n
"
,
self
->
new_xbofs
);
IRDA_DEBUG
(
2
,
"%s(), changing xbofs to %d
\n
"
,
__FUNCTION__
,
self
->
new_xbofs
);
self
->
xbofs
=
self
->
new_xbofs
;
/* We will do ` self->new_xbofs = -1; ' in the completion
* handler just in case the current URB fail - Jean II */
...
...
@@ -251,13 +251,13 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
struct
urb
*
urb
;
int
ret
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), speed=%d, xbofs=%d
\n
"
,
IRDA_DEBUG
(
2
,
"%s(), speed=%d, xbofs=%d
\n
"
,
__FUNCTION__
,
self
->
new_speed
,
self
->
new_xbofs
);
/* Grab the speed URB */
urb
=
self
->
speed_urb
;
if
(
urb
->
status
!=
0
)
{
WARNING
(
__FUNCTION__
"(), URB still in use!
\n
"
);
WARNING
(
"%s(), URB still in use!
\n
"
,
__FUNCTION__
);
return
;
}
...
...
@@ -278,7 +278,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self)
/* Irq disabled -> GFP_ATOMIC */
if
((
ret
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
)))
{
WARNING
(
__FUNCTION__
"(), failed Speed URB
\n
"
);
WARNING
(
"%s(), failed Speed URB
\n
"
,
__FUNCTION__
);
}
}
...
...
@@ -291,7 +291,7 @@ static void speed_bulk_callback(struct urb *urb)
{
struct
irda_usb_cb
*
self
=
urb
->
context
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
/* We should always have a context */
ASSERT
(
self
!=
NULL
,
return
;);
...
...
@@ -301,7 +301,7 @@ static void speed_bulk_callback(struct urb *urb)
/* Check for timeout and other USB nasties */
if
(
urb
->
status
!=
0
)
{
/* I get a lot of -ECONNABORTED = -103 here - Jean II */
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), URB complete status %d, transfer_flags 0x%04X
\n
"
,
urb
->
status
,
urb
->
transfer_flags
);
IRDA_DEBUG
(
0
,
"%s(), URB complete status %d, transfer_flags 0x%04X
\n
"
,
__FUNCTION__
,
urb
->
status
,
urb
->
transfer_flags
);
/* Don't do anything here, that might confuse the USB layer.
* Instead, we will wait for irda_usb_net_timeout(), the
...
...
@@ -336,7 +336,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
int
res
,
mtt
;
int
err
=
1
;
/* Failed */
IRDA_DEBUG
(
4
,
__FUNCTION__
"() on %s
\n
"
,
netdev
->
name
);
IRDA_DEBUG
(
4
,
"%s() on %s
\n
"
,
__FUNCTION__
,
netdev
->
name
);
netif_stop_queue
(
netdev
);
...
...
@@ -347,7 +347,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
* We need to check self->present under the spinlock because
* of irda_usb_disconnect() is synchronous - Jean II */
if
(
!
self
->
present
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Device is gone...
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), Device is gone...
\n
"
,
__FUNCTION__
);
goto
drop
;
}
...
...
@@ -381,7 +381,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
}
if
(
urb
->
status
!=
0
)
{
WARNING
(
__FUNCTION__
"(), URB still in use!
\n
"
);
WARNING
(
"%s(), URB still in use!
\n
"
,
__FUNCTION__
);
goto
drop
;
}
...
...
@@ -390,9 +390,9 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
* Also, we don't use directly skb_cow(), because it require
* headroom >= 16, which force unnecessary copies - Jean II */
if
(
skb_headroom
(
skb
)
<
USB_IRDA_HEADER
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Insuficient skb headroom.
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), Insuficient skb headroom.
\n
"
,
__FUNCTION__
);
if
(
skb_cow
(
skb
,
USB_IRDA_HEADER
))
{
WARNING
(
__FUNCTION__
"(), failed skb_cow() !!!
\n
"
);
WARNING
(
"%s(), failed skb_cow() !!!
\n
"
,
__FUNCTION__
);
goto
drop
;
}
}
...
...
@@ -463,7 +463,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
/* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */
if
((
res
=
usb_submit_urb
(
urb
,
GFP_ATOMIC
)))
{
WARNING
(
__FUNCTION__
"(), failed Tx URB
\n
"
);
WARNING
(
"%s(), failed Tx URB
\n
"
,
__FUNCTION__
);
self
->
stats
.
tx_errors
++
;
/* Let USB recover : We will catch that in the watchdog */
/*netif_start_queue(netdev);*/
...
...
@@ -495,7 +495,7 @@ static void write_bulk_callback(struct urb *urb)
struct
sk_buff
*
skb
=
urb
->
context
;
struct
irda_usb_cb
*
self
=
((
struct
irda_skb_cb
*
)
skb
->
cb
)
->
context
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
/* We should always have a context */
ASSERT
(
self
!=
NULL
,
return
;);
...
...
@@ -509,7 +509,7 @@ static void write_bulk_callback(struct urb *urb)
/* Check for timeout and other USB nasties */
if
(
urb
->
status
!=
0
)
{
/* I get a lot of -ECONNABORTED = -103 here - Jean II */
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), URB complete status %d, transfer_flags 0x%04X
\n
"
,
urb
->
status
,
urb
->
transfer_flags
);
IRDA_DEBUG
(
0
,
"%s(), URB complete status %d, transfer_flags 0x%04X
\n
"
,
__FUNCTION__
,
urb
->
status
,
urb
->
transfer_flags
);
/* Don't do anything here, that might confuse the USB layer,
* and we could go in recursion and blow the kernel stack...
...
...
@@ -528,7 +528,7 @@ static void write_bulk_callback(struct urb *urb)
/* If the network is closed, stop everything */
if
((
!
self
->
netopen
)
||
(
!
self
->
present
))
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Network is gone...
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), Network is gone...
\n
"
,
__FUNCTION__
);
spin_unlock_irqrestore
(
&
self
->
lock
,
flags
);
return
;
}
...
...
@@ -539,7 +539,7 @@ static void write_bulk_callback(struct urb *urb)
(
self
->
new_xbofs
!=
self
->
xbofs
))
{
/* We haven't changed speed yet (because of
* IUC_SPEED_BUG), so do it now - Jean II */
IRDA_DEBUG
(
1
,
__FUNCTION__
"(), Changing speed now...
\n
"
);
IRDA_DEBUG
(
1
,
"%s(), Changing speed now...
\n
"
,
__FUNCTION__
);
irda_usb_change_speed_xbofs
(
self
);
}
else
{
/* New speed and xbof is now commited in hardware */
...
...
@@ -571,7 +571,7 @@ static void irda_usb_net_timeout(struct net_device *netdev)
struct
urb
*
urb
;
int
done
=
0
;
/* If we have made any progress */
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Network layer thinks we timed out!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), Network layer thinks we timed out!
\n
"
,
__FUNCTION__
);
ASSERT
(
self
!=
NULL
,
return
;);
/* Protect us from USB callbacks, net Tx and else. */
...
...
@@ -579,7 +579,7 @@ static void irda_usb_net_timeout(struct net_device *netdev)
/* self->present *MUST* be read under spinlock */
if
(
!
self
->
present
)
{
WARNING
(
__FUNCTION__
"(), device not present!
\n
"
);
WARNING
(
"%s(), device not present!
\n
"
,
__FUNCTION__
);
netif_stop_queue
(
netdev
);
spin_unlock_irqrestore
(
&
self
->
lock
,
flags
);
return
;
...
...
@@ -702,11 +702,11 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc
struct
irda_skb_cb
*
cb
;
int
ret
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
/* Check that we have an urb */
if
(
!
urb
)
{
WARNING
(
__FUNCTION__
"(), Bug : urb == NULL
\n
"
);
WARNING
(
"%s(), Bug : urb == NULL
\n
"
,
__FUNCTION__
);
return
;
}
...
...
@@ -716,7 +716,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc
if
(
!
skb
)
{
/* If this ever happen, we are in deep s***.
* Basically, the Rx path will stop... */
WARNING
(
__FUNCTION__
"(), Failed to allocate Rx skb
\n
"
);
WARNING
(
"%s(), Failed to allocate Rx skb
\n
"
,
__FUNCTION__
);
return
;
}
}
else
{
...
...
@@ -745,7 +745,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc
if
(
ret
)
{
/* If this ever happen, we are in deep s***.
* Basically, the Rx path will stop... */
WARNING
(
__FUNCTION__
"(), Failed to submit Rx URB %d
\n
"
,
ret
);
WARNING
(
"%s(), Failed to submit Rx URB %d
\n
"
,
__FUNCTION__
,
ret
);
}
}
...
...
@@ -763,7 +763,7 @@ static void irda_usb_receive(struct urb *urb)
struct
irda_skb_cb
*
cb
;
struct
sk_buff
*
new
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), len=%d
\n
"
,
urb
->
actual_length
);
IRDA_DEBUG
(
2
,
"%s(), len=%d
\n
"
,
__FUNCTION__
,
urb
->
actual_length
);
/* Find ourselves */
cb
=
(
struct
irda_skb_cb
*
)
skb
->
cb
;
...
...
@@ -773,7 +773,7 @@ static void irda_usb_receive(struct urb *urb)
/* If the network is closed or the device gone, stop everything */
if
((
!
self
->
netopen
)
||
(
!
self
->
present
))
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Network is gone!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), Network is gone!
\n
"
,
__FUNCTION__
);
/* Don't re-submit the URB : will stall the Rx path */
return
;
}
...
...
@@ -786,13 +786,13 @@ static void irda_usb_receive(struct urb *urb)
self
->
stats
.
rx_crc_errors
++
;
break
;
case
-
ECONNRESET
:
/* -104 */
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Connection Reset (-104), transfer_flags 0x%04X
\n
"
,
urb
->
transfer_flags
);
IRDA_DEBUG
(
0
,
"%s(), Connection Reset (-104), transfer_flags 0x%04X
\n
"
,
__FUNCTION__
,
urb
->
transfer_flags
);
/* uhci_cleanup_unlink() is going to kill the Rx
* URB just after we return. No problem, at this
* point the URB will be idle ;-) - Jean II */
break
;
default:
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), RX status %d,transfer_flags 0x%04X
\n
"
,
urb
->
status
,
urb
->
transfer_flags
);
IRDA_DEBUG
(
0
,
"%s(), RX status %d,transfer_flags 0x%04X
\n
"
,
__FUNCTION__
,
urb
->
status
,
urb
->
transfer_flags
);
break
;
}
goto
done
;
...
...
@@ -800,7 +800,7 @@ static void irda_usb_receive(struct urb *urb)
/* Check for empty frames */
if
(
urb
->
actual_length
<=
USB_IRDA_HEADER
)
{
WARNING
(
__FUNCTION__
"(), empty frame!
\n
"
);
WARNING
(
"%s(), empty frame!
\n
"
,
__FUNCTION__
);
goto
done
;
}
...
...
@@ -905,7 +905,7 @@ static int irda_usb_is_receiving(struct irda_usb_cb *self)
*/
static
int
irda_usb_net_init
(
struct
net_device
*
dev
)
{
IRDA_DEBUG
(
1
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
1
,
"%s()
\n
"
,
__FUNCTION__
);
/* Set up to be a normal IrDA network device driver */
irda_device_setup
(
dev
);
...
...
@@ -929,7 +929,7 @@ static int irda_usb_net_open(struct net_device *netdev)
char
hwname
[
16
];
int
i
;
IRDA_DEBUG
(
1
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
1
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
netdev
!=
NULL
,
return
-
1
;);
self
=
(
struct
irda_usb_cb
*
)
netdev
->
priv
;
...
...
@@ -937,7 +937,7 @@ static int irda_usb_net_open(struct net_device *netdev)
/* Can only open the device if it's there */
if
(
!
self
->
present
)
{
WARNING
(
__FUNCTION__
"(), device not present!
\n
"
);
WARNING
(
"%s(), device not present!
\n
"
,
__FUNCTION__
);
return
-
1
;
}
...
...
@@ -993,7 +993,7 @@ static int irda_usb_net_close(struct net_device *netdev)
struct
irda_usb_cb
*
self
;
int
i
;
IRDA_DEBUG
(
1
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
1
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
netdev
!=
NULL
,
return
-
1
;);
self
=
(
struct
irda_usb_cb
*
)
netdev
->
priv
;
...
...
@@ -1049,7 +1049,7 @@ static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
self
=
dev
->
priv
;
ASSERT
(
self
!=
NULL
,
return
-
1
;);
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), %s, (cmd=0x%X)
\n
"
,
dev
->
name
,
cmd
);
IRDA_DEBUG
(
2
,
"%s(), %s, (cmd=0x%X)
\n
"
,
__FUNCTION__
,
dev
->
name
,
cmd
);
switch
(
cmd
)
{
case
SIOCSBANDWIDTH
:
/* Set bandwidth */
...
...
@@ -1107,7 +1107,7 @@ static inline void irda_usb_init_qos(struct irda_usb_cb *self)
{
struct
irda_class_desc
*
desc
;
IRDA_DEBUG
(
3
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
3
,
"%s()
\n
"
,
__FUNCTION__
);
desc
=
self
->
irda_desc
;
...
...
@@ -1120,7 +1120,8 @@ static inline void irda_usb_init_qos(struct irda_usb_cb *self)
self
->
qos
.
window_size
.
bits
=
desc
->
bmWindowSize
;
self
->
qos
.
data_size
.
bits
=
desc
->
bmDataSize
;
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), dongle says speed=0x%X, size=0x%X, window=0x%X, bofs=0x%X, turn=0x%X
\n
"
,
self
->
qos
.
baud_rate
.
bits
,
self
->
qos
.
data_size
.
bits
,
self
->
qos
.
window_size
.
bits
,
self
->
qos
.
additional_bofs
.
bits
,
self
->
qos
.
min_turn_time
.
bits
);
IRDA_DEBUG
(
0
,
"%s(), dongle says speed=0x%X, size=0x%X, window=0x%X, bofs=0x%X, turn=0x%X
\n
"
,
__FUNCTION__
,
self
->
qos
.
baud_rate
.
bits
,
self
->
qos
.
data_size
.
bits
,
self
->
qos
.
window_size
.
bits
,
self
->
qos
.
additional_bofs
.
bits
,
self
->
qos
.
min_turn_time
.
bits
);
/* Don't always trust what the dongle tell us */
if
(
self
->
capability
&
IUC_SIR_ONLY
)
...
...
@@ -1164,7 +1165,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
struct
net_device
*
netdev
;
int
err
;
IRDA_DEBUG
(
1
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
1
,
"%s()
\n
"
,
__FUNCTION__
);
spin_lock_init
(
&
self
->
lock
);
...
...
@@ -1184,7 +1185,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
/* Create a network device for us */
if
(
!
(
netdev
=
dev_alloc
(
"irda%d"
,
&
err
)))
{
ERROR
(
__FUNCTION__
"(), dev_alloc() failed!
\n
"
);
ERROR
(
"%s(), dev_alloc() failed!
\n
"
,
__FUNCTION__
);
return
-
1
;
}
self
->
netdev
=
netdev
;
...
...
@@ -1204,7 +1205,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
err
=
register_netdevice
(
netdev
);
rtnl_unlock
();
if
(
err
)
{
ERROR
(
__FUNCTION__
"(), register_netdev() failed!
\n
"
);
ERROR
(
"%s(), register_netdev() failed!
\n
"
,
__FUNCTION__
);
return
-
1
;
}
MESSAGE
(
"IrDA: Registered device %s
\n
"
,
netdev
->
name
);
...
...
@@ -1219,7 +1220,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
*/
static
inline
int
irda_usb_close
(
struct
irda_usb_cb
*
self
)
{
IRDA_DEBUG
(
1
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
1
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
self
!=
NULL
,
return
-
1
;);
...
...
@@ -1301,12 +1302,13 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_
/* This is our interrupt endpoint */
self
->
bulk_int_ep
=
ep
;
}
else
{
ERROR
(
__FUNCTION__
"(), Unrecognised endpoint %02X.
\n
"
,
ep
);
ERROR
(
"%s(), Unrecognised endpoint %02X.
\n
"
,
__FUNCTION__
,
ep
);
}
}
}
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X
\n
"
,
self
->
bulk_in_ep
,
self
->
bulk_out_ep
,
self
->
bulk_out_mtu
,
self
->
bulk_int_ep
);
IRDA_DEBUG
(
0
,
"%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X
\n
"
,
__FUNCTION__
,
self
->
bulk_in_ep
,
self
->
bulk_out_ep
,
self
->
bulk_out_mtu
,
self
->
bulk_int_ep
);
/* Should be 8, 16, 32 or 64 bytes */
ASSERT
(
self
->
bulk_out_mtu
==
64
,
;);
...
...
@@ -1368,7 +1370,7 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_device
USB_DIR_IN
|
USB_TYPE_CLASS
|
USB_RECIP_INTERFACE
,
0
,
ifnum
,
desc
,
sizeof
(
*
desc
),
MSECS_TO_JIFFIES
(
500
));
IRDA_DEBUG
(
1
,
__FUNCTION__
"(), ret=%d
\n
"
,
ret
);
IRDA_DEBUG
(
1
,
"%s(), ret=%d
\n
"
,
__FUNCTION__
,
ret
);
if
(
ret
<
sizeof
(
*
desc
))
{
WARNING
(
"usb-irda: class_descriptor read %s (%d)
\n
"
,
(
ret
<
0
)
?
"failed"
:
"too short"
,
ret
);
...
...
@@ -1427,7 +1429,7 @@ static void *irda_usb_probe(struct usb_device *dev, unsigned int ifnum,
if
((
irda
->
usbdev
!=
NULL
)
&&
(
irda
->
present
==
0
)
&&
(
irda
->
netopen
==
0
))
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), found a zombie instance !!!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), found a zombie instance !!!
\n
"
,
__FUNCTION__
);
irda_usb_disconnect
(
irda
->
usbdev
,
(
void
*
)
irda
);
}
}
...
...
@@ -1491,10 +1493,10 @@ static void *irda_usb_probe(struct usb_device *dev, unsigned int ifnum,
break
;
case
-
EPIPE
:
/* -EPIPE = -32 */
usb_clear_halt
(
dev
,
usb_sndctrlpipe
(
dev
,
0
));
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Clearing stall on control interface
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), Clearing stall on control interface
\n
"
,
__FUNCTION__
);
break
;
default:
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Unknown error %d
\n
"
,
ret
);
IRDA_DEBUG
(
0
,
"%s(), Unknown error %d
\n
"
,
__FUNCTION__
,
ret
);
return
NULL
;
break
;
}
...
...
@@ -1503,7 +1505,7 @@ static void *irda_usb_probe(struct usb_device *dev, unsigned int ifnum,
interface
=
&
dev
->
actconfig
->
interface
[
ifnum
].
altsetting
[
0
];
if
(
!
irda_usb_parse_endpoints
(
self
,
interface
->
endpoint
,
interface
->
bNumEndpoints
))
{
ERROR
(
__FUNCTION__
"(), Bogus endpoints...
\n
"
);
ERROR
(
"%s(), Bogus endpoints...
\n
"
,
__FUNCTION__
);
return
NULL
;
}
...
...
@@ -1542,7 +1544,7 @@ static void irda_usb_disconnect(struct usb_device *dev, void *ptr)
struct
irda_usb_cb
*
self
=
(
struct
irda_usb_cb
*
)
ptr
;
int
i
;
IRDA_DEBUG
(
1
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
1
,
"%s()
\n
"
,
__FUNCTION__
);
/* Make sure that the Tx path is not executing. - Jean II */
spin_lock_irqsave
(
&
self
->
lock
,
flags
);
...
...
@@ -1583,7 +1585,7 @@ static void irda_usb_disconnect(struct usb_device *dev, void *ptr)
usb_free_urb
(
self
->
tx_urb
);
usb_free_urb
(
self
->
speed_urb
);
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), USB IrDA Disconnected
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), USB IrDA Disconnected
\n
"
,
__FUNCTION__
);
}
/*------------------------------------------------------------------*/
...
...
@@ -1632,7 +1634,7 @@ void __exit usb_irda_cleanup(void)
irda
=
&
irda_instance
[
i
];
/* If the Device is zombie */
if
((
irda
->
usbdev
!=
NULL
)
&&
(
irda
->
present
==
0
))
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), disconnect zombie now !
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), disconnect zombie now !
\n
"
,
__FUNCTION__
);
irda_usb_disconnect
(
irda
->
usbdev
,
(
void
*
)
irda
);
}
}
...
...
drivers/net/irda/irtty.c
View file @
aef84e55
...
...
@@ -356,7 +356,7 @@ static void __irtty_change_speed(struct irtty_cb *self, __u32 speed)
cflag
&=
~
CBAUD
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), Setting speed to %d
\n
"
,
speed
);
IRDA_DEBUG
(
2
,
"%s(), Setting speed to %d
\n
"
,
__FUNCTION__
,
speed
);
switch
(
speed
)
{
case
1200
:
...
...
@@ -406,7 +406,7 @@ static int irtty_change_speed(struct irda_task *task)
__u32
speed
=
(
__u32
)
task
->
param
;
int
ret
=
0
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), <%ld>
\n
"
,
jiffies
);
IRDA_DEBUG
(
2
,
"%s(), <%ld>
\n
"
,
__FUNCTION__
,
jiffies
);
self
=
(
struct
irtty_cb
*
)
task
->
instance
;
ASSERT
(
self
!=
NULL
,
return
-
1
;);
...
...
@@ -416,7 +416,7 @@ static int irtty_change_speed(struct irda_task *task)
/* Check if busy */
if
(
self
->
task
&&
self
->
task
!=
task
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), busy!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), busy!
\n
"
,
__FUNCTION__
);
spin_unlock_irqrestore
(
&
self
->
lock
,
flags
);
return
MSECS_TO_JIFFIES
(
10
);
}
else
...
...
@@ -571,7 +571,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp,
struct
irtty_cb
*
self
=
(
struct
irtty_cb
*
)
tty
->
disc_data
;
if
(
!
self
||
!
self
->
netdev
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), not ready yet!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), not ready yet!
\n
"
,
__FUNCTION__
);
return
;
}
...
...
@@ -621,7 +621,7 @@ static int irtty_change_speed_complete(struct irda_task *task)
{
struct
irtty_cb
*
self
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
self
=
(
struct
irtty_cb
*
)
task
->
instance
;
...
...
@@ -707,7 +707,7 @@ static int irtty_hard_xmit(struct sk_buff *skb, struct net_device *dev)
*/
static
int
irtty_receive_room
(
struct
tty_struct
*
tty
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
0
,
"%s()
\n
"
,
__FUNCTION__
);
return
65536
;
/* We can handle an infinite amount of data. :-) */
}
...
...
@@ -749,7 +749,7 @@ static void irtty_write_wakeup(struct tty_struct *tty)
* Now serial buffer is almost free & we can start
* transmission of another packet
*/
IRDA_DEBUG
(
5
,
__FUNCTION__
"(), finished with frame!
\n
"
);
IRDA_DEBUG
(
5
,
"%s(), finished with frame!
\n
"
,
__FUNCTION__
);
self
->
stats
.
tx_packets
++
;
...
...
@@ -759,7 +759,7 @@ static void irtty_write_wakeup(struct tty_struct *tty)
spin_unlock_irqrestore
(
&
self
->
lock
,
flags
);
if
(
self
->
new_speed
)
{
IRDA_DEBUG
(
5
,
__FUNCTION__
"(), Changing speed!
\n
"
);
IRDA_DEBUG
(
5
,
"%s(), Changing speed!
\n
"
,
__FUNCTION__
);
irda_task_execute
(
self
,
irtty_change_speed
,
irtty_change_speed_complete
,
NULL
,
(
void
*
)
self
->
new_speed
);
...
...
@@ -824,7 +824,7 @@ static int irtty_set_dtr_rts(struct net_device *dev, int dtr, int rts)
/* This is probably unsafe, but currently under discussion - Jean II */
if
(
tty
->
driver
.
ioctl
(
tty
,
NULL
,
TIOCMSET
,
(
unsigned
long
)
&
arg
))
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), error doing ioctl!
\n
"
);
IRDA_DEBUG
(
2
,
"%s(), error doing ioctl!
\n
"
,
__FUNCTION__
);
}
set_fs
(
fs
);
...
...
@@ -850,7 +850,7 @@ int irtty_set_mode(struct net_device *dev, int mode)
ASSERT
(
self
!=
NULL
,
return
-
1
;);
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), mode=%s
\n
"
,
infrared_mode
[
mode
]);
IRDA_DEBUG
(
2
,
"%s(), mode=%s
\n
"
,
__FUNCTION__
,
infrared_mode
[
mode
]);
/* Protect access to self->rx_buff - Jean II */
spin_lock_irqsave
(
&
self
->
lock
,
flags
);
...
...
@@ -948,7 +948,7 @@ static int irtty_net_open(struct net_device *dev)
ASSERT
(
self
!=
NULL
,
return
-
1
;);
ASSERT
(
self
->
magic
==
IRTTY_MAGIC
,
return
-
1
;);
IRDA_DEBUG
(
0
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
0
,
"%s()
\n
"
,
__FUNCTION__
);
/* Ready to play! */
netif_start_queue
(
dev
);
...
...
@@ -1015,7 +1015,7 @@ static int irtty_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
ASSERT
(
self
!=
NULL
,
return
-
1
;);
ASSERT
(
self
->
magic
==
IRTTY_MAGIC
,
return
-
1
;);
IRDA_DEBUG
(
3
,
__FUNCTION__
"(), %s, (cmd=0x%X)
\n
"
,
dev
->
name
,
cmd
);
IRDA_DEBUG
(
3
,
"%s(), %s, (cmd=0x%X)
\n
"
,
__FUNCTION__
,
dev
->
name
,
cmd
);
/* Locking :
* irda_device_dongle_init() can't be locked.
...
...
drivers/net/irda/ma600.c
View file @
aef84e55
...
...
@@ -48,7 +48,7 @@
#undef IRDA_DEBUG
#define IRDA_DEBUG(n, args...) (printk(KERN_DEBUG args))
#undef ASSERT
(expr, func)
#undef ASSERT
#define ASSERT(expr, func) \
if(!(expr)) { \
printk( "Assertion failed! %s,%s,%s,line=%d\n",\
...
...
@@ -86,13 +86,13 @@ static struct dongle_reg dongle = {
int
__init
ma600_init
(
void
)
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
return
irda_device_register_dongle
(
&
dongle
);
}
void
__exit
ma600_cleanup
(
void
)
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
irda_device_unregister_dongle
(
&
dongle
);
}
...
...
@@ -105,7 +105,7 @@ void __exit ma600_cleanup(void)
*/
static
void
ma600_open
(
dongle_t
*
self
,
struct
qos_info
*
qos
)
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
qos
->
baud_rate
.
bits
&=
IR_2400
|
IR_9600
|
IR_19200
|
IR_38400
|
IR_57600
|
IR_115200
;
...
...
@@ -123,7 +123,7 @@ static void ma600_open(dongle_t *self, struct qos_info *qos)
static
void
ma600_close
(
dongle_t
*
self
)
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
/* Power off dongle */
self
->
set_dtr_rts
(
self
->
dev
,
FALSE
,
FALSE
);
...
...
@@ -184,12 +184,12 @@ static int ma600_change_speed(struct irda_task *task)
__u8
byte_echo
;
int
ret
=
0
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
task
!=
NULL
,
return
-
1
;);
if
(
self
->
speed_task
&&
self
->
speed_task
!=
task
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), busy!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), busy!
\n
"
,
__FUNCTION__
);
return
MSECS_TO_JIFFIES
(
10
);
}
else
{
self
->
speed_task
=
task
;
...
...
@@ -215,7 +215,7 @@ static int ma600_change_speed(struct irda_task *task)
break
;
case
IRDA_TASK_CHILD_WAIT
:
WARNING
(
__FUNCTION__
"(), resetting dongle timed out!
\n
"
);
WARNING
(
"%s(), resetting dongle timed out!
\n
"
,
__FUNCTION__
);
ret
=
-
1
;
break
;
...
...
@@ -246,7 +246,7 @@ static int ma600_change_speed(struct irda_task *task)
if
(
byte
!=
byte_echo
)
{
/* if control byte != echo, I don't know what to do */
printk
(
KERN_WARNING
__FUNCTION__
"() control byte written != read!
\n
"
);
printk
(
KERN_WARNING
"%s() control byte written != read!
\n
"
,
__FUNCTION__
);
printk
(
KERN_WARNING
"control byte = 0x%c%c
\n
"
,
hexTbl
[(
byte
>>
4
)
&
0x0f
],
hexTbl
[
byte
&
0x0f
]);
printk
(
KERN_WARNING
"byte echo = 0x%c%c
\n
"
,
...
...
@@ -254,7 +254,7 @@ static int ma600_change_speed(struct irda_task *task)
hexTbl
[
byte_echo
&
0x0f
]);
#ifndef NDEBUG
}
else
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"() control byte write read OK
\n
"
);
IRDA_DEBUG
(
2
,
"%s() control byte write read OK
\n
"
,
__FUNCTION__
);
#endif
}
...
...
@@ -273,7 +273,7 @@ static int ma600_change_speed(struct irda_task *task)
break
;
default:
ERROR
(
__FUNCTION__
"(), unknown state %d
\n
"
,
task
->
state
);
ERROR
(
"%s(), unknown state %d
\n
"
,
__FUNCTION__
,
task
->
state
);
irda_task_next_state
(
task
,
IRDA_TASK_DONE
);
self
->
speed_task
=
NULL
;
ret
=
-
1
;
...
...
@@ -298,12 +298,12 @@ int ma600_reset(struct irda_task *task)
dongle_t
*
self
=
(
dongle_t
*
)
task
->
instance
;
int
ret
=
0
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
task
!=
NULL
,
return
-
1
;);
if
(
self
->
reset_task
&&
self
->
reset_task
!=
task
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), busy!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), busy!
\n
"
,
__FUNCTION__
);
return
MSECS_TO_JIFFIES
(
10
);
}
else
self
->
reset_task
=
task
;
...
...
@@ -326,7 +326,7 @@ int ma600_reset(struct irda_task *task)
self
->
reset_task
=
NULL
;
break
;
default:
ERROR
(
__FUNCTION__
"(), unknown state %d
\n
"
,
task
->
state
);
ERROR
(
"%s(), unknown state %d
\n
"
,
__FUNCTION__
,
task
->
state
);
irda_task_next_state
(
task
,
IRDA_TASK_DONE
);
self
->
reset_task
=
NULL
;
ret
=
-
1
;
...
...
drivers/net/irda/nsc-ircc.c
View file @
aef84e55
...
...
@@ -130,7 +130,7 @@ static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev);
static
int
nsc_ircc_hard_xmit_fir
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
static
int
nsc_ircc_pio_write
(
int
iobase
,
__u8
*
buf
,
int
len
,
int
fifo_size
);
static
void
nsc_ircc_dma_xmit
(
struct
nsc_ircc_cb
*
self
,
int
iobase
);
static
void
nsc_ircc_change_speed
(
struct
nsc_ircc_cb
*
self
,
__u32
baud
);
static
__u8
nsc_ircc_change_speed
(
struct
nsc_ircc_cb
*
self
,
__u32
baud
);
static
void
nsc_ircc_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
static
int
nsc_ircc_is_receiving
(
struct
nsc_ircc_cb
*
self
);
static
int
nsc_ircc_read_dongle_id
(
int
iobase
);
...
...
@@ -921,8 +921,8 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id)
break
;
case
0x0A
:
/* same as */
case
0x0B
:
/* Reserved */
IRDA_DEBUG
(
0
,
__FUNCTION__
"
(), %s not defined by irda yet
\n
"
,
dongle_types
[
dongle_id
]);
IRDA_DEBUG
(
0
,
"%s
(), %s not defined by irda yet
\n
"
,
__FUNCTION__
,
dongle_types
[
dongle_id
]);
break
;
case
0x0C
:
/* same as */
case
0x0D
:
/* HP HSDL-1100/HSDL-2100 */
...
...
@@ -930,14 +930,14 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id)
case
0x0E
:
/* Supports SIR Mode only */
break
;
case
0x0F
:
/* No dongle connected */
IRDA_DEBUG
(
0
,
__FUNCTION__
"
(), %s is not for IrDA mode
\n
"
,
dongle_types
[
dongle_id
]);
IRDA_DEBUG
(
0
,
"%s
(), %s is not for IrDA mode
\n
"
,
__FUNCTION__
,
dongle_types
[
dongle_id
]);
switch_bank
(
iobase
,
BANK0
);
outb
(
0x62
,
iobase
+
MCR
);
break
;
default:
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), invalid data_rate
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), invalid data_rate
\n
"
,
__FUNCTION__
);
}
/* Restore bank register */
outb
(
bank
,
iobase
+
BSR
);
...
...
@@ -948,17 +948,19 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id)
*
* Change the speed of the device
*
* This function *must* be called with irq off and spin-lock.
*/
static
void
nsc_ircc_change_speed
(
struct
nsc_ircc_cb
*
self
,
__u32
speed
)
static
__u8
nsc_ircc_change_speed
(
struct
nsc_ircc_cb
*
self
,
__u32
speed
)
{
struct
net_device
*
dev
=
self
->
netdev
;
__u8
mcr
=
MCR_SIR
;
int
iobase
;
__u8
bank
;
__u8
ier
;
/* Interrupt enable register */
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), speed=%d
\n
"
,
speed
);
IRDA_DEBUG
(
2
,
"%s(), speed=%d
\n
"
,
__FUNCTION__
,
speed
);
ASSERT
(
self
!=
NULL
,
return
;);
ASSERT
(
self
!=
NULL
,
return
0
;);
iobase
=
self
->
io
.
fir_base
;
...
...
@@ -989,20 +991,20 @@ static void nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed)
outb
(
inb
(
iobase
+
4
)
|
0x04
,
iobase
+
4
);
mcr
=
MCR_MIR
;
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), handling baud of 576000
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), handling baud of 576000
\n
"
,
__FUNCTION__
);
break
;
case
1152000
:
mcr
=
MCR_MIR
;
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), handling baud of 1152000
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), handling baud of 1152000
\n
"
,
__FUNCTION__
);
break
;
case
4000000
:
mcr
=
MCR_FIR
;
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), handling baud of 4000000
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), handling baud of 4000000
\n
"
,
__FUNCTION__
);
break
;
default:
mcr
=
MCR_FIR
;
IRDA_DEBUG
(
0
,
__FUNCTION__
"
(), unknown baud rate of %d
\n
"
,
speed
);
IRDA_DEBUG
(
0
,
"%s
(), unknown baud rate of %d
\n
"
,
__FUNCTION__
,
speed
);
break
;
}
...
...
@@ -1033,18 +1035,21 @@ static void nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed)
if
(
speed
>
115200
)
{
/* Install FIR xmit handler */
dev
->
hard_start_xmit
=
nsc_ircc_hard_xmit_fir
;
outb
(
IER_SFIF_IE
,
iobase
+
IER
)
;
ier
=
IER_SFIF_IE
;
nsc_ircc_dma_receive
(
self
);
}
else
{
/* Install SIR xmit handler */
dev
->
hard_start_xmit
=
nsc_ircc_hard_xmit_sir
;
outb
(
IER_RXHDL_IE
,
iobase
+
IER
)
;
ier
=
IER_RXHDL_IE
;
}
/* Set our current interrupt mask */
outb
(
ier
,
iobase
+
IER
);
/* Restore BSR */
outb
(
bank
,
iobase
+
BSR
);
netif_wake_queue
(
dev
);
/* Make sure interrupt handlers keep the proper interrupt mask */
return
(
ier
);
}
/*
...
...
@@ -1069,20 +1074,36 @@ static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue
(
dev
);
/* Make sure tests *& speed change are atomic */
spin_lock_irqsave
(
&
self
->
lock
,
flags
);
/* Check if we need to change the speed */
speed
=
irda_get_next_speed
(
skb
);
if
((
speed
!=
self
->
io
.
speed
)
&&
(
speed
!=
-
1
))
{
/* Check for empty frame */
/* Check for empty frame
.
*/
if
(
!
skb
->
len
)
{
/* If we just sent a frame, we get called before
* the last bytes get out (because of the SIR FIFO).
* If this is the case, let interrupt handler change
* the speed itself... Jean II */
if
(
self
->
io
.
direction
==
IO_RECV
)
{
nsc_ircc_change_speed
(
self
,
speed
);
/* TODO : For SIR->SIR, the next packet
* may get corrupted - Jean II */
netif_wake_queue
(
dev
);
}
else
{
self
->
new_speed
=
speed
;
/* Queue will be restarted after speed change
* to make sure packets gets through the
* proper xmit handler - Jean II */
}
spin_unlock_irqrestore
(
&
self
->
lock
,
flags
);
dev_kfree_skb
(
skb
);
return
0
;
}
else
self
->
new_speed
=
speed
;
}
spin_lock_irqsave
(
&
self
->
lock
,
flags
);
/* Save current bank */
bank
=
inb
(
iobase
+
BSR
);
...
...
@@ -1121,19 +1142,37 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue
(
dev
);
/* Make sure tests *& speed change are atomic */
spin_lock_irqsave
(
&
self
->
lock
,
flags
);
/* Check if we need to change the speed */
speed
=
irda_get_next_speed
(
skb
);
if
((
speed
!=
self
->
io
.
speed
)
&&
(
speed
!=
-
1
))
{
/* Check for empty frame */
/* Check for empty frame
.
*/
if
(
!
skb
->
len
)
{
/* If we are currently transmitting, defer to
* interrupt handler. - Jean II */
if
(
self
->
tx_fifo
.
len
==
0
)
{
nsc_ircc_change_speed
(
self
,
speed
);
netif_wake_queue
(
dev
);
}
else
{
self
->
new_speed
=
speed
;
/* Keep queue stopped :
* the speed change operation may change the
* xmit handler, and we want to make sure
* the next packet get through the proper
* Tx path, so block the Tx queue until
* the speed change has been done.
* Jean II */
}
spin_unlock_irqrestore
(
&
self
->
lock
,
flags
);
dev_kfree_skb
(
skb
);
return
0
;
}
else
}
else
{
/* Change speed after current frame */
self
->
new_speed
=
speed
;
}
spin_lock_irqsave
(
&
self
->
lock
,
flags
);
}
/* Save current bank */
bank
=
inb
(
iobase
+
BSR
);
...
...
@@ -1204,8 +1243,9 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
nsc_ircc_dma_xmit
(
self
,
iobase
);
}
out:
/* Not busy transmitting anymore if window is not full */
if
(
self
->
tx_fifo
.
free
<
MAX_TX_WINDOW
)
/* Not busy transmitting anymore if window is not full,
* and if we don't need to change speed */
if
((
self
->
tx_fifo
.
free
<
MAX_TX_WINDOW
)
&&
(
self
->
new_speed
==
0
))
netif_wake_queue
(
self
->
netdev
);
/* Restore bank register */
...
...
@@ -1265,15 +1305,15 @@ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
int
actual
=
0
;
__u8
bank
;
IRDA_DEBUG
(
4
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
4
,
"%s()
\n
"
,
__FUNCTION__
);
/* Save current bank */
bank
=
inb
(
iobase
+
BSR
);
switch_bank
(
iobase
,
BANK0
);
if
(
!
(
inb_p
(
iobase
+
LSR
)
&
LSR_TXEMP
))
{
IRDA_DEBUG
(
4
,
__FUNCTION__
"(), warning, FIFO not empty yet!
\n
"
);
IRDA_DEBUG
(
4
,
"%s(), warning, FIFO not empty yet!
\n
"
,
__FUNCTION__
);
/* FIFO may still be filled to the Tx interrupt threshold */
fifo_size
-=
17
;
...
...
@@ -1285,8 +1325,8 @@ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
outb
(
buf
[
actual
++
],
iobase
+
TXD
);
}
IRDA_DEBUG
(
4
,
__FUNCTION__
"
(), fifo_size %d ; %d sent of %d
\n
"
,
fifo_size
,
actual
,
len
);
IRDA_DEBUG
(
4
,
"%s
(), fifo_size %d ; %d sent of %d
\n
"
,
__FUNCTION__
,
fifo_size
,
actual
,
len
);
/* Restore bank */
outb
(
bank
,
iobase
+
BSR
);
...
...
@@ -1307,7 +1347,7 @@ static int nsc_ircc_dma_xmit_complete(struct nsc_ircc_cb *self)
__u8
bank
;
int
ret
=
TRUE
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
iobase
=
self
->
io
.
fir_base
;
...
...
@@ -1329,12 +1369,6 @@ static int nsc_ircc_dma_xmit_complete(struct nsc_ircc_cb *self)
self
->
stats
.
tx_packets
++
;
}
/* Check if we need to change the speed */
if
(
self
->
new_speed
)
{
nsc_ircc_change_speed
(
self
,
self
->
new_speed
);
self
->
new_speed
=
0
;
}
/* Finished with this frame, so prepare for next */
self
->
tx_fifo
.
ptr
++
;
self
->
tx_fifo
.
len
--
;
...
...
@@ -1351,8 +1385,9 @@ static int nsc_ircc_dma_xmit_complete(struct nsc_ircc_cb *self)
self
->
tx_fifo
.
tail
=
self
->
tx_buff
.
head
;
}
/* Make sure we have room for more frames */
if
(
self
->
tx_fifo
.
free
<
MAX_TX_WINDOW
)
{
/* Make sure we have room for more frames and
* that we don't need to change speed */
if
((
self
->
tx_fifo
.
free
<
MAX_TX_WINDOW
)
&&
(
self
->
new_speed
==
0
))
{
/* Not busy transmitting anymore */
/* Tell the network layer, that we can accept more frames */
netif_wake_queue
(
self
->
netdev
);
...
...
@@ -1443,7 +1478,7 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
len
=
inb
(
iobase
+
RFLFL
)
|
((
inb
(
iobase
+
RFLFH
)
&
0x1f
)
<<
8
);
if
(
st_fifo
->
tail
>=
MAX_RX_WINDOW
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), window is full!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), window is full!
\n
"
,
__FUNCTION__
);
continue
;
}
...
...
@@ -1629,24 +1664,25 @@ static void nsc_ircc_sir_interrupt(struct nsc_ircc_cb *self, int eir)
}
/* Check if transmission has completed */
if
(
eir
&
EIR_TXEMP_EV
)
{
/* Check if we need to change the speed? */
/* Turn around and get ready to receive some data */
self
->
io
.
direction
=
IO_RECV
;
self
->
ier
=
IER_RXHDL_IE
;
/* Check if we need to change the speed?
* Need to be after self->io.direction to avoid race with
* nsc_ircc_hard_xmit_sir() - Jean II */
if
(
self
->
new_speed
)
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), Changing speed!
\n
"
);
nsc_ircc_change_speed
(
self
,
self
->
new_speed
);
IRDA_DEBUG
(
2
,
"%s(), Changing speed!
\n
"
,
__FUNCTION__
);
self
->
ier
=
nsc_ircc_change_speed
(
self
,
self
->
new_speed
);
self
->
new_speed
=
0
;
netif_wake_queue
(
self
->
netdev
);
/* Check if we are going to FIR */
if
(
self
->
io
.
speed
>
115200
)
{
/* Should wait for status FIFO interrupt */
self
->
ier
=
IER_SFIF_IE
;
/* No need to do anymore SIR stuff */
return
;
}
}
/* Turn around and get ready to receive some data */
self
->
io
.
direction
=
IO_RECV
;
self
->
ier
=
IER_RXHDL_IE
;
}
/* Rx FIFO threshold or timeout */
...
...
@@ -1706,18 +1742,36 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase,
}
else
if
(
eir
&
EIR_DMA_EV
)
{
/* Finished with all transmissions? */
if
(
nsc_ircc_dma_xmit_complete
(
self
))
{
/* Check if there are more frames to be transmitted */
if
(
self
->
new_speed
!=
0
)
{
/* As we stop the Tx queue, the speed change
* need to be done when the Tx fifo is
* empty. Ask for a Tx done interrupt */
self
->
ier
=
IER_TXEMP_IE
;
}
else
{
/* Check if there are more frames to be
* transmitted */
if
(
irda_device_txqueue_empty
(
self
->
netdev
))
{
/* Prepare for receive */
nsc_ircc_dma_receive
(
self
);
self
->
ier
=
IER_SFIF_IE
;
}
else
WARNING
(
"%s(), potential "
"Tx queue lockup !
\n
"
,
__FUNCTION__
);
}
}
else
{
/* Not finished yet, so interrupt on DMA again */
self
->
ier
=
IER_DMA_IE
;
}
}
else
if
(
eir
&
EIR_TXEMP_EV
)
{
/* The Tx FIFO has totally drained out, so now we can change
* the speed... - Jean II */
self
->
ier
=
nsc_ircc_change_speed
(
self
,
self
->
new_speed
);
self
->
new_speed
=
0
;
netif_wake_queue
(
self
->
netdev
);
/* Note : nsc_ircc_change_speed() restarted Rx fifo */
}
outb
(
bank
,
iobase
+
BSR
);
}
...
...
@@ -1810,7 +1864,7 @@ static int nsc_ircc_is_receiving(struct nsc_ircc_cb *self)
*/
static
int
nsc_ircc_net_init
(
struct
net_device
*
dev
)
{
IRDA_DEBUG
(
4
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
4
,
"%s()
\n
"
,
__FUNCTION__
);
/* Setup to be a normal IrDA network device driver */
irda_device_setup
(
dev
);
...
...
@@ -1833,7 +1887,7 @@ static int nsc_ircc_net_open(struct net_device *dev)
char
hwname
[
32
];
__u8
bank
;
IRDA_DEBUG
(
4
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
4
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
dev
!=
NULL
,
return
-
1
;);
self
=
(
struct
nsc_ircc_cb
*
)
dev
->
priv
;
...
...
@@ -1897,7 +1951,7 @@ static int nsc_ircc_net_close(struct net_device *dev)
int
iobase
;
__u8
bank
;
IRDA_DEBUG
(
4
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
4
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
dev
!=
NULL
,
return
-
1
;);
...
...
@@ -1953,7 +2007,7 @@ static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
ASSERT
(
self
!=
NULL
,
return
-
1
;);
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), %s, (cmd=0x%X)
\n
"
,
dev
->
name
,
cmd
);
IRDA_DEBUG
(
2
,
"%s(), %s, (cmd=0x%X)
\n
"
,
__FUNCTION__
,
dev
->
name
,
cmd
);
switch
(
cmd
)
{
case
SIOCSBANDWIDTH
:
/* Set bandwidth */
...
...
net/irda/af_irda.c
View file @
aef84e55
...
...
@@ -509,7 +509,7 @@ static int irda_open_lsap(struct irda_sock *self, int pid)
notify_t
notify
;
if
(
self
->
lsap
)
{
WARNING
(
__FUNCTION__
"(), busy!
\n
"
);
WARNING
(
"%s(), busy!
\n
"
,
__FUNCTION__
);
return
-
EBUSY
;
}
...
...
@@ -521,7 +521,7 @@ static int irda_open_lsap(struct irda_sock *self, int pid)
self
->
lsap
=
irlmp_open_lsap
(
LSAP_CONNLESS
,
&
notify
,
pid
);
if
(
self
->
lsap
==
NULL
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), Unable to allocate LSAP!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), Unable to allocate LSAP!
\n
"
,
__FUNCTION__
);
return
-
ENOMEM
;
}
...
...
@@ -542,12 +542,12 @@ static int irda_open_lsap(struct irda_sock *self, int pid)
*/
static
int
irda_find_lsap_sel
(
struct
irda_sock
*
self
,
char
*
name
)
{
IRDA_DEBUG
(
2
,
__FUNCTION__
"(%p, %s)
\n
"
,
self
,
name
);
IRDA_DEBUG
(
2
,
"%s(%p, %s)
\n
"
,
__FUNCTION__
,
self
,
name
);
ASSERT
(
self
!=
NULL
,
return
-
1
;);
if
(
self
->
iriap
)
{
WARNING
(
"%s: busy with a previous query
\n
"
,
__FUNCTION__
);
WARNING
(
"%s
()
: busy with a previous query
\n
"
,
__FUNCTION__
);
return
-
EBUSY
;
}
...
...
@@ -582,8 +582,8 @@ static int irda_find_lsap_sel(struct irda_sock *self, char *name)
/* Get the remote TSAP selector */
switch
(
self
->
ias_result
->
type
)
{
case
IAS_INTEGER
:
IRDA_DEBUG
(
4
,
__FUNCTION__
"
() int=%d
\n
"
,
self
->
ias_result
->
t
.
integer
);
IRDA_DEBUG
(
4
,
"%s
() int=%d
\n
"
,
__FUNCTION__
,
self
->
ias_result
->
t
.
integer
);
if
(
self
->
ias_result
->
t
.
integer
!=
-
1
)
self
->
dtsap_sel
=
self
->
ias_result
->
t
.
integer
;
...
...
@@ -592,7 +592,7 @@ static int irda_find_lsap_sel(struct irda_sock *self, char *name)
break
;
default:
self
->
dtsap_sel
=
0
;
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), bad type!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), bad type!
\n
"
,
__FUNCTION__
);
break
;
}
if
(
self
->
ias_result
)
...
...
@@ -630,7 +630,7 @@ static int irda_discover_daddr_and_lsap_sel(struct irda_sock *self, char *name)
__u32
daddr
=
DEV_ADDR_ANY
;
/* Address we found the service on */
__u8
dtsap_sel
=
0x0
;
/* TSAP associated with it */
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), name=%s
\n
"
,
name
);
IRDA_DEBUG
(
2
,
"%s(), name=%s
\n
"
,
__FUNCTION__
,
name
);
ASSERT
(
self
!=
NULL
,
return
-
1
;);
...
...
@@ -652,8 +652,8 @@ static int irda_discover_daddr_and_lsap_sel(struct irda_sock *self, char *name)
/* Try the address in the log */
self
->
daddr
=
discoveries
[
i
].
daddr
;
self
->
saddr
=
0x0
;
IRDA_DEBUG
(
1
,
__FUNCTION__
"
(), trying daddr = %08x
\n
"
,
self
->
daddr
);
IRDA_DEBUG
(
1
,
"%s
(), trying daddr = %08x
\n
"
,
__FUNCTION__
,
self
->
daddr
);
/* Query remote LM-IAS for this service */
err
=
irda_find_lsap_sel
(
self
,
name
);
...
...
@@ -661,9 +661,8 @@ static int irda_discover_daddr_and_lsap_sel(struct irda_sock *self, char *name)
case
0
:
/* We found the requested service */
if
(
daddr
!=
DEV_ADDR_ANY
)
{
IRDA_DEBUG
(
1
,
__FUNCTION__
"(), discovered service ''%s'' in two different devices !!!
\n
"
,
name
);
IRDA_DEBUG
(
1
,
"%s(), discovered service ''%s'' in two different devices !!!
\n
"
,
__FUNCTION__
,
name
);
self
->
daddr
=
DEV_ADDR_ANY
;
kfree
(
discoveries
);
return
(
-
ENOTUNIQ
);
...
...
@@ -677,8 +676,7 @@ static int irda_discover_daddr_and_lsap_sel(struct irda_sock *self, char *name)
break
;
default:
/* Something bad did happen :-( */
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), unexpected IAS query failure
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), unexpected IAS query failure
\n
"
,
__FUNCTION__
);
self
->
daddr
=
DEV_ADDR_ANY
;
kfree
(
discoveries
);
return
(
-
EHOSTUNREACH
);
...
...
@@ -690,9 +688,8 @@ static int irda_discover_daddr_and_lsap_sel(struct irda_sock *self, char *name)
/* Check out what we found */
if
(
daddr
==
DEV_ADDR_ANY
)
{
IRDA_DEBUG
(
1
,
__FUNCTION__
"(), cannot discover service ''%s'' in any device !!!
\n
"
,
name
);
IRDA_DEBUG
(
1
,
"%s(), cannot discover service ''%s'' in any device !!!
\n
"
,
__FUNCTION__
,
name
);
self
->
daddr
=
DEV_ADDR_ANY
;
return
(
-
EADDRNOTAVAIL
);
}
...
...
@@ -702,9 +699,8 @@ static int irda_discover_daddr_and_lsap_sel(struct irda_sock *self, char *name)
self
->
saddr
=
0x0
;
self
->
dtsap_sel
=
dtsap_sel
;
IRDA_DEBUG
(
1
,
__FUNCTION__
"(), discovered requested service ''%s'' at address %08x
\n
"
,
name
,
self
->
daddr
);
IRDA_DEBUG
(
1
,
"%s(), discovered requested service ''%s'' at address %08x
\n
"
,
__FUNCTION__
,
name
,
self
->
daddr
);
return
0
;
}
...
...
@@ -735,8 +731,8 @@ static int irda_getname(struct socket *sock, struct sockaddr *uaddr,
saddr
.
sir_addr
=
self
->
saddr
;
}
IRDA_DEBUG
(
1
,
__FUNCTION__
"(), tsap_sel = %#x
\n
"
,
saddr
.
sir_lsap_sel
);
IRDA_DEBUG
(
1
,
__FUNCTION__
"(), addr = %08x
\n
"
,
saddr
.
sir_addr
);
IRDA_DEBUG
(
1
,
"%s(), tsap_sel = %#x
\n
"
,
__FUNCTION__
,
saddr
.
sir_lsap_sel
);
IRDA_DEBUG
(
1
,
"%s(), addr = %08x
\n
"
,
__FUNCTION__
,
saddr
.
sir_addr
);
/* uaddr_len come to us uninitialised */
*
uaddr_len
=
sizeof
(
struct
sockaddr_irda
);
...
...
@@ -755,7 +751,7 @@ static int irda_listen(struct socket *sock, int backlog)
{
struct
sock
*
sk
=
sock
->
sk
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
if
((
sk
->
type
!=
SOCK_STREAM
)
&&
(
sk
->
type
!=
SOCK_SEQPACKET
)
&&
(
sk
->
type
!=
SOCK_DGRAM
))
...
...
@@ -786,7 +782,7 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
ASSERT
(
self
!=
NULL
,
return
-
1
;);
IRDA_DEBUG
(
2
,
__FUNCTION__
"(%p)
\n
"
,
self
);
IRDA_DEBUG
(
2
,
"%s(%p)
\n
"
,
__FUNCTION__
,
self
);
if
(
addr_len
!=
sizeof
(
struct
sockaddr_irda
))
return
-
EINVAL
;
...
...
@@ -796,8 +792,7 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if
((
sk
->
type
==
SOCK_DGRAM
)
&&
(
sk
->
protocol
==
IRDAPROTO_ULTRA
))
{
self
->
pid
=
addr
->
sir_lsap_sel
;
if
(
self
->
pid
&
0x80
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), extension in PID not supp!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), extension in PID not supp!
\n
"
,
__FUNCTION__
);
return
-
EOPNOTSUPP
;
}
err
=
irda_open_lsap
(
self
,
self
->
pid
);
...
...
@@ -842,7 +837,7 @@ static int irda_accept(struct socket *sock, struct socket *newsock, int flags)
struct
sk_buff
*
skb
;
int
err
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"()
\n
"
);
IRDA_DEBUG
(
2
,
"%s()
\n
"
,
__FUNCTION__
);
ASSERT
(
self
!=
NULL
,
return
-
1
;);
...
...
@@ -918,7 +913,7 @@ static int irda_accept(struct socket *sock, struct socket *newsock, int flags)
/* Now attach up the new socket */
new
->
tsap
=
irttp_dup
(
self
->
tsap
,
new
);
if
(
!
new
->
tsap
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), dup failed!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), dup failed!
\n
"
,
__FUNCTION__
);
return
-
1
;
}
...
...
@@ -977,7 +972,7 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr,
struct
irda_sock
*
self
=
irda_sk
(
sk
);
int
err
;
IRDA_DEBUG
(
2
,
__FUNCTION__
"(%p)
\n
"
,
self
);
IRDA_DEBUG
(
2
,
"%s(%p)
\n
"
,
__FUNCTION__
,
self
);
/* Don't allow connect for Ultra sockets */
if
((
sk
->
type
==
SOCK_DGRAM
)
&&
(
sk
->
protocol
==
IRDAPROTO_ULTRA
))
...
...
@@ -1007,19 +1002,18 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr,
/* Try to find one suitable */
err
=
irda_discover_daddr_and_lsap_sel
(
self
,
addr
->
sir_name
);
if
(
err
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), auto-connect failed!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), auto-connect failed!
\n
"
,
__FUNCTION__
);
return
err
;
}
}
else
{
/* Use the one provided by the user */
self
->
daddr
=
addr
->
sir_addr
;
IRDA_DEBUG
(
1
,
__FUNCTION__
"(), daddr = %08x
\n
"
,
self
->
daddr
);
IRDA_DEBUG
(
1
,
"%s(), daddr = %08x
\n
"
,
__FUNCTION__
,
self
->
daddr
);
/* Query remote LM-IAS */
err
=
irda_find_lsap_sel
(
self
,
addr
->
sir_name
);
if
(
err
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), connect failed!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), connect failed!
\n
"
,
__FUNCTION__
);
return
err
;
}
}
...
...
@@ -1037,7 +1031,7 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr,
self
->
saddr
,
self
->
daddr
,
NULL
,
self
->
max_sdu_size_rx
,
NULL
);
if
(
err
)
{
IRDA_DEBUG
(
0
,
__FUNCTION__
"(), connect failed!
\n
"
);
IRDA_DEBUG
(
0
,
"%s(), connect failed!
\n
"
,
__FUNCTION__
);
return
err
;
}
...
...
net/irda/ircomm/ircomm_core.c
View file @
aef84e55
...
...
@@ -63,7 +63,7 @@ int __init ircomm_init(void)
{
ircomm
=
hashbin_new
(
HB_LOCK
);
if
(
ircomm
==
NULL
)
{
ERROR
(
__FUNCTION__
"(), can't allocate hashbin!
\n
"
);
ERROR
(
"%s(), can't allocate hashbin!
\n
"
,
__FUNCTION__
);
return
-
ENOMEM
;
}
...
...
net/irda/ircomm/ircomm_lmp.c
View file @
aef84e55
...
...
@@ -228,7 +228,7 @@ int ircomm_lmp_data_request(struct ircomm_cb *self, struct sk_buff *skb,
}
ret
=
irlmp_data_request
(
self
->
lsap
,
skb
);
if
(
ret
)
{
ERROR
(
__FUNCTION__
"(), failed
\n
"
);
ERROR
(
"%s(), failed
\n
"
,
__FUNCTION__
);
dev_kfree_skb
(
skb
);
}
...
...
net/irda/ircomm/ircomm_param.c
View file @
aef84e55
...
...
@@ -154,7 +154,7 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush)
count
=
irda_param_insert
(
self
,
pi
,
skb
->
tail
,
skb_tailroom
(
skb
),
&
ircomm_param_info
);
if
(
count
<
0
)
{
WARNING
(
__FUNCTION__
"(), no room for parameter!
\n
"
);
WARNING
(
"%s(), no room for parameter!
\n
"
,
__FUNCTION__
);
spin_unlock_irqrestore
(
&
self
->
spinlock
,
flags
);
return
-
1
;
}
...
...
net/irda/ircomm/ircomm_ttp.c
View file @
aef84e55
...
...
@@ -146,7 +146,7 @@ int ircomm_ttp_data_request(struct ircomm_cb *self, struct sk_buff *skb,
ret
=
irttp_data_request
(
self
->
tsap
,
skb
);
if
(
ret
)
{
ERROR
(
__FUNCTION__
"(), failed
\n
"
);
ERROR
(
"%s(), failed
\n
"
,
__FUNCTION__
);
dev_kfree_skb
(
skb
);
}
...
...
@@ -192,7 +192,7 @@ void ircomm_ttp_connect_confirm(void *instance, void *sap,
ASSERT
(
qos
!=
NULL
,
return
;);
if
(
max_sdu_size
!=
TTP_SAR_DISABLE
)
{
ERROR
(
__FUNCTION__
"(), SAR not allowed for IrCOMM!
\n
"
);
ERROR
(
"%s(), SAR not allowed for IrCOMM!
\n
"
,
__FUNCTION__
);
dev_kfree_skb
(
skb
);
return
;
}
...
...
@@ -229,7 +229,7 @@ void ircomm_ttp_connect_indication(void *instance, void *sap,
ASSERT
(
qos
!=
NULL
,
return
;);
if
(
max_sdu_size
!=
TTP_SAR_DISABLE
)
{
ERROR
(
__FUNCTION__
"(), SAR not allowed for IrCOMM!
\n
"
);
ERROR
(
"%s(), SAR not allowed for IrCOMM!
\n
"
,
__FUNCTION__
);
dev_kfree_skb
(
skb
);
return
;
}
...
...
net/irda/ircomm/ircomm_tty.c
View file @
aef84e55
...
...
@@ -92,7 +92,7 @@ int __init ircomm_tty_init(void)
{
ircomm_tty
=
hashbin_new
(
HB_LOCK
);
if
(
ircomm_tty
==
NULL
)
{
ERROR
(
__FUNCTION__
"(), can't allocate hashbin!
\n
"
);
ERROR
(
"%s(), can't allocate hashbin!
\n
"
,
__FUNCTION__
);
return
-
ENOMEM
;
}
...
...
@@ -135,7 +135,7 @@ int __init ircomm_tty_init(void)
driver
.
read_proc
=
ircomm_tty_read_proc
;
#endif
/* CONFIG_PROC_FS */
if
(
tty_register_driver
(
&
driver
))
{
ERROR
(
__FUNCTION__
"Couldn't register serial driver
\n
"
);
ERROR
(
"%s(): Couldn't register serial driver
\n
"
,
__FUNCTION__
);
return
-
1
;
}
return
0
;
...
...
@@ -168,7 +168,7 @@ void __exit ircomm_tty_cleanup(void)
ret
=
tty_unregister_driver
(
&
driver
);
if
(
ret
)
{
ERROR
(
__FUNCTION__
"(), failed to unregister driver
\n
"
);
ERROR
(
"%s(), failed to unregister driver
\n
"
,
__FUNCTION__
);
return
;
}
...
...
@@ -223,7 +223,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self)
/* Connect IrCOMM link with remote device */
ret
=
ircomm_tty_attach_cable
(
self
);
if
(
ret
<
0
)
{
ERROR
(
__FUNCTION__
"(), error attaching cable!
\n
"
);
ERROR
(
"%s(), error attaching cable!
\n
"
,
__FUNCTION__
);
return
ret
;
}
...
...
@@ -410,7 +410,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
/* No, so make new instance */
self
=
kmalloc
(
sizeof
(
struct
ircomm_tty_cb
),
GFP_KERNEL
);
if
(
self
==
NULL
)
{
ERROR
(
__FUNCTION__
"(), kmalloc failed!
\n
"
);
ERROR
(
"%s(), kmalloc failed!
\n
"
,
__FUNCTION__
);
MOD_DEC_USE_COUNT
;
return
-
ENOMEM
;
}
...
...
@@ -563,9 +563,8 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
}
if
(
--
self
->
open_count
<
0
)
{
ERROR
(
__FUNCTION__
"(), bad serial port count for ttys%d: %d
\n
"
,
self
->
line
,
self
->
open_count
);
ERROR
(
"%s(), bad serial port count for ttys%d: %d
\n
"
,
__FUNCTION__
,
self
->
line
,
self
->
open_count
);
self
->
open_count
=
0
;
}
if
(
self
->
open_count
)
{
...
...
net/irda/ircomm/ircomm_tty_attach.c
View file @
aef84e55
...
...
@@ -601,8 +601,7 @@ static int ircomm_tty_state_idle(struct ircomm_tty_cb *self,
self
->
saddr
=
info
->
saddr
;
if
(
self
->
iriap
)
{
WARNING
(
__FUNCTION__
"(), busy with a previous query
\n
"
);
WARNING
(
"%s(), busy with a previous query
\n
"
,
__FUNCTION__
);
return
-
EBUSY
;
}
...
...
@@ -659,8 +658,7 @@ static int ircomm_tty_state_search(struct ircomm_tty_cb *self,
self
->
saddr
=
info
->
saddr
;
if
(
self
->
iriap
)
{
WARNING
(
__FUNCTION__
"(), busy with a previous query
\n
"
);
WARNING
(
"%s(), busy with a previous query
\n
"
,
__FUNCTION__
);
return
-
EBUSY
;
}
...
...
@@ -728,8 +726,7 @@ static int ircomm_tty_state_query_parameters(struct ircomm_tty_cb *self,
switch
(
event
)
{
case
IRCOMM_TTY_GOT_PARAMETERS
:
if
(
self
->
iriap
)
{
WARNING
(
__FUNCTION__
"(), busy with a previous query
\n
"
);
WARNING
(
"%s(), busy with a previous query
\n
"
,
__FUNCTION__
);
return
-
EBUSY
;
}
...
...
net/irda/ircomm/ircomm_tty_ioctl.c
View file @
aef84e55
...
...
@@ -95,7 +95,7 @@ void ircomm_tty_change_speed(struct ircomm_tty_cb *self)
self
->
settings
.
flow_control
|=
IRCOMM_RTS_CTS_IN
;
/* This got me. Bummer. Jean II */
if
(
self
->
service_type
==
IRCOMM_3_WIRE_RAW
)
WARNING
(
__FUNCTION__
"(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)
\n
"
);
WARNING
(
"%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)
\n
"
,
__FUNCTION__
);
}
else
{
self
->
flags
&=
~
ASYNC_CTS_FLOW
;
self
->
settings
.
flow_control
&=
~
IRCOMM_RTS_CTS_IN
;
...
...
net/irda/irlan/irlan_client.c
View file @
aef84e55
...
...
@@ -367,7 +367,7 @@ void irlan_client_parse_response(struct irlan_cb *self, struct sk_buff *skb)
ASSERT
(
self
->
magic
==
IRLAN_MAGIC
,
return
;);
if
(
!
skb
)
{
ERROR
(
__FUNCTION__
"(), Got NULL skb!
\n
"
);
ERROR
(
"%s(), Got NULL skb!
\n
"
,
__FUNCTION__
);
return
;
}
frame
=
skb
->
data
;
...
...
net/irda/irlan/irlan_client_event.c
View file @
aef84e55
...
...
@@ -100,8 +100,7 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event,
switch
(
event
)
{
case
IRLAN_DISCOVERY_INDICATION
:
if
(
self
->
client
.
iriap
)
{
WARNING
(
__FUNCTION__
"(), busy with a previous query
\n
"
);
WARNING
(
"%s(), busy with a previous query
\n
"
,
__FUNCTION__
);
return
-
EBUSY
;
}
...
...
net/irda/irlan/irlan_common.c
View file @
aef84e55
...
...
@@ -424,7 +424,7 @@ void irlan_disconnect_indication(void *instance, void *sap, LM_REASON reason,
IRDA_DEBUG
(
2
,
__FUNCTION__
"(), IrLMP connect failed
\n
"
);
break
;
default:
ERROR
(
__FUNCTION__
"(), Unknown disconnect reason
\n
"
);
ERROR
(
"%s(), Unknown disconnect reason
\n
"
,
__FUNCTION__
);
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment