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
2a2ff7fc
Commit
2a2ff7fc
authored
Aug 14, 2003
by
Jeroen Vreeken
Committed by
David S. Miller
Aug 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NETROM]: Better control over the AX25 devices.
parent
94ca866c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
net/netrom/af_netrom.c
net/netrom/af_netrom.c
+7
-6
net/netrom/nr_dev.c
net/netrom/nr_dev.c
+6
-3
No files found.
net/netrom/af_netrom.c
View file @
2a2ff7fc
...
@@ -1363,6 +1363,7 @@ static int __init nr_proto_init(void)
...
@@ -1363,6 +1363,7 @@ static int __init nr_proto_init(void)
for
(
i
=
0
;
i
<
nr_ndevs
;
i
++
)
{
for
(
i
=
0
;
i
<
nr_ndevs
;
i
++
)
{
sprintf
(
dev_nr
[
i
].
name
,
"nr%d"
,
i
);
sprintf
(
dev_nr
[
i
].
name
,
"nr%d"
,
i
);
dev_nr
[
i
].
base_addr
=
i
;
dev_nr
[
i
].
init
=
nr_init
;
dev_nr
[
i
].
init
=
nr_init
;
register_netdev
(
&
dev_nr
[
i
]);
register_netdev
(
&
dev_nr
[
i
]);
}
}
...
@@ -1407,23 +1408,23 @@ static void __exit nr_exit(void)
...
@@ -1407,23 +1408,23 @@ static void __exit nr_exit(void)
nr_rt_free
();
nr_rt_free
();
ax25_protocol_release
(
AX25_P_NETROM
);
#ifdef CONFIG_SYSCTL
nr_unregister_sysctl
();
#endif
ax25_linkfail_release
(
nr_link_failed
);
ax25_linkfail_release
(
nr_link_failed
);
ax25_protocol_release
(
AX25_P_NETROM
);
unregister_netdevice_notifier
(
&
nr_dev_notifier
);
unregister_netdevice_notifier
(
&
nr_dev_notifier
);
#ifdef CONFIG_SYSCTL
nr_unregister_sysctl
();
#endif
sock_unregister
(
PF_NETROM
);
sock_unregister
(
PF_NETROM
);
for
(
i
=
0
;
i
<
nr_ndevs
;
i
++
)
{
for
(
i
=
0
;
i
<
nr_ndevs
;
i
++
)
{
if
(
dev_nr
[
i
].
priv
!=
NULL
)
{
if
(
dev_nr
[
i
].
priv
!=
NULL
)
{
unregister_netdev
(
&
dev_nr
[
i
]);
kfree
(
dev_nr
[
i
].
priv
);
kfree
(
dev_nr
[
i
].
priv
);
dev_nr
[
i
].
priv
=
NULL
;
dev_nr
[
i
].
priv
=
NULL
;
unregister_netdev
(
&
dev_nr
[
i
]);
}
}
kfree
(
dev_nr
[
i
].
name
);
}
}
kfree
(
dev_nr
);
kfree
(
dev_nr
);
...
...
net/netrom/nr_dev.c
View file @
2a2ff7fc
...
@@ -159,11 +159,13 @@ static int nr_set_mac_address(struct net_device *dev, void *addr)
...
@@ -159,11 +159,13 @@ static int nr_set_mac_address(struct net_device *dev, void *addr)
{
{
struct
sockaddr
*
sa
=
addr
;
struct
sockaddr
*
sa
=
addr
;
ax25_listen_release
((
ax25_address
*
)
dev
->
dev_addr
,
NULL
);
if
(
dev
->
flags
&
IFF_UP
)
ax25_listen_release
((
ax25_address
*
)
dev
->
dev_addr
,
NULL
);
memcpy
(
dev
->
dev_addr
,
sa
->
sa_data
,
dev
->
addr_len
);
memcpy
(
dev
->
dev_addr
,
sa
->
sa_data
,
dev
->
addr_len
);
ax25_listen_register
((
ax25_address
*
)
dev
->
dev_addr
,
NULL
);
if
(
dev
->
flags
&
IFF_UP
)
ax25_listen_register
((
ax25_address
*
)
dev
->
dev_addr
,
NULL
);
return
0
;
return
0
;
}
}
...
@@ -177,8 +179,8 @@ static int nr_open(struct net_device *dev)
...
@@ -177,8 +179,8 @@ static int nr_open(struct net_device *dev)
static
int
nr_close
(
struct
net_device
*
dev
)
static
int
nr_close
(
struct
net_device
*
dev
)
{
{
netif_stop_queue
(
dev
);
ax25_listen_release
((
ax25_address
*
)
dev
->
dev_addr
,
NULL
);
ax25_listen_release
((
ax25_address
*
)
dev
->
dev_addr
,
NULL
);
netif_stop_queue
(
dev
);
return
0
;
return
0
;
}
}
...
@@ -207,6 +209,7 @@ int nr_init(struct net_device *dev)
...
@@ -207,6 +209,7 @@ int nr_init(struct net_device *dev)
dev
->
hard_header_len
=
NR_NETWORK_LEN
+
NR_TRANSPORT_LEN
;
dev
->
hard_header_len
=
NR_NETWORK_LEN
+
NR_TRANSPORT_LEN
;
dev
->
addr_len
=
AX25_ADDR_LEN
;
dev
->
addr_len
=
AX25_ADDR_LEN
;
dev
->
type
=
ARPHRD_NETROM
;
dev
->
type
=
ARPHRD_NETROM
;
dev
->
tx_queue_len
=
40
;
dev
->
rebuild_header
=
nr_rebuild_header
;
dev
->
rebuild_header
=
nr_rebuild_header
;
dev
->
set_mac_address
=
nr_set_mac_address
;
dev
->
set_mac_address
=
nr_set_mac_address
;
...
...
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