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
7917dcdc
Commit
7917dcdc
authored
Sep 27, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN: net_device->header for IPTYP
parent
cc666ffa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
44 deletions
+31
-44
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_net.c
+31
-43
include/linux/isdn.h
include/linux/isdn.h
+0
-1
No files found.
drivers/isdn/i4l/isdn_net.c
View file @
7917dcdc
...
@@ -208,6 +208,7 @@ static int isdn_net_handle_event(isdn_net_local *lp, int pr, void *arg);
...
@@ -208,6 +208,7 @@ static int isdn_net_handle_event(isdn_net_local *lp, int pr, void *arg);
static
int
isdn_rawip_setup
(
isdn_net_dev
*
p
);
static
int
isdn_rawip_setup
(
isdn_net_dev
*
p
);
static
int
isdn_ether_setup
(
isdn_net_dev
*
p
);
static
int
isdn_ether_setup
(
isdn_net_dev
*
p
);
static
int
isdn_uihdlc_setup
(
isdn_net_dev
*
p
);
static
int
isdn_uihdlc_setup
(
isdn_net_dev
*
p
);
static
int
isdn_iptyp_setup
(
isdn_net_dev
*
p
);
static
int
isdn_other_setup
(
isdn_net_dev
*
p
);
static
int
isdn_other_setup
(
isdn_net_dev
*
p
);
char
*
isdn_net_revision
=
"$Revision: 1.140.6.11 $"
;
char
*
isdn_net_revision
=
"$Revision: 1.140.6.11 $"
;
...
@@ -1357,32 +1358,6 @@ isdn_net_rcv_skb(int idx, struct sk_buff *skb)
...
@@ -1357,32 +1358,6 @@ isdn_net_rcv_skb(int idx, struct sk_buff *skb)
return
0
;
return
0
;
}
}
/*
* build an header
* depends on encaps that is being used.
*/
static
int
isdn_net_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
plen
)
{
isdn_net_local
*
lp
=
dev
->
priv
;
ushort
len
=
0
;
switch
(
lp
->
p_encap
)
{
case
ISDN_NET_ENCAP_IPTYP
:
/* ethernet type field */
*
((
ushort
*
)
skb_push
(
skb
,
2
))
=
htons
(
type
);
len
=
2
;
break
;
default:
printk
(
KERN_WARNING
"isdn_net_header called with encap %d!
\n
"
,
lp
->
p_encap
);
len
=
0
;
break
;
}
return
len
;
}
/* We don't need to send arp, because we have point-to-point connections. */
/* We don't need to send arp, because we have point-to-point connections. */
static
int
static
int
isdn_net_rebuild_header
(
struct
sk_buff
*
skb
)
isdn_net_rebuild_header
(
struct
sk_buff
*
skb
)
...
@@ -2041,11 +2016,6 @@ isdn_net_set_encap(isdn_net_dev *p, isdn_net_ioctl_cfg *cfg)
...
@@ -2041,11 +2016,6 @@ isdn_net_set_encap(isdn_net_dev *p, isdn_net_ioctl_cfg *cfg)
isdn_net_local
*
lp
=
&
p
->
local
;
isdn_net_local
*
lp
=
&
p
->
local
;
int
retval
;
int
retval
;
if
(
cfg
->
p_encap
<
0
||
cfg
->
p_encap
>
ISDN_NET_ENCAP_MAX_ENCAP
)
{
retval
=
-
EINVAL
;
goto
out
;
}
if
(
lp
->
p_encap
==
cfg
->
p_encap
){
if
(
lp
->
p_encap
==
cfg
->
p_encap
){
/* nothing to do */
/* nothing to do */
retval
=
0
;
retval
=
0
;
...
@@ -2083,10 +2053,15 @@ isdn_net_set_encap(isdn_net_dev *p, isdn_net_ioctl_cfg *cfg)
...
@@ -2083,10 +2053,15 @@ isdn_net_set_encap(isdn_net_dev *p, isdn_net_ioctl_cfg *cfg)
case
ISDN_NET_ENCAP_UIHDLC
:
case
ISDN_NET_ENCAP_UIHDLC
:
retval
=
isdn_uihdlc_setup
(
p
);
retval
=
isdn_uihdlc_setup
(
p
);
break
;
break
;
case
ISDN_NET_ENCAP_IPTYP
:
retval
=
isdn_iptyp_setup
(
p
);
break
;
default:
default:
retval
=
isdn_other_setup
(
p
)
;
retval
=
-
EINVAL
;
break
;
break
;
}
}
if
(
retval
!=
0
)
lp
->
p_encap
=
-
1
;
out:
out:
return
retval
;
return
retval
;
...
@@ -2586,6 +2561,30 @@ isdn_net_rmall(void)
...
@@ -2586,6 +2561,30 @@ isdn_net_rmall(void)
return
0
;
return
0
;
}
}
// ISDN_NET_ENCAP_IPTYP
// ethernet type field
// ======================================================================
static
int
isdn_iptyp_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
plen
)
{
put_u16
(
skb_push
(
skb
,
2
),
type
);
return
2
;
}
int
isdn_iptyp_setup
(
isdn_net_dev
*
p
)
{
p
->
dev
.
hard_header
=
isdn_iptyp_header
;
p
->
dev
.
hard_header_cache
=
NULL
;
p
->
dev
.
header_cache_update
=
NULL
;
p
->
dev
.
flags
=
IFF_NOARP
|
IFF_POINTOPOINT
;
return
0
;
}
// ISDN_NET_ENCAP_UIHDLC
// ISDN_NET_ENCAP_UIHDLC
// HDLC with UI-Frames (for ispa with -h1 option) */
// HDLC with UI-Frames (for ispa with -h1 option) */
// ======================================================================
// ======================================================================
...
@@ -2637,14 +2636,3 @@ isdn_ether_setup(isdn_net_dev *p)
...
@@ -2637,14 +2636,3 @@ isdn_ether_setup(isdn_net_dev *p)
return
0
;
return
0
;
}
}
int
isdn_other_setup
(
isdn_net_dev
*
p
)
{
p
->
dev
.
hard_header
=
isdn_net_header
;
p
->
dev
.
hard_header_cache
=
NULL
;
p
->
dev
.
header_cache_update
=
NULL
;
p
->
dev
.
flags
=
IFF_NOARP
|
IFF_POINTOPOINT
;
return
0
;
}
include/linux/isdn.h
View file @
7917dcdc
...
@@ -75,7 +75,6 @@
...
@@ -75,7 +75,6 @@
#define ISDN_NET_ENCAP_UIHDLC 5
#define ISDN_NET_ENCAP_UIHDLC 5
#define ISDN_NET_ENCAP_CISCOHDLCK 6
/* With SLARP and keepalive */
#define ISDN_NET_ENCAP_CISCOHDLCK 6
/* With SLARP and keepalive */
#define ISDN_NET_ENCAP_X25IFACE 7
/* Documentation/networking/x25-iface.txt*/
#define ISDN_NET_ENCAP_X25IFACE 7
/* Documentation/networking/x25-iface.txt*/
#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
/* Facility which currently uses an ISDN-channel */
/* Facility which currently uses an ISDN-channel */
#define ISDN_USAGE_NONE 0
#define ISDN_USAGE_NONE 0
...
...
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