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
ff6e3904
Commit
ff6e3904
authored
Sep 18, 2003
by
Arnaldo Carvalho de Melo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o LLC: create a register interface for llc_station_rcv
parent
e22ab5e3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
27 deletions
+41
-27
include/net/llc_mac.h
include/net/llc_mac.h
+2
-0
net/llc/llc_mac.c
net/llc/llc_mac.c
+21
-27
net/llc/llc_main.c
net/llc/llc_main.c
+17
-0
net/llc/llc_s_ac.c
net/llc/llc_s_ac.c
+1
-0
No files found.
include/net/llc_mac.h
View file @
ff6e3904
...
@@ -25,4 +25,6 @@ struct sk_buff;
...
@@ -25,4 +25,6 @@ struct sk_buff;
extern
void
llc_add_pack
(
int
type
,
void
(
*
handler
)(
struct
llc_sap
*
sap
,
extern
void
llc_add_pack
(
int
type
,
void
(
*
handler
)(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
));
struct
sk_buff
*
skb
));
extern
void
llc_remove_pack
(
int
type
);
extern
void
llc_remove_pack
(
int
type
);
extern
void
llc_set_station_handler
(
void
(
*
handler
)(
struct
sk_buff
*
skb
));
#endif
/* LLC_MAC_H */
#endif
/* LLC_MAC_H */
net/llc/llc_mac.c
View file @
ff6e3904
...
@@ -12,15 +12,10 @@
...
@@ -12,15 +12,10 @@
* See the GNU General Public License for more details.
* See the GNU General Public License for more details.
*/
*/
#include <linux/netdevice.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/if_tr.h>
#include <linux/rtnetlink.h>
#include <net/llc_mac.h>
#include <net/llc_mac.h>
#include <net/llc_pdu.h>
#include <net/llc_pdu.h>
#include <net/llc_sap.h>
#include <net/llc_sap.h>
#include <net/llc_main.h>
#include <net/llc_main.h>
#include <net/llc_evnt.h>
#include <linux/trdevice.h>
#if 0
#if 0
#define dprintk(args...) printk(KERN_DEBUG args)
#define dprintk(args...) printk(KERN_DEBUG args)
...
@@ -28,7 +23,13 @@
...
@@ -28,7 +23,13 @@
#define dprintk(args...)
#define dprintk(args...)
#endif
#endif
static
void
llc_station_rcv
(
struct
sk_buff
*
skb
);
/*
* Packet handler for the station, registerable because in the minimal
* LLC core that is taking shape only the very minimal subset of LLC that
* is needed for things like IPX, Appletalk, etc will stay, with all the
* rest in the llc1 and llc2 modules.
*/
static
void
(
*
llc_station_handler
)(
struct
sk_buff
*
skb
);
/*
/*
* Packet handlers for LLC_DEST_SAP and LLC_DEST_CONN.
* Packet handlers for LLC_DEST_SAP and LLC_DEST_CONN.
...
@@ -49,6 +50,11 @@ void llc_remove_pack(int type)
...
@@ -49,6 +50,11 @@ void llc_remove_pack(int type)
llc_type_handlers
[
type
]
=
NULL
;
llc_type_handlers
[
type
]
=
NULL
;
}
}
void
llc_set_station_handler
(
void
(
*
handler
)(
struct
sk_buff
*
skb
))
{
llc_station_handler
=
handler
;
}
/**
/**
* llc_pdu_type - returns which LLC component must handle for PDU
* llc_pdu_type - returns which LLC component must handle for PDU
* @skb: input skb
* @skb: input skb
...
@@ -147,11 +153,8 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
...
@@ -147,11 +153,8 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
if
(
unlikely
(
!
llc_fixup_skb
(
skb
)))
if
(
unlikely
(
!
llc_fixup_skb
(
skb
)))
goto
drop
;
goto
drop
;
pdu
=
llc_pdu_sn_hdr
(
skb
);
pdu
=
llc_pdu_sn_hdr
(
skb
);
if
(
unlikely
(
!
pdu
->
dsap
))
{
/* NULL DSAP, refer to station */
if
(
unlikely
(
!
pdu
->
dsap
))
/* NULL DSAP, refer to station */
dprintk
(
"%s: calling llc_station_rcv!
\n
"
,
__FUNCTION__
);
goto
handle_station
;
llc_station_rcv
(
skb
);
goto
out
;
}
sap
=
llc_sap_find
(
pdu
->
dsap
);
sap
=
llc_sap_find
(
pdu
->
dsap
);
if
(
unlikely
(
!
sap
))
{
/* unknown SAP */
if
(
unlikely
(
!
sap
))
{
/* unknown SAP */
dprintk
(
"%s: llc_sap_find(%02X) failed!
\n
"
,
__FUNCTION__
,
dprintk
(
"%s: llc_sap_find(%02X) failed!
\n
"
,
__FUNCTION__
,
...
@@ -175,22 +178,13 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
...
@@ -175,22 +178,13 @@ int llc_rcv(struct sk_buff *skb, struct net_device *dev,
drop:
drop:
kfree_skb
(
skb
);
kfree_skb
(
skb
);
goto
out
;
goto
out
;
}
handle_station:
if
(
!
llc_station_handler
)
/*
goto
drop
;
* llc_station_rcv - send received pdu to the station state machine
llc_station_handler
(
skb
);
* @skb: received frame.
goto
out
;
*
* Sends data unit to station state machine.
*/
static
void
llc_station_rcv
(
struct
sk_buff
*
skb
)
{
struct
llc_station_state_ev
*
ev
=
llc_station_ev
(
skb
);
ev
->
type
=
LLC_STATION_EV_TYPE_PDU
;
ev
->
reason
=
0
;
llc_station_state_process
(
&
llc_main_station
,
skb
);
}
}
EXPORT_SYMBOL
(
llc_add_pack
);
EXPORT_SYMBOL
(
llc_add_pack
);
EXPORT_SYMBOL
(
llc_remove_pack
);
EXPORT_SYMBOL
(
llc_remove_pack
);
EXPORT_SYMBOL
(
llc_set_station_handler
);
net/llc/llc_main.c
View file @
ff6e3904
...
@@ -250,6 +250,21 @@ static u16 llc_exec_station_trans_actions(struct llc_station *station,
...
@@ -250,6 +250,21 @@ static u16 llc_exec_station_trans_actions(struct llc_station *station,
return
rc
;
return
rc
;
}
}
/*
* llc_station_rcv - send received pdu to the station state machine
* @skb: received frame.
*
* Sends data unit to station state machine.
*/
static
void
llc_station_rcv
(
struct
sk_buff
*
skb
)
{
struct
llc_station_state_ev
*
ev
=
llc_station_ev
(
skb
);
ev
->
type
=
LLC_STATION_EV_TYPE_PDU
;
ev
->
reason
=
0
;
llc_station_state_process
(
&
llc_main_station
,
skb
);
}
/**
/**
* llc_alloc_frame - allocates sk_buff for frame
* llc_alloc_frame - allocates sk_buff for frame
*
*
...
@@ -303,6 +318,7 @@ static int __init llc_init(void)
...
@@ -303,6 +318,7 @@ static int __init llc_init(void)
skb
=
alloc_skb
(
0
,
GFP_ATOMIC
);
skb
=
alloc_skb
(
0
,
GFP_ATOMIC
);
if
(
!
skb
)
if
(
!
skb
)
goto
err
;
goto
err
;
llc_set_station_handler
(
llc_station_rcv
);
ev
=
llc_station_ev
(
skb
);
ev
=
llc_station_ev
(
skb
);
memset
(
ev
,
0
,
sizeof
(
*
ev
));
memset
(
ev
,
0
,
sizeof
(
*
ev
));
if
(
dev_base
->
next
)
if
(
dev_base
->
next
)
...
@@ -330,6 +346,7 @@ static void __exit llc_exit(void)
...
@@ -330,6 +346,7 @@ static void __exit llc_exit(void)
{
{
dev_remove_pack
(
&
llc_packet_type
);
dev_remove_pack
(
&
llc_packet_type
);
dev_remove_pack
(
&
llc_tr_packet_type
);
dev_remove_pack
(
&
llc_tr_packet_type
);
llc_set_station_handler
(
NULL
);
}
}
module_init
(
llc_init
);
module_init
(
llc_init
);
...
...
net/llc/llc_s_ac.c
View file @
ff6e3904
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <net/llc_s_ev.h>
#include <net/llc_s_ev.h>
#include <net/llc_pdu.h>
#include <net/llc_pdu.h>
#include <net/llc_mac.h>
#include <net/llc_mac.h>
#include "llc_output.h"
/**
/**
* llc_sap_action_unit_data_ind - forward UI PDU to network layer
* llc_sap_action_unit_data_ind - forward UI PDU to network layer
...
...
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