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
Kirill Smelkov
linux
Commits
752d3f60
Commit
752d3f60
authored
Apr 30, 2002
by
Jean Tourrilhes
Committed by
Linus Torvalds
Apr 30, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
irda update 5/7:
o [CORRECT] Load dongle module with irq disabled in irtty
parent
177030c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
10 deletions
+34
-10
drivers/net/irda/irtty.c
drivers/net/irda/irtty.c
+24
-10
net/irda/irda_device.c
net/irda/irda_device.c
+10
-0
No files found.
drivers/net/irda/irtty.c
View file @
752d3f60
...
@@ -970,9 +970,14 @@ static int irtty_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
...
@@ -970,9 +970,14 @@ static int irtty_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
IRDA_DEBUG
(
3
,
__FUNCTION__
"(), %s, (cmd=0x%X)
\n
"
,
dev
->
name
,
cmd
);
IRDA_DEBUG
(
3
,
__FUNCTION__
"(), %s, (cmd=0x%X)
\n
"
,
dev
->
name
,
cmd
);
/* Disable interrupts & save flags */
/* Locking :
save_flags
(
flags
);
* irda_device_dongle_init() can't be locked.
cli
();
* irda_task_execute() doesn't need to be locked (but
* irtty_change_speed() should protect itself).
* As this driver doesn't have spinlock protection, keep
* old fashion locking :-(
* Jean II
*/
switch
(
cmd
)
{
switch
(
cmd
)
{
case
SIOCSBANDWIDTH
:
/* Set bandwidth */
case
SIOCSBANDWIDTH
:
/* Set bandwidth */
...
@@ -998,14 +1003,17 @@ static int irtty_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
...
@@ -998,14 +1003,17 @@ static int irtty_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
dongle
->
write
=
irtty_raw_write
;
dongle
->
write
=
irtty_raw_write
;
dongle
->
set_dtr_rts
=
irtty_set_dtr_rts
;
dongle
->
set_dtr_rts
=
irtty_set_dtr_rts
;
self
->
dongle
=
dongle
;
/* Now initialize the dongle!
* Safe to do unlocked : self->dongle is still NULL. */
/* Now initialize the dongle! */
dongle
->
issue
->
open
(
dongle
,
&
self
->
qos
);
dongle
->
issue
->
open
(
dongle
,
&
self
->
qos
);
/* Reset dongle */
/* Reset dongle */
irda_task_execute
(
dongle
,
dongle
->
issue
->
reset
,
NULL
,
NULL
,
irda_task_execute
(
dongle
,
dongle
->
issue
->
reset
,
NULL
,
NULL
,
NULL
);
NULL
);
/* Make dongle available to driver only now to avoid
* race conditions - Jean II */
self
->
dongle
=
dongle
;
break
;
break
;
case
SIOCSMEDIABUSY
:
/* Set media busy */
case
SIOCSMEDIABUSY
:
/* Set media busy */
if
(
!
capable
(
CAP_NET_ADMIN
))
if
(
!
capable
(
CAP_NET_ADMIN
))
...
@@ -1019,21 +1027,27 @@ static int irtty_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
...
@@ -1019,21 +1027,27 @@ static int irtty_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
case
SIOCSDTRRTS
:
case
SIOCSDTRRTS
:
if
(
!
capable
(
CAP_NET_ADMIN
))
if
(
!
capable
(
CAP_NET_ADMIN
))
ret
=
-
EPERM
;
ret
=
-
EPERM
;
else
else
{
save_flags
(
flags
);
cli
();
irtty_set_dtr_rts
(
dev
,
irq
->
ifr_dtr
,
irq
->
ifr_rts
);
irtty_set_dtr_rts
(
dev
,
irq
->
ifr_dtr
,
irq
->
ifr_rts
);
restore_flags
(
flags
);
}
break
;
break
;
case
SIOCSMODE
:
case
SIOCSMODE
:
if
(
!
capable
(
CAP_NET_ADMIN
))
if
(
!
capable
(
CAP_NET_ADMIN
))
ret
=
-
EPERM
;
ret
=
-
EPERM
;
else
else
{
save_flags
(
flags
);
cli
();
irtty_set_mode
(
dev
,
irq
->
ifr_mode
);
irtty_set_mode
(
dev
,
irq
->
ifr_mode
);
restore_flags
(
flags
);
}
break
;
break
;
default:
default:
ret
=
-
EOPNOTSUPP
;
ret
=
-
EOPNOTSUPP
;
}
}
restore_flags
(
flags
);
return
ret
;
return
ret
;
}
}
...
...
net/irda/irda_device.c
View file @
752d3f60
...
@@ -368,6 +368,12 @@ int irda_task_kick(struct irda_task *task)
...
@@ -368,6 +368,12 @@ int irda_task_kick(struct irda_task *task)
* time to complete. We do it this hairy way since we may have been
* time to complete. We do it this hairy way since we may have been
* called from interrupt context, so it's not possible to use
* called from interrupt context, so it's not possible to use
* schedule_timeout()
* schedule_timeout()
* Two important notes :
* o Make sure you irda_task_delete(task); in case you delete the
* calling instance.
* o No real need to lock when calling this function, but you may
* want to lock within the task handler.
* Jean II
*/
*/
struct
irda_task
*
irda_task_execute
(
void
*
instance
,
struct
irda_task
*
irda_task_execute
(
void
*
instance
,
IRDA_TASK_CALLBACK
function
,
IRDA_TASK_CALLBACK
function
,
...
@@ -466,6 +472,9 @@ int irda_device_txqueue_empty(struct net_device *dev)
...
@@ -466,6 +472,9 @@ int irda_device_txqueue_empty(struct net_device *dev)
* Function irda_device_init_dongle (self, type, qos)
* Function irda_device_init_dongle (self, type, qos)
*
*
* Initialize attached dongle.
* Initialize attached dongle.
*
* Important : request_module require us to call this function with
* a process context and irq enabled. - Jean II
*/
*/
dongle_t
*
irda_device_dongle_init
(
struct
net_device
*
dev
,
int
type
)
dongle_t
*
irda_device_dongle_init
(
struct
net_device
*
dev
,
int
type
)
{
{
...
@@ -477,6 +486,7 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
...
@@ -477,6 +486,7 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
#ifdef CONFIG_KMOD
#ifdef CONFIG_KMOD
{
{
char
modname
[
32
];
char
modname
[
32
];
ASSERT
(
!
in_interrupt
(),
return
NULL
;);
/* Try to load the module needed */
/* Try to load the module needed */
sprintf
(
modname
,
"irda-dongle-%d"
,
type
);
sprintf
(
modname
,
"irda-dongle-%d"
,
type
);
request_module
(
modname
);
request_module
(
modname
);
...
...
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