Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (448 commits) [IPV4] nl_fib_lookup: Initialise res.r before fib_res_put(&res) [IPV6]: Fix thinko in ipv6_rthdr_rcv() changes. [IPV4]: Add multipath cached to feature-removal-schedule.txt [WIRELESS] cfg80211: Clarify locking comment. [WIRELESS] cfg80211: Fix locking in wiphy_new. [WEXT] net_device: Don't include wext bits if not required. [WEXT]: Misc code cleanups. [WEXT]: Reduce inline abuse. [WEXT]: Move EXPORT_SYMBOL statements where they belong. [WEXT]: Cleanup early ioctl call path. [WEXT]: Remove options. [WEXT]: Remove dead debug code. [WEXT]: Clean up how wext is called. [WEXT]: Move to net/wireless [AFS]: Eliminate cmpxchg() usage in vlocation code. [RXRPC]: Fix pointers passed to bitops. [RXRPC]: Remove bogus atomic_* overrides. [AFS]: Fix u64 printing in debug logging. [AFS]: Add "directory write" support. [AFS]: Implement the CB.InitCallBackState3 operation. ...
This commit is contained in:
commit
15c5403396
14
CREDITS
14
CREDITS
@ -317,6 +317,12 @@ S: 2322 37th Ave SW
|
|||||||
S: Seattle, Washington 98126-2010
|
S: Seattle, Washington 98126-2010
|
||||||
S: USA
|
S: USA
|
||||||
|
|
||||||
|
N: Johannes Berg
|
||||||
|
E: johannes@sipsolutions.net
|
||||||
|
W: http://johannes.sipsolutions.net/
|
||||||
|
P: 1024D/9AB78CA5 AD02 0176 4E29 C137 1DF6 08D2 FC44 CF86 9AB7 8CA5
|
||||||
|
D: powerpc & 802.11 hacker
|
||||||
|
|
||||||
N: Stephen R. van den Berg (AKA BuGless)
|
N: Stephen R. van den Berg (AKA BuGless)
|
||||||
E: berg@pool.informatik.rwth-aachen.de
|
E: berg@pool.informatik.rwth-aachen.de
|
||||||
D: General kernel, gcc, and libc hacker
|
D: General kernel, gcc, and libc hacker
|
||||||
@ -2286,14 +2292,14 @@ S: D-90453 Nuernberg
|
|||||||
S: Germany
|
S: Germany
|
||||||
|
|
||||||
N: Arnaldo Carvalho de Melo
|
N: Arnaldo Carvalho de Melo
|
||||||
E: acme@mandriva.com
|
|
||||||
E: acme@ghostprotocols.net
|
E: acme@ghostprotocols.net
|
||||||
|
E: arnaldo.melo@gmail.com
|
||||||
|
E: acme@redhat.com
|
||||||
W: http://oops.ghostprotocols.net:81/blog/
|
W: http://oops.ghostprotocols.net:81/blog/
|
||||||
P: 1024D/9224DF01 D5DF E3BB E3C8 BCBB F8AD 841A B6AB 4681 9224 DF01
|
P: 1024D/9224DF01 D5DF E3BB E3C8 BCBB F8AD 841A B6AB 4681 9224 DF01
|
||||||
D: IPX, LLC, DCCP, cyc2x, wl3501_cs, net/ hacks
|
D: IPX, LLC, DCCP, cyc2x, wl3501_cs, net/ hacks
|
||||||
S: Mandriva
|
S: R. Brasílio Itiberê, 4270/1010 - Água Verde
|
||||||
S: R. Tocantins, 89 - Cristo Rei
|
S: 80240-060 - Curitiba - Paraná
|
||||||
S: 80050-430 - Curitiba - Paraná
|
|
||||||
S: Brazil
|
S: Brazil
|
||||||
|
|
||||||
N: Karsten Merker
|
N: Karsten Merker
|
||||||
|
@ -211,15 +211,6 @@ Who: Adrian Bunk <bunk@stusta.de>
|
|||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
What: IPv4 only connection tracking/NAT/helpers
|
|
||||||
When: 2.6.22
|
|
||||||
Why: The new layer 3 independant connection tracking replaces the old
|
|
||||||
IPv4 only version. After some stabilization of the new code the
|
|
||||||
old one will be removed.
|
|
||||||
Who: Patrick McHardy <kaber@trash.net>
|
|
||||||
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
What: ACPI hooks (X86_SPEEDSTEP_CENTRINO_ACPI) in speedstep-centrino driver
|
What: ACPI hooks (X86_SPEEDSTEP_CENTRINO_ACPI) in speedstep-centrino driver
|
||||||
When: December 2006
|
When: December 2006
|
||||||
Why: Speedstep-centrino driver with ACPI hooks and acpi-cpufreq driver are
|
Why: Speedstep-centrino driver with ACPI hooks and acpi-cpufreq driver are
|
||||||
@ -294,18 +285,6 @@ Who: Richard Purdie <rpurdie@rpsys.net>
|
|||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
What: Wireless extensions over netlink (CONFIG_NET_WIRELESS_RTNETLINK)
|
|
||||||
When: with the merge of wireless-dev, 2.6.22 or later
|
|
||||||
Why: The option/code is
|
|
||||||
* not enabled on most kernels
|
|
||||||
* not required by any userspace tools (except an experimental one,
|
|
||||||
and even there only for some parts, others use ioctl)
|
|
||||||
* pointless since wext is no longer evolving and the ioctl
|
|
||||||
interface needs to be kept
|
|
||||||
Who: Johannes Berg <johannes@sipsolutions.net>
|
|
||||||
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
What: i8xx_tco watchdog driver
|
What: i8xx_tco watchdog driver
|
||||||
When: in 2.6.22
|
When: in 2.6.22
|
||||||
Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt
|
Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt
|
||||||
@ -313,3 +292,22 @@ Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt
|
|||||||
Who: Wim Van Sebroeck <wim@iguana.be>
|
Who: Wim Van Sebroeck <wim@iguana.be>
|
||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
What: Multipath cached routing support in ipv4
|
||||||
|
When: in 2.6.23
|
||||||
|
Why: Code was merged, then submitter immediately disappeared leaving
|
||||||
|
us with no maintainer and lots of bugs. The code should not have
|
||||||
|
been merged in the first place, and many aspects of it's
|
||||||
|
implementation are blocking more critical core networking
|
||||||
|
development. It's marked EXPERIMENTAL and no distribution
|
||||||
|
enables it because it cause obscure crashes due to unfixable bugs
|
||||||
|
(interfaces don't return errors so memory allocation can't be
|
||||||
|
handled, calling contexts of these interfaces make handling
|
||||||
|
errors impossible too because they get called after we've
|
||||||
|
totally commited to creating a route object, for example).
|
||||||
|
This problem has existed for years and no forward progress
|
||||||
|
has ever been made, and nobody steps up to try and salvage
|
||||||
|
this code, so we're going to finally just get rid of it.
|
||||||
|
Who: David S. Miller <davem@davemloft.net>
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
@ -1,31 +1,82 @@
|
|||||||
|
====================
|
||||||
kAFS: AFS FILESYSTEM
|
kAFS: AFS FILESYSTEM
|
||||||
====================
|
====================
|
||||||
|
|
||||||
ABOUT
|
Contents:
|
||||||
|
|
||||||
|
- Overview.
|
||||||
|
- Usage.
|
||||||
|
- Mountpoints.
|
||||||
|
- Proc filesystem.
|
||||||
|
- The cell database.
|
||||||
|
- Security.
|
||||||
|
- Examples.
|
||||||
|
|
||||||
|
|
||||||
|
========
|
||||||
|
OVERVIEW
|
||||||
|
========
|
||||||
|
|
||||||
|
This filesystem provides a fairly simple secure AFS filesystem driver. It is
|
||||||
|
under development and does not yet provide the full feature set. The features
|
||||||
|
it does support include:
|
||||||
|
|
||||||
|
(*) Security (currently only AFS kaserver and KerberosIV tickets).
|
||||||
|
|
||||||
|
(*) File reading.
|
||||||
|
|
||||||
|
(*) Automounting.
|
||||||
|
|
||||||
|
It does not yet support the following AFS features:
|
||||||
|
|
||||||
|
(*) Write support.
|
||||||
|
|
||||||
|
(*) Local caching.
|
||||||
|
|
||||||
|
(*) pioctl() system call.
|
||||||
|
|
||||||
|
|
||||||
|
===========
|
||||||
|
COMPILATION
|
||||||
|
===========
|
||||||
|
|
||||||
|
The filesystem should be enabled by turning on the kernel configuration
|
||||||
|
options:
|
||||||
|
|
||||||
|
CONFIG_AF_RXRPC - The RxRPC protocol transport
|
||||||
|
CONFIG_RXKAD - The RxRPC Kerberos security handler
|
||||||
|
CONFIG_AFS - The AFS filesystem
|
||||||
|
|
||||||
|
Additionally, the following can be turned on to aid debugging:
|
||||||
|
|
||||||
|
CONFIG_AF_RXRPC_DEBUG - Permit AF_RXRPC debugging to be enabled
|
||||||
|
CONFIG_AFS_DEBUG - Permit AFS debugging to be enabled
|
||||||
|
|
||||||
|
They permit the debugging messages to be turned on dynamically by manipulating
|
||||||
|
the masks in the following files:
|
||||||
|
|
||||||
|
/sys/module/af_rxrpc/parameters/debug
|
||||||
|
/sys/module/afs/parameters/debug
|
||||||
|
|
||||||
|
|
||||||
=====
|
=====
|
||||||
|
|
||||||
This filesystem provides a fairly simple AFS filesystem driver. It is under
|
|
||||||
development and only provides very basic facilities. It does not yet support
|
|
||||||
the following AFS features:
|
|
||||||
|
|
||||||
(*) Write support.
|
|
||||||
(*) Communications security.
|
|
||||||
(*) Local caching.
|
|
||||||
(*) pioctl() system call.
|
|
||||||
(*) Automatic mounting of embedded mountpoints.
|
|
||||||
|
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
=====
|
=====
|
||||||
|
|
||||||
When inserting the driver modules the root cell must be specified along with a
|
When inserting the driver modules the root cell must be specified along with a
|
||||||
list of volume location server IP addresses:
|
list of volume location server IP addresses:
|
||||||
|
|
||||||
insmod rxrpc.o
|
insmod af_rxrpc.o
|
||||||
|
insmod rxkad.o
|
||||||
insmod kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
|
insmod kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
|
||||||
|
|
||||||
The first module is a driver for the RxRPC remote operation protocol, and the
|
The first module is the AF_RXRPC network protocol driver. This provides the
|
||||||
second is the actual filesystem driver for the AFS filesystem.
|
RxRPC remote operation protocol and may also be accessed from userspace. See:
|
||||||
|
|
||||||
|
Documentation/networking/rxrpc.txt
|
||||||
|
|
||||||
|
The second module is the kerberos RxRPC security driver, and the third module
|
||||||
|
is the actual filesystem driver for the AFS filesystem.
|
||||||
|
|
||||||
Once the module has been loaded, more modules can be added by the following
|
Once the module has been loaded, more modules can be added by the following
|
||||||
procedure:
|
procedure:
|
||||||
@ -33,7 +84,7 @@ procedure:
|
|||||||
echo add grand.central.org 18.7.14.88:128.2.191.224 >/proc/fs/afs/cells
|
echo add grand.central.org 18.7.14.88:128.2.191.224 >/proc/fs/afs/cells
|
||||||
|
|
||||||
Where the parameters to the "add" command are the name of a cell and a list of
|
Where the parameters to the "add" command are the name of a cell and a list of
|
||||||
volume location servers within that cell.
|
volume location servers within that cell, with the latter separated by colons.
|
||||||
|
|
||||||
Filesystems can be mounted anywhere by commands similar to the following:
|
Filesystems can be mounted anywhere by commands similar to the following:
|
||||||
|
|
||||||
@ -42,11 +93,6 @@ Filesystems can be mounted anywhere by commands similar to the following:
|
|||||||
mount -t afs "#root.afs." /afs
|
mount -t afs "#root.afs." /afs
|
||||||
mount -t afs "#root.cell." /afs/cambridge
|
mount -t afs "#root.cell." /afs/cambridge
|
||||||
|
|
||||||
NB: When using this on Linux 2.4, the mount command has to be different,
|
|
||||||
since the filesystem doesn't have access to the device name argument:
|
|
||||||
|
|
||||||
mount -t afs none /afs -ovol="#root.afs."
|
|
||||||
|
|
||||||
Where the initial character is either a hash or a percent symbol depending on
|
Where the initial character is either a hash or a percent symbol depending on
|
||||||
whether you definitely want a R/W volume (hash) or whether you'd prefer a R/O
|
whether you definitely want a R/W volume (hash) or whether you'd prefer a R/O
|
||||||
volume, but are willing to use a R/W volume instead (percent).
|
volume, but are willing to use a R/W volume instead (percent).
|
||||||
@ -60,55 +106,66 @@ named volume will be looked up in the cell specified during insmod.
|
|||||||
Additional cells can be added through /proc (see later section).
|
Additional cells can be added through /proc (see later section).
|
||||||
|
|
||||||
|
|
||||||
|
===========
|
||||||
MOUNTPOINTS
|
MOUNTPOINTS
|
||||||
===========
|
===========
|
||||||
|
|
||||||
AFS has a concept of mountpoints. These are specially formatted symbolic links
|
AFS has a concept of mountpoints. In AFS terms, these are specially formatted
|
||||||
(of the same form as the "device name" passed to mount). kAFS presents these
|
symbolic links (of the same form as the "device name" passed to mount). kAFS
|
||||||
to the user as directories that have special properties:
|
presents these to the user as directories that have a follow-link capability
|
||||||
|
(ie: symbolic link semantics). If anyone attempts to access them, they will
|
||||||
|
automatically cause the target volume to be mounted (if possible) on that site.
|
||||||
|
|
||||||
(*) They cannot be listed. Running a program like "ls" on them will incur an
|
Automatically mounted filesystems will be automatically unmounted approximately
|
||||||
EREMOTE error (Object is remote).
|
twenty minutes after they were last used. Alternatively they can be unmounted
|
||||||
|
directly with the umount() system call.
|
||||||
|
|
||||||
(*) Other objects can't be looked up inside of them. This also incurs an
|
Manually unmounting an AFS volume will cause any idle submounts upon it to be
|
||||||
EREMOTE error.
|
culled first. If all are culled, then the requested volume will also be
|
||||||
|
unmounted, otherwise error EBUSY will be returned.
|
||||||
|
|
||||||
(*) They can be queried with the readlink() system call, which will return
|
This can be used by the administrator to attempt to unmount the whole AFS tree
|
||||||
the name of the mountpoint to which they point. The "readlink" program
|
mounted on /afs in one go by doing:
|
||||||
will also work.
|
|
||||||
|
|
||||||
(*) They can be mounted on (which symbolic links can't).
|
umount /afs
|
||||||
|
|
||||||
|
|
||||||
|
===============
|
||||||
PROC FILESYSTEM
|
PROC FILESYSTEM
|
||||||
===============
|
===============
|
||||||
|
|
||||||
The rxrpc module creates a number of files in various places in the /proc
|
|
||||||
filesystem:
|
|
||||||
|
|
||||||
(*) Firstly, some information files are made available in a directory called
|
|
||||||
"/proc/net/rxrpc/". These list the extant transport endpoint, peer,
|
|
||||||
connection and call records.
|
|
||||||
|
|
||||||
(*) Secondly, some control files are made available in a directory called
|
|
||||||
"/proc/sys/rxrpc/". Currently, all these files can be used for is to
|
|
||||||
turn on various levels of tracing.
|
|
||||||
|
|
||||||
The AFS modules creates a "/proc/fs/afs/" directory and populates it:
|
The AFS modules creates a "/proc/fs/afs/" directory and populates it:
|
||||||
|
|
||||||
(*) A "cells" file that lists cells currently known to the afs module.
|
(*) A "cells" file that lists cells currently known to the afs module and
|
||||||
|
their usage counts:
|
||||||
|
|
||||||
|
[root@andromeda ~]# cat /proc/fs/afs/cells
|
||||||
|
USE NAME
|
||||||
|
3 cambridge.redhat.com
|
||||||
|
|
||||||
(*) A directory per cell that contains files that list volume location
|
(*) A directory per cell that contains files that list volume location
|
||||||
servers, volumes, and active servers known within that cell.
|
servers, volumes, and active servers known within that cell.
|
||||||
|
|
||||||
|
[root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/servers
|
||||||
|
USE ADDR STATE
|
||||||
|
4 172.16.18.91 0
|
||||||
|
[root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/vlservers
|
||||||
|
ADDRESS
|
||||||
|
172.16.18.91
|
||||||
|
[root@andromeda ~]# cat /proc/fs/afs/cambridge.redhat.com/volumes
|
||||||
|
USE STT VLID[0] VLID[1] VLID[2] NAME
|
||||||
|
1 Val 20000000 20000001 20000002 root.afs
|
||||||
|
|
||||||
|
|
||||||
|
=================
|
||||||
THE CELL DATABASE
|
THE CELL DATABASE
|
||||||
=================
|
=================
|
||||||
|
|
||||||
The filesystem maintains an internal database of all the cells it knows and
|
The filesystem maintains an internal database of all the cells it knows and the
|
||||||
the IP addresses of the volume location servers for those cells. The cell to
|
IP addresses of the volume location servers for those cells. The cell to which
|
||||||
which the computer belongs is added to the database when insmod is performed
|
the system belongs is added to the database when insmod is performed by the
|
||||||
by the "rootcell=" argument.
|
"rootcell=" argument or, if compiled in, using a "kafs.rootcell=" argument on
|
||||||
|
the kernel command line.
|
||||||
|
|
||||||
Further cells can be added by commands similar to the following:
|
Further cells can be added by commands similar to the following:
|
||||||
|
|
||||||
@ -118,15 +175,60 @@ Further cells can be added by commands similar to the following:
|
|||||||
No other cell database operations are available at this time.
|
No other cell database operations are available at this time.
|
||||||
|
|
||||||
|
|
||||||
|
========
|
||||||
|
SECURITY
|
||||||
|
========
|
||||||
|
|
||||||
|
Secure operations are initiated by acquiring a key using the klog program. A
|
||||||
|
very primitive klog program is available at:
|
||||||
|
|
||||||
|
http://people.redhat.com/~dhowells/rxrpc/klog.c
|
||||||
|
|
||||||
|
This should be compiled by:
|
||||||
|
|
||||||
|
make klog LDLIBS="-lcrypto -lcrypt -lkrb4 -lkeyutils"
|
||||||
|
|
||||||
|
And then run as:
|
||||||
|
|
||||||
|
./klog
|
||||||
|
|
||||||
|
Assuming it's successful, this adds a key of type RxRPC, named for the service
|
||||||
|
and cell, eg: "afs@<cellname>". This can be viewed with the keyctl program or
|
||||||
|
by cat'ing /proc/keys:
|
||||||
|
|
||||||
|
[root@andromeda ~]# keyctl show
|
||||||
|
Session Keyring
|
||||||
|
-3 --alswrv 0 0 keyring: _ses.3268
|
||||||
|
2 --alswrv 0 0 \_ keyring: _uid.0
|
||||||
|
111416553 --als--v 0 0 \_ rxrpc: afs@CAMBRIDGE.REDHAT.COM
|
||||||
|
|
||||||
|
Currently the username, realm, password and proposed ticket lifetime are
|
||||||
|
compiled in to the program.
|
||||||
|
|
||||||
|
It is not required to acquire a key before using AFS facilities, but if one is
|
||||||
|
not acquired then all operations will be governed by the anonymous user parts
|
||||||
|
of the ACLs.
|
||||||
|
|
||||||
|
If a key is acquired, then all AFS operations, including mounts and automounts,
|
||||||
|
made by a possessor of that key will be secured with that key.
|
||||||
|
|
||||||
|
If a file is opened with a particular key and then the file descriptor is
|
||||||
|
passed to a process that doesn't have that key (perhaps over an AF_UNIX
|
||||||
|
socket), then the operations on the file will be made with key that was used to
|
||||||
|
open the file.
|
||||||
|
|
||||||
|
|
||||||
|
========
|
||||||
EXAMPLES
|
EXAMPLES
|
||||||
========
|
========
|
||||||
|
|
||||||
Here's what I use to test this. Some of the names and IP addresses are local
|
Here's what I use to test this. Some of the names and IP addresses are local
|
||||||
to my internal DNS. My "root.afs" partition has a mount point within it for
|
to my internal DNS. My "root.afs" partition has a mount point within it for
|
||||||
some public volumes volumes.
|
some public volumes volumes.
|
||||||
|
|
||||||
insmod -S /tmp/rxrpc.o
|
insmod /tmp/rxrpc.o
|
||||||
insmod -S /tmp/kafs.o rootcell=cambridge.redhat.com:172.16.18.73:172.16.18.91
|
insmod /tmp/rxkad.o
|
||||||
|
insmod /tmp/kafs.o rootcell=cambridge.redhat.com:172.16.18.91
|
||||||
|
|
||||||
mount -t afs \%root.afs. /afs
|
mount -t afs \%root.afs. /afs
|
||||||
mount -t afs \%cambridge.redhat.com:root.cell. /afs/cambridge.redhat.com/
|
mount -t afs \%cambridge.redhat.com:root.cell. /afs/cambridge.redhat.com/
|
||||||
@ -141,15 +243,7 @@ mount -t afs "#grand.central.org:root.service." /afs/grand.central.org/service
|
|||||||
mount -t afs "#grand.central.org:root.software." /afs/grand.central.org/software
|
mount -t afs "#grand.central.org:root.software." /afs/grand.central.org/software
|
||||||
mount -t afs "#grand.central.org:root.user." /afs/grand.central.org/user
|
mount -t afs "#grand.central.org:root.user." /afs/grand.central.org/user
|
||||||
|
|
||||||
umount /afs/grand.central.org/user
|
|
||||||
umount /afs/grand.central.org/software
|
|
||||||
umount /afs/grand.central.org/service
|
|
||||||
umount /afs/grand.central.org/project
|
|
||||||
umount /afs/grand.central.org/doc
|
|
||||||
umount /afs/grand.central.org/contrib
|
|
||||||
umount /afs/grand.central.org/archive
|
|
||||||
umount /afs/grand.central.org
|
|
||||||
umount /afs/cambridge.redhat.com
|
|
||||||
umount /afs
|
umount /afs
|
||||||
rmmod kafs
|
rmmod kafs
|
||||||
|
rmmod rxkad
|
||||||
rmmod rxrpc
|
rmmod rxrpc
|
||||||
|
@ -1421,6 +1421,15 @@ fewer messages that will be written. Message_burst controls when messages will
|
|||||||
be dropped. The default settings limit warning messages to one every five
|
be dropped. The default settings limit warning messages to one every five
|
||||||
seconds.
|
seconds.
|
||||||
|
|
||||||
|
warnings
|
||||||
|
--------
|
||||||
|
|
||||||
|
This controls console messages from the networking stack that can occur because
|
||||||
|
of problems on the network like duplicate address or bad checksums. Normally,
|
||||||
|
this should be enabled, but if the problem persists the messages can be
|
||||||
|
disabled.
|
||||||
|
|
||||||
|
|
||||||
netdev_max_backlog
|
netdev_max_backlog
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -859,6 +859,18 @@ payload contents" for more information.
|
|||||||
void unregister_key_type(struct key_type *type);
|
void unregister_key_type(struct key_type *type);
|
||||||
|
|
||||||
|
|
||||||
|
Under some circumstances, it may be desirable to desirable to deal with a
|
||||||
|
bundle of keys. The facility provides access to the keyring type for managing
|
||||||
|
such a bundle:
|
||||||
|
|
||||||
|
struct key_type key_type_keyring;
|
||||||
|
|
||||||
|
This can be used with a function such as request_key() to find a specific
|
||||||
|
keyring in a process's keyrings. A keyring thus found can then be searched
|
||||||
|
with keyring_search(). Note that it is not possible to use request_key() to
|
||||||
|
search a specific keyring, so using keyrings in this way is of limited utility.
|
||||||
|
|
||||||
|
|
||||||
===================================
|
===================================
|
||||||
NOTES ON ACCESSING PAYLOAD CONTENTS
|
NOTES ON ACCESSING PAYLOAD CONTENTS
|
||||||
===================================
|
===================================
|
||||||
|
@ -920,40 +920,9 @@ options, you may wish to use the "max_bonds" module parameter,
|
|||||||
documented above.
|
documented above.
|
||||||
|
|
||||||
To create multiple bonding devices with differing options, it
|
To create multiple bonding devices with differing options, it
|
||||||
is necessary to load the bonding driver multiple times. Note that
|
is necessary to use bonding parameters exported by sysfs, documented
|
||||||
current versions of the sysconfig network initialization scripts
|
in the section below.
|
||||||
handle this automatically; if your distro uses these scripts, no
|
|
||||||
special action is needed. See the section Configuring Bonding
|
|
||||||
Devices, above, if you're not sure about your network initialization
|
|
||||||
scripts.
|
|
||||||
|
|
||||||
To load multiple instances of the module, it is necessary to
|
|
||||||
specify a different name for each instance (the module loading system
|
|
||||||
requires that every loaded module, even multiple instances of the same
|
|
||||||
module, have a unique name). This is accomplished by supplying
|
|
||||||
multiple sets of bonding options in /etc/modprobe.conf, for example:
|
|
||||||
|
|
||||||
alias bond0 bonding
|
|
||||||
options bond0 -o bond0 mode=balance-rr miimon=100
|
|
||||||
|
|
||||||
alias bond1 bonding
|
|
||||||
options bond1 -o bond1 mode=balance-alb miimon=50
|
|
||||||
|
|
||||||
will load the bonding module two times. The first instance is
|
|
||||||
named "bond0" and creates the bond0 device in balance-rr mode with an
|
|
||||||
miimon of 100. The second instance is named "bond1" and creates the
|
|
||||||
bond1 device in balance-alb mode with an miimon of 50.
|
|
||||||
|
|
||||||
In some circumstances (typically with older distributions),
|
|
||||||
the above does not work, and the second bonding instance never sees
|
|
||||||
its options. In that case, the second options line can be substituted
|
|
||||||
as follows:
|
|
||||||
|
|
||||||
install bond1 /sbin/modprobe --ignore-install bonding -o bond1 \
|
|
||||||
mode=balance-alb miimon=50
|
|
||||||
|
|
||||||
This may be repeated any number of times, specifying a new and
|
|
||||||
unique name in place of bond1 for each subsequent instance.
|
|
||||||
|
|
||||||
3.4 Configuring Bonding Manually via Sysfs
|
3.4 Configuring Bonding Manually via Sysfs
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
@ -57,6 +57,16 @@ DCCP_SOCKOPT_SEND_CSCOV is for the receiver and has a different meaning: it
|
|||||||
coverage value are also acceptable. The higher the number, the more
|
coverage value are also acceptable. The higher the number, the more
|
||||||
restrictive this setting (see [RFC 4340, sec. 9.2.1]).
|
restrictive this setting (see [RFC 4340, sec. 9.2.1]).
|
||||||
|
|
||||||
|
The following two options apply to CCID 3 exclusively and are getsockopt()-only.
|
||||||
|
In either case, a TFRC info struct (defined in <linux/tfrc.h>) is returned.
|
||||||
|
DCCP_SOCKOPT_CCID_RX_INFO
|
||||||
|
Returns a `struct tfrc_rx_info' in optval; the buffer for optval and
|
||||||
|
optlen must be set to at least sizeof(struct tfrc_rx_info).
|
||||||
|
DCCP_SOCKOPT_CCID_TX_INFO
|
||||||
|
Returns a `struct tfrc_tx_info' in optval; the buffer for optval and
|
||||||
|
optlen must be set to at least sizeof(struct tfrc_tx_info).
|
||||||
|
|
||||||
|
|
||||||
Sysctl variables
|
Sysctl variables
|
||||||
================
|
================
|
||||||
Several DCCP default parameters can be managed by the following sysctls
|
Several DCCP default parameters can be managed by the following sysctls
|
||||||
|
@ -179,11 +179,31 @@ tcp_fin_timeout - INTEGER
|
|||||||
because they eat maximum 1.5K of memory, but they tend
|
because they eat maximum 1.5K of memory, but they tend
|
||||||
to live longer. Cf. tcp_max_orphans.
|
to live longer. Cf. tcp_max_orphans.
|
||||||
|
|
||||||
tcp_frto - BOOLEAN
|
tcp_frto - INTEGER
|
||||||
Enables F-RTO, an enhanced recovery algorithm for TCP retransmission
|
Enables F-RTO, an enhanced recovery algorithm for TCP retransmission
|
||||||
timeouts. It is particularly beneficial in wireless environments
|
timeouts. It is particularly beneficial in wireless environments
|
||||||
where packet loss is typically due to random radio interference
|
where packet loss is typically due to random radio interference
|
||||||
rather than intermediate router congestion.
|
rather than intermediate router congestion. If set to 1, basic
|
||||||
|
version is enabled. 2 enables SACK enhanced F-RTO, which is
|
||||||
|
EXPERIMENTAL. The basic version can be used also when SACK is
|
||||||
|
enabled for a flow through tcp_sack sysctl.
|
||||||
|
|
||||||
|
tcp_frto_response - INTEGER
|
||||||
|
When F-RTO has detected that a TCP retransmission timeout was
|
||||||
|
spurious (i.e, the timeout would have been avoided had TCP set a
|
||||||
|
longer retransmission timeout), TCP has several options what to do
|
||||||
|
next. Possible values are:
|
||||||
|
0 Rate halving based; a smooth and conservative response,
|
||||||
|
results in halved cwnd and ssthresh after one RTT
|
||||||
|
1 Very conservative response; not recommended because even
|
||||||
|
though being valid, it interacts poorly with the rest of
|
||||||
|
Linux TCP, halves cwnd and ssthresh immediately
|
||||||
|
2 Aggressive response; undoes congestion control measures
|
||||||
|
that are now known to be unnecessary (ignoring the
|
||||||
|
possibility of a lost retransmission that would require
|
||||||
|
TCP to be more cautious), cwnd and ssthresh are restored
|
||||||
|
to the values prior timeout
|
||||||
|
Default: 0 (rate halving based)
|
||||||
|
|
||||||
tcp_keepalive_time - INTEGER
|
tcp_keepalive_time - INTEGER
|
||||||
How often TCP sends out keepalive messages when keepalive is enabled.
|
How often TCP sends out keepalive messages when keepalive is enabled.
|
||||||
@ -995,7 +1015,12 @@ bridge-nf-call-ip6tables - BOOLEAN
|
|||||||
Default: 1
|
Default: 1
|
||||||
|
|
||||||
bridge-nf-filter-vlan-tagged - BOOLEAN
|
bridge-nf-filter-vlan-tagged - BOOLEAN
|
||||||
1 : pass bridged vlan-tagged ARP/IP traffic to arptables/iptables.
|
1 : pass bridged vlan-tagged ARP/IP/IPv6 traffic to {arp,ip,ip6}tables.
|
||||||
|
0 : disable this.
|
||||||
|
Default: 1
|
||||||
|
|
||||||
|
bridge-nf-filter-pppoe-tagged - BOOLEAN
|
||||||
|
1 : pass bridged pppoe-tagged IP/IPv6 traffic to {ip,ip6}tables.
|
||||||
0 : disable this.
|
0 : disable this.
|
||||||
Default: 1
|
Default: 1
|
||||||
|
|
||||||
|
859
Documentation/networking/rxrpc.txt
Normal file
859
Documentation/networking/rxrpc.txt
Normal file
@ -0,0 +1,859 @@
|
|||||||
|
======================
|
||||||
|
RxRPC NETWORK PROTOCOL
|
||||||
|
======================
|
||||||
|
|
||||||
|
The RxRPC protocol driver provides a reliable two-phase transport on top of UDP
|
||||||
|
that can be used to perform RxRPC remote operations. This is done over sockets
|
||||||
|
of AF_RXRPC family, using sendmsg() and recvmsg() with control data to send and
|
||||||
|
receive data, aborts and errors.
|
||||||
|
|
||||||
|
Contents of this document:
|
||||||
|
|
||||||
|
(*) Overview.
|
||||||
|
|
||||||
|
(*) RxRPC protocol summary.
|
||||||
|
|
||||||
|
(*) AF_RXRPC driver model.
|
||||||
|
|
||||||
|
(*) Control messages.
|
||||||
|
|
||||||
|
(*) Socket options.
|
||||||
|
|
||||||
|
(*) Security.
|
||||||
|
|
||||||
|
(*) Example client usage.
|
||||||
|
|
||||||
|
(*) Example server usage.
|
||||||
|
|
||||||
|
(*) AF_RXRPC kernel interface.
|
||||||
|
|
||||||
|
|
||||||
|
========
|
||||||
|
OVERVIEW
|
||||||
|
========
|
||||||
|
|
||||||
|
RxRPC is a two-layer protocol. There is a session layer which provides
|
||||||
|
reliable virtual connections using UDP over IPv4 (or IPv6) as the transport
|
||||||
|
layer, but implements a real network protocol; and there's the presentation
|
||||||
|
layer which renders structured data to binary blobs and back again using XDR
|
||||||
|
(as does SunRPC):
|
||||||
|
|
||||||
|
+-------------+
|
||||||
|
| Application |
|
||||||
|
+-------------+
|
||||||
|
| XDR | Presentation
|
||||||
|
+-------------+
|
||||||
|
| RxRPC | Session
|
||||||
|
+-------------+
|
||||||
|
| UDP | Transport
|
||||||
|
+-------------+
|
||||||
|
|
||||||
|
|
||||||
|
AF_RXRPC provides:
|
||||||
|
|
||||||
|
(1) Part of an RxRPC facility for both kernel and userspace applications by
|
||||||
|
making the session part of it a Linux network protocol (AF_RXRPC).
|
||||||
|
|
||||||
|
(2) A two-phase protocol. The client transmits a blob (the request) and then
|
||||||
|
receives a blob (the reply), and the server receives the request and then
|
||||||
|
transmits the reply.
|
||||||
|
|
||||||
|
(3) Retention of the reusable bits of the transport system set up for one call
|
||||||
|
to speed up subsequent calls.
|
||||||
|
|
||||||
|
(4) A secure protocol, using the Linux kernel's key retention facility to
|
||||||
|
manage security on the client end. The server end must of necessity be
|
||||||
|
more active in security negotiations.
|
||||||
|
|
||||||
|
AF_RXRPC does not provide XDR marshalling/presentation facilities. That is
|
||||||
|
left to the application. AF_RXRPC only deals in blobs. Even the operation ID
|
||||||
|
is just the first four bytes of the request blob, and as such is beyond the
|
||||||
|
kernel's interest.
|
||||||
|
|
||||||
|
|
||||||
|
Sockets of AF_RXRPC family are:
|
||||||
|
|
||||||
|
(1) created as type SOCK_DGRAM;
|
||||||
|
|
||||||
|
(2) provided with a protocol of the type of underlying transport they're going
|
||||||
|
to use - currently only PF_INET is supported.
|
||||||
|
|
||||||
|
|
||||||
|
The Andrew File System (AFS) is an example of an application that uses this and
|
||||||
|
that has both kernel (filesystem) and userspace (utility) components.
|
||||||
|
|
||||||
|
|
||||||
|
======================
|
||||||
|
RXRPC PROTOCOL SUMMARY
|
||||||
|
======================
|
||||||
|
|
||||||
|
An overview of the RxRPC protocol:
|
||||||
|
|
||||||
|
(*) RxRPC sits on top of another networking protocol (UDP is the only option
|
||||||
|
currently), and uses this to provide network transport. UDP ports, for
|
||||||
|
example, provide transport endpoints.
|
||||||
|
|
||||||
|
(*) RxRPC supports multiple virtual "connections" from any given transport
|
||||||
|
endpoint, thus allowing the endpoints to be shared, even to the same
|
||||||
|
remote endpoint.
|
||||||
|
|
||||||
|
(*) Each connection goes to a particular "service". A connection may not go
|
||||||
|
to multiple services. A service may be considered the RxRPC equivalent of
|
||||||
|
a port number. AF_RXRPC permits multiple services to share an endpoint.
|
||||||
|
|
||||||
|
(*) Client-originating packets are marked, thus a transport endpoint can be
|
||||||
|
shared between client and server connections (connections have a
|
||||||
|
direction).
|
||||||
|
|
||||||
|
(*) Up to a billion connections may be supported concurrently between one
|
||||||
|
local transport endpoint and one service on one remote endpoint. An RxRPC
|
||||||
|
connection is described by seven numbers:
|
||||||
|
|
||||||
|
Local address }
|
||||||
|
Local port } Transport (UDP) address
|
||||||
|
Remote address }
|
||||||
|
Remote port }
|
||||||
|
Direction
|
||||||
|
Connection ID
|
||||||
|
Service ID
|
||||||
|
|
||||||
|
(*) Each RxRPC operation is a "call". A connection may make up to four
|
||||||
|
billion calls, but only up to four calls may be in progress on a
|
||||||
|
connection at any one time.
|
||||||
|
|
||||||
|
(*) Calls are two-phase and asymmetric: the client sends its request data,
|
||||||
|
which the service receives; then the service transmits the reply data
|
||||||
|
which the client receives.
|
||||||
|
|
||||||
|
(*) The data blobs are of indefinite size, the end of a phase is marked with a
|
||||||
|
flag in the packet. The number of packets of data making up one blob may
|
||||||
|
not exceed 4 billion, however, as this would cause the sequence number to
|
||||||
|
wrap.
|
||||||
|
|
||||||
|
(*) The first four bytes of the request data are the service operation ID.
|
||||||
|
|
||||||
|
(*) Security is negotiated on a per-connection basis. The connection is
|
||||||
|
initiated by the first data packet on it arriving. If security is
|
||||||
|
requested, the server then issues a "challenge" and then the client
|
||||||
|
replies with a "response". If the response is successful, the security is
|
||||||
|
set for the lifetime of that connection, and all subsequent calls made
|
||||||
|
upon it use that same security. In the event that the server lets a
|
||||||
|
connection lapse before the client, the security will be renegotiated if
|
||||||
|
the client uses the connection again.
|
||||||
|
|
||||||
|
(*) Calls use ACK packets to handle reliability. Data packets are also
|
||||||
|
explicitly sequenced per call.
|
||||||
|
|
||||||
|
(*) There are two types of positive acknowledgement: hard-ACKs and soft-ACKs.
|
||||||
|
A hard-ACK indicates to the far side that all the data received to a point
|
||||||
|
has been received and processed; a soft-ACK indicates that the data has
|
||||||
|
been received but may yet be discarded and re-requested. The sender may
|
||||||
|
not discard any transmittable packets until they've been hard-ACK'd.
|
||||||
|
|
||||||
|
(*) Reception of a reply data packet implicitly hard-ACK's all the data
|
||||||
|
packets that make up the request.
|
||||||
|
|
||||||
|
(*) An call is complete when the request has been sent, the reply has been
|
||||||
|
received and the final hard-ACK on the last packet of the reply has
|
||||||
|
reached the server.
|
||||||
|
|
||||||
|
(*) An call may be aborted by either end at any time up to its completion.
|
||||||
|
|
||||||
|
|
||||||
|
=====================
|
||||||
|
AF_RXRPC DRIVER MODEL
|
||||||
|
=====================
|
||||||
|
|
||||||
|
About the AF_RXRPC driver:
|
||||||
|
|
||||||
|
(*) The AF_RXRPC protocol transparently uses internal sockets of the transport
|
||||||
|
protocol to represent transport endpoints.
|
||||||
|
|
||||||
|
(*) AF_RXRPC sockets map onto RxRPC connection bundles. Actual RxRPC
|
||||||
|
connections are handled transparently. One client socket may be used to
|
||||||
|
make multiple simultaneous calls to the same service. One server socket
|
||||||
|
may handle calls from many clients.
|
||||||
|
|
||||||
|
(*) Additional parallel client connections will be initiated to support extra
|
||||||
|
concurrent calls, up to a tunable limit.
|
||||||
|
|
||||||
|
(*) Each connection is retained for a certain amount of time [tunable] after
|
||||||
|
the last call currently using it has completed in case a new call is made
|
||||||
|
that could reuse it.
|
||||||
|
|
||||||
|
(*) Each internal UDP socket is retained [tunable] for a certain amount of
|
||||||
|
time [tunable] after the last connection using it discarded, in case a new
|
||||||
|
connection is made that could use it.
|
||||||
|
|
||||||
|
(*) A client-side connection is only shared between calls if they have have
|
||||||
|
the same key struct describing their security (and assuming the calls
|
||||||
|
would otherwise share the connection). Non-secured calls would also be
|
||||||
|
able to share connections with each other.
|
||||||
|
|
||||||
|
(*) A server-side connection is shared if the client says it is.
|
||||||
|
|
||||||
|
(*) ACK'ing is handled by the protocol driver automatically, including ping
|
||||||
|
replying.
|
||||||
|
|
||||||
|
(*) SO_KEEPALIVE automatically pings the other side to keep the connection
|
||||||
|
alive [TODO].
|
||||||
|
|
||||||
|
(*) If an ICMP error is received, all calls affected by that error will be
|
||||||
|
aborted with an appropriate network error passed through recvmsg().
|
||||||
|
|
||||||
|
|
||||||
|
Interaction with the user of the RxRPC socket:
|
||||||
|
|
||||||
|
(*) A socket is made into a server socket by binding an address with a
|
||||||
|
non-zero service ID.
|
||||||
|
|
||||||
|
(*) In the client, sending a request is achieved with one or more sendmsgs,
|
||||||
|
followed by the reply being received with one or more recvmsgs.
|
||||||
|
|
||||||
|
(*) The first sendmsg for a request to be sent from a client contains a tag to
|
||||||
|
be used in all other sendmsgs or recvmsgs associated with that call. The
|
||||||
|
tag is carried in the control data.
|
||||||
|
|
||||||
|
(*) connect() is used to supply a default destination address for a client
|
||||||
|
socket. This may be overridden by supplying an alternate address to the
|
||||||
|
first sendmsg() of a call (struct msghdr::msg_name).
|
||||||
|
|
||||||
|
(*) If connect() is called on an unbound client, a random local port will
|
||||||
|
bound before the operation takes place.
|
||||||
|
|
||||||
|
(*) A server socket may also be used to make client calls. To do this, the
|
||||||
|
first sendmsg() of the call must specify the target address. The server's
|
||||||
|
transport endpoint is used to send the packets.
|
||||||
|
|
||||||
|
(*) Once the application has received the last message associated with a call,
|
||||||
|
the tag is guaranteed not to be seen again, and so it can be used to pin
|
||||||
|
client resources. A new call can then be initiated with the same tag
|
||||||
|
without fear of interference.
|
||||||
|
|
||||||
|
(*) In the server, a request is received with one or more recvmsgs, then the
|
||||||
|
the reply is transmitted with one or more sendmsgs, and then the final ACK
|
||||||
|
is received with a last recvmsg.
|
||||||
|
|
||||||
|
(*) When sending data for a call, sendmsg is given MSG_MORE if there's more
|
||||||
|
data to come on that call.
|
||||||
|
|
||||||
|
(*) When receiving data for a call, recvmsg flags MSG_MORE if there's more
|
||||||
|
data to come for that call.
|
||||||
|
|
||||||
|
(*) When receiving data or messages for a call, MSG_EOR is flagged by recvmsg
|
||||||
|
to indicate the terminal message for that call.
|
||||||
|
|
||||||
|
(*) A call may be aborted by adding an abort control message to the control
|
||||||
|
data. Issuing an abort terminates the kernel's use of that call's tag.
|
||||||
|
Any messages waiting in the receive queue for that call will be discarded.
|
||||||
|
|
||||||
|
(*) Aborts, busy notifications and challenge packets are delivered by recvmsg,
|
||||||
|
and control data messages will be set to indicate the context. Receiving
|
||||||
|
an abort or a busy message terminates the kernel's use of that call's tag.
|
||||||
|
|
||||||
|
(*) The control data part of the msghdr struct is used for a number of things:
|
||||||
|
|
||||||
|
(*) The tag of the intended or affected call.
|
||||||
|
|
||||||
|
(*) Sending or receiving errors, aborts and busy notifications.
|
||||||
|
|
||||||
|
(*) Notifications of incoming calls.
|
||||||
|
|
||||||
|
(*) Sending debug requests and receiving debug replies [TODO].
|
||||||
|
|
||||||
|
(*) When the kernel has received and set up an incoming call, it sends a
|
||||||
|
message to server application to let it know there's a new call awaiting
|
||||||
|
its acceptance [recvmsg reports a special control message]. The server
|
||||||
|
application then uses sendmsg to assign a tag to the new call. Once that
|
||||||
|
is done, the first part of the request data will be delivered by recvmsg.
|
||||||
|
|
||||||
|
(*) The server application has to provide the server socket with a keyring of
|
||||||
|
secret keys corresponding to the security types it permits. When a secure
|
||||||
|
connection is being set up, the kernel looks up the appropriate secret key
|
||||||
|
in the keyring and then sends a challenge packet to the client and
|
||||||
|
receives a response packet. The kernel then checks the authorisation of
|
||||||
|
the packet and either aborts the connection or sets up the security.
|
||||||
|
|
||||||
|
(*) The name of the key a client will use to secure its communications is
|
||||||
|
nominated by a socket option.
|
||||||
|
|
||||||
|
|
||||||
|
Notes on recvmsg:
|
||||||
|
|
||||||
|
(*) If there's a sequence of data messages belonging to a particular call on
|
||||||
|
the receive queue, then recvmsg will keep working through them until:
|
||||||
|
|
||||||
|
(a) it meets the end of that call's received data,
|
||||||
|
|
||||||
|
(b) it meets a non-data message,
|
||||||
|
|
||||||
|
(c) it meets a message belonging to a different call, or
|
||||||
|
|
||||||
|
(d) it fills the user buffer.
|
||||||
|
|
||||||
|
If recvmsg is called in blocking mode, it will keep sleeping, awaiting the
|
||||||
|
reception of further data, until one of the above four conditions is met.
|
||||||
|
|
||||||
|
(2) MSG_PEEK operates similarly, but will return immediately if it has put any
|
||||||
|
data in the buffer rather than sleeping until it can fill the buffer.
|
||||||
|
|
||||||
|
(3) If a data message is only partially consumed in filling a user buffer,
|
||||||
|
then the remainder of that message will be left on the front of the queue
|
||||||
|
for the next taker. MSG_TRUNC will never be flagged.
|
||||||
|
|
||||||
|
(4) If there is more data to be had on a call (it hasn't copied the last byte
|
||||||
|
of the last data message in that phase yet), then MSG_MORE will be
|
||||||
|
flagged.
|
||||||
|
|
||||||
|
|
||||||
|
================
|
||||||
|
CONTROL MESSAGES
|
||||||
|
================
|
||||||
|
|
||||||
|
AF_RXRPC makes use of control messages in sendmsg() and recvmsg() to multiplex
|
||||||
|
calls, to invoke certain actions and to report certain conditions. These are:
|
||||||
|
|
||||||
|
MESSAGE ID SRT DATA MEANING
|
||||||
|
======================= === =========== ===============================
|
||||||
|
RXRPC_USER_CALL_ID sr- User ID App's call specifier
|
||||||
|
RXRPC_ABORT srt Abort code Abort code to issue/received
|
||||||
|
RXRPC_ACK -rt n/a Final ACK received
|
||||||
|
RXRPC_NET_ERROR -rt error num Network error on call
|
||||||
|
RXRPC_BUSY -rt n/a Call rejected (server busy)
|
||||||
|
RXRPC_LOCAL_ERROR -rt error num Local error encountered
|
||||||
|
RXRPC_NEW_CALL -r- n/a New call received
|
||||||
|
RXRPC_ACCEPT s-- n/a Accept new call
|
||||||
|
|
||||||
|
(SRT = usable in Sendmsg / delivered by Recvmsg / Terminal message)
|
||||||
|
|
||||||
|
(*) RXRPC_USER_CALL_ID
|
||||||
|
|
||||||
|
This is used to indicate the application's call ID. It's an unsigned long
|
||||||
|
that the app specifies in the client by attaching it to the first data
|
||||||
|
message or in the server by passing it in association with an RXRPC_ACCEPT
|
||||||
|
message. recvmsg() passes it in conjunction with all messages except
|
||||||
|
those of the RXRPC_NEW_CALL message.
|
||||||
|
|
||||||
|
(*) RXRPC_ABORT
|
||||||
|
|
||||||
|
This is can be used by an application to abort a call by passing it to
|
||||||
|
sendmsg, or it can be delivered by recvmsg to indicate a remote abort was
|
||||||
|
received. Either way, it must be associated with an RXRPC_USER_CALL_ID to
|
||||||
|
specify the call affected. If an abort is being sent, then error EBADSLT
|
||||||
|
will be returned if there is no call with that user ID.
|
||||||
|
|
||||||
|
(*) RXRPC_ACK
|
||||||
|
|
||||||
|
This is delivered to a server application to indicate that the final ACK
|
||||||
|
of a call was received from the client. It will be associated with an
|
||||||
|
RXRPC_USER_CALL_ID to indicate the call that's now complete.
|
||||||
|
|
||||||
|
(*) RXRPC_NET_ERROR
|
||||||
|
|
||||||
|
This is delivered to an application to indicate that an ICMP error message
|
||||||
|
was encountered in the process of trying to talk to the peer. An
|
||||||
|
errno-class integer value will be included in the control message data
|
||||||
|
indicating the problem, and an RXRPC_USER_CALL_ID will indicate the call
|
||||||
|
affected.
|
||||||
|
|
||||||
|
(*) RXRPC_BUSY
|
||||||
|
|
||||||
|
This is delivered to a client application to indicate that a call was
|
||||||
|
rejected by the server due to the server being busy. It will be
|
||||||
|
associated with an RXRPC_USER_CALL_ID to indicate the rejected call.
|
||||||
|
|
||||||
|
(*) RXRPC_LOCAL_ERROR
|
||||||
|
|
||||||
|
This is delivered to an application to indicate that a local error was
|
||||||
|
encountered and that a call has been aborted because of it. An
|
||||||
|
errno-class integer value will be included in the control message data
|
||||||
|
indicating the problem, and an RXRPC_USER_CALL_ID will indicate the call
|
||||||
|
affected.
|
||||||
|
|
||||||
|
(*) RXRPC_NEW_CALL
|
||||||
|
|
||||||
|
This is delivered to indicate to a server application that a new call has
|
||||||
|
arrived and is awaiting acceptance. No user ID is associated with this,
|
||||||
|
as a user ID must subsequently be assigned by doing an RXRPC_ACCEPT.
|
||||||
|
|
||||||
|
(*) RXRPC_ACCEPT
|
||||||
|
|
||||||
|
This is used by a server application to attempt to accept a call and
|
||||||
|
assign it a user ID. It should be associated with an RXRPC_USER_CALL_ID
|
||||||
|
to indicate the user ID to be assigned. If there is no call to be
|
||||||
|
accepted (it may have timed out, been aborted, etc.), then sendmsg will
|
||||||
|
return error ENODATA. If the user ID is already in use by another call,
|
||||||
|
then error EBADSLT will be returned.
|
||||||
|
|
||||||
|
|
||||||
|
==============
|
||||||
|
SOCKET OPTIONS
|
||||||
|
==============
|
||||||
|
|
||||||
|
AF_RXRPC sockets support a few socket options at the SOL_RXRPC level:
|
||||||
|
|
||||||
|
(*) RXRPC_SECURITY_KEY
|
||||||
|
|
||||||
|
This is used to specify the description of the key to be used. The key is
|
||||||
|
extracted from the calling process's keyrings with request_key() and
|
||||||
|
should be of "rxrpc" type.
|
||||||
|
|
||||||
|
The optval pointer points to the description string, and optlen indicates
|
||||||
|
how long the string is, without the NUL terminator.
|
||||||
|
|
||||||
|
(*) RXRPC_SECURITY_KEYRING
|
||||||
|
|
||||||
|
Similar to above but specifies a keyring of server secret keys to use (key
|
||||||
|
type "keyring"). See the "Security" section.
|
||||||
|
|
||||||
|
(*) RXRPC_EXCLUSIVE_CONNECTION
|
||||||
|
|
||||||
|
This is used to request that new connections should be used for each call
|
||||||
|
made subsequently on this socket. optval should be NULL and optlen 0.
|
||||||
|
|
||||||
|
(*) RXRPC_MIN_SECURITY_LEVEL
|
||||||
|
|
||||||
|
This is used to specify the minimum security level required for calls on
|
||||||
|
this socket. optval must point to an int containing one of the following
|
||||||
|
values:
|
||||||
|
|
||||||
|
(a) RXRPC_SECURITY_PLAIN
|
||||||
|
|
||||||
|
Encrypted checksum only.
|
||||||
|
|
||||||
|
(b) RXRPC_SECURITY_AUTH
|
||||||
|
|
||||||
|
Encrypted checksum plus packet padded and first eight bytes of packet
|
||||||
|
encrypted - which includes the actual packet length.
|
||||||
|
|
||||||
|
(c) RXRPC_SECURITY_ENCRYPTED
|
||||||
|
|
||||||
|
Encrypted checksum plus entire packet padded and encrypted, including
|
||||||
|
actual packet length.
|
||||||
|
|
||||||
|
|
||||||
|
========
|
||||||
|
SECURITY
|
||||||
|
========
|
||||||
|
|
||||||
|
Currently, only the kerberos 4 equivalent protocol has been implemented
|
||||||
|
(security index 2 - rxkad). This requires the rxkad module to be loaded and,
|
||||||
|
on the client, tickets of the appropriate type to be obtained from the AFS
|
||||||
|
kaserver or the kerberos server and installed as "rxrpc" type keys. This is
|
||||||
|
normally done using the klog program. An example simple klog program can be
|
||||||
|
found at:
|
||||||
|
|
||||||
|
http://people.redhat.com/~dhowells/rxrpc/klog.c
|
||||||
|
|
||||||
|
The payload provided to add_key() on the client should be of the following
|
||||||
|
form:
|
||||||
|
|
||||||
|
struct rxrpc_key_sec2_v1 {
|
||||||
|
uint16_t security_index; /* 2 */
|
||||||
|
uint16_t ticket_length; /* length of ticket[] */
|
||||||
|
uint32_t expiry; /* time at which expires */
|
||||||
|
uint8_t kvno; /* key version number */
|
||||||
|
uint8_t __pad[3];
|
||||||
|
uint8_t session_key[8]; /* DES session key */
|
||||||
|
uint8_t ticket[0]; /* the encrypted ticket */
|
||||||
|
};
|
||||||
|
|
||||||
|
Where the ticket blob is just appended to the above structure.
|
||||||
|
|
||||||
|
|
||||||
|
For the server, keys of type "rxrpc_s" must be made available to the server.
|
||||||
|
They have a description of "<serviceID>:<securityIndex>" (eg: "52:2" for an
|
||||||
|
rxkad key for the AFS VL service). When such a key is created, it should be
|
||||||
|
given the server's secret key as the instantiation data (see the example
|
||||||
|
below).
|
||||||
|
|
||||||
|
add_key("rxrpc_s", "52:2", secret_key, 8, keyring);
|
||||||
|
|
||||||
|
A keyring is passed to the server socket by naming it in a sockopt. The server
|
||||||
|
socket then looks the server secret keys up in this keyring when secure
|
||||||
|
incoming connections are made. This can be seen in an example program that can
|
||||||
|
be found at:
|
||||||
|
|
||||||
|
http://people.redhat.com/~dhowells/rxrpc/listen.c
|
||||||
|
|
||||||
|
|
||||||
|
====================
|
||||||
|
EXAMPLE CLIENT USAGE
|
||||||
|
====================
|
||||||
|
|
||||||
|
A client would issue an operation by:
|
||||||
|
|
||||||
|
(1) An RxRPC socket is set up by:
|
||||||
|
|
||||||
|
client = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);
|
||||||
|
|
||||||
|
Where the third parameter indicates the protocol family of the transport
|
||||||
|
socket used - usually IPv4 but it can also be IPv6 [TODO].
|
||||||
|
|
||||||
|
(2) A local address can optionally be bound:
|
||||||
|
|
||||||
|
struct sockaddr_rxrpc srx = {
|
||||||
|
.srx_family = AF_RXRPC,
|
||||||
|
.srx_service = 0, /* we're a client */
|
||||||
|
.transport_type = SOCK_DGRAM, /* type of transport socket */
|
||||||
|
.transport.sin_family = AF_INET,
|
||||||
|
.transport.sin_port = htons(7000), /* AFS callback */
|
||||||
|
.transport.sin_address = 0, /* all local interfaces */
|
||||||
|
};
|
||||||
|
bind(client, &srx, sizeof(srx));
|
||||||
|
|
||||||
|
This specifies the local UDP port to be used. If not given, a random
|
||||||
|
non-privileged port will be used. A UDP port may be shared between
|
||||||
|
several unrelated RxRPC sockets. Security is handled on a basis of
|
||||||
|
per-RxRPC virtual connection.
|
||||||
|
|
||||||
|
(3) The security is set:
|
||||||
|
|
||||||
|
const char *key = "AFS:cambridge.redhat.com";
|
||||||
|
setsockopt(client, SOL_RXRPC, RXRPC_SECURITY_KEY, key, strlen(key));
|
||||||
|
|
||||||
|
This issues a request_key() to get the key representing the security
|
||||||
|
context. The minimum security level can be set:
|
||||||
|
|
||||||
|
unsigned int sec = RXRPC_SECURITY_ENCRYPTED;
|
||||||
|
setsockopt(client, SOL_RXRPC, RXRPC_MIN_SECURITY_LEVEL,
|
||||||
|
&sec, sizeof(sec));
|
||||||
|
|
||||||
|
(4) The server to be contacted can then be specified (alternatively this can
|
||||||
|
be done through sendmsg):
|
||||||
|
|
||||||
|
struct sockaddr_rxrpc srx = {
|
||||||
|
.srx_family = AF_RXRPC,
|
||||||
|
.srx_service = VL_SERVICE_ID,
|
||||||
|
.transport_type = SOCK_DGRAM, /* type of transport socket */
|
||||||
|
.transport.sin_family = AF_INET,
|
||||||
|
.transport.sin_port = htons(7005), /* AFS volume manager */
|
||||||
|
.transport.sin_address = ...,
|
||||||
|
};
|
||||||
|
connect(client, &srx, sizeof(srx));
|
||||||
|
|
||||||
|
(5) The request data should then be posted to the server socket using a series
|
||||||
|
of sendmsg() calls, each with the following control message attached:
|
||||||
|
|
||||||
|
RXRPC_USER_CALL_ID - specifies the user ID for this call
|
||||||
|
|
||||||
|
MSG_MORE should be set in msghdr::msg_flags on all but the last part of
|
||||||
|
the request. Multiple requests may be made simultaneously.
|
||||||
|
|
||||||
|
If a call is intended to go to a destination other then the default
|
||||||
|
specified through connect(), then msghdr::msg_name should be set on the
|
||||||
|
first request message of that call.
|
||||||
|
|
||||||
|
(6) The reply data will then be posted to the server socket for recvmsg() to
|
||||||
|
pick up. MSG_MORE will be flagged by recvmsg() if there's more reply data
|
||||||
|
for a particular call to be read. MSG_EOR will be set on the terminal
|
||||||
|
read for a call.
|
||||||
|
|
||||||
|
All data will be delivered with the following control message attached:
|
||||||
|
|
||||||
|
RXRPC_USER_CALL_ID - specifies the user ID for this call
|
||||||
|
|
||||||
|
If an abort or error occurred, this will be returned in the control data
|
||||||
|
buffer instead, and MSG_EOR will be flagged to indicate the end of that
|
||||||
|
call.
|
||||||
|
|
||||||
|
|
||||||
|
====================
|
||||||
|
EXAMPLE SERVER USAGE
|
||||||
|
====================
|
||||||
|
|
||||||
|
A server would be set up to accept operations in the following manner:
|
||||||
|
|
||||||
|
(1) An RxRPC socket is created by:
|
||||||
|
|
||||||
|
server = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);
|
||||||
|
|
||||||
|
Where the third parameter indicates the address type of the transport
|
||||||
|
socket used - usually IPv4.
|
||||||
|
|
||||||
|
(2) Security is set up if desired by giving the socket a keyring with server
|
||||||
|
secret keys in it:
|
||||||
|
|
||||||
|
keyring = add_key("keyring", "AFSkeys", NULL, 0,
|
||||||
|
KEY_SPEC_PROCESS_KEYRING);
|
||||||
|
|
||||||
|
const char secret_key[8] = {
|
||||||
|
0xa7, 0x83, 0x8a, 0xcb, 0xc7, 0x83, 0xec, 0x94 };
|
||||||
|
add_key("rxrpc_s", "52:2", secret_key, 8, keyring);
|
||||||
|
|
||||||
|
setsockopt(server, SOL_RXRPC, RXRPC_SECURITY_KEYRING, "AFSkeys", 7);
|
||||||
|
|
||||||
|
The keyring can be manipulated after it has been given to the socket. This
|
||||||
|
permits the server to add more keys, replace keys, etc. whilst it is live.
|
||||||
|
|
||||||
|
(2) A local address must then be bound:
|
||||||
|
|
||||||
|
struct sockaddr_rxrpc srx = {
|
||||||
|
.srx_family = AF_RXRPC,
|
||||||
|
.srx_service = VL_SERVICE_ID, /* RxRPC service ID */
|
||||||
|
.transport_type = SOCK_DGRAM, /* type of transport socket */
|
||||||
|
.transport.sin_family = AF_INET,
|
||||||
|
.transport.sin_port = htons(7000), /* AFS callback */
|
||||||
|
.transport.sin_address = 0, /* all local interfaces */
|
||||||
|
};
|
||||||
|
bind(server, &srx, sizeof(srx));
|
||||||
|
|
||||||
|
(3) The server is then set to listen out for incoming calls:
|
||||||
|
|
||||||
|
listen(server, 100);
|
||||||
|
|
||||||
|
(4) The kernel notifies the server of pending incoming connections by sending
|
||||||
|
it a message for each. This is received with recvmsg() on the server
|
||||||
|
socket. It has no data, and has a single dataless control message
|
||||||
|
attached:
|
||||||
|
|
||||||
|
RXRPC_NEW_CALL
|
||||||
|
|
||||||
|
The address that can be passed back by recvmsg() at this point should be
|
||||||
|
ignored since the call for which the message was posted may have gone by
|
||||||
|
the time it is accepted - in which case the first call still on the queue
|
||||||
|
will be accepted.
|
||||||
|
|
||||||
|
(5) The server then accepts the new call by issuing a sendmsg() with two
|
||||||
|
pieces of control data and no actual data:
|
||||||
|
|
||||||
|
RXRPC_ACCEPT - indicate connection acceptance
|
||||||
|
RXRPC_USER_CALL_ID - specify user ID for this call
|
||||||
|
|
||||||
|
(6) The first request data packet will then be posted to the server socket for
|
||||||
|
recvmsg() to pick up. At that point, the RxRPC address for the call can
|
||||||
|
be read from the address fields in the msghdr struct.
|
||||||
|
|
||||||
|
Subsequent request data will be posted to the server socket for recvmsg()
|
||||||
|
to collect as it arrives. All but the last piece of the request data will
|
||||||
|
be delivered with MSG_MORE flagged.
|
||||||
|
|
||||||
|
All data will be delivered with the following control message attached:
|
||||||
|
|
||||||
|
RXRPC_USER_CALL_ID - specifies the user ID for this call
|
||||||
|
|
||||||
|
(8) The reply data should then be posted to the server socket using a series
|
||||||
|
of sendmsg() calls, each with the following control messages attached:
|
||||||
|
|
||||||
|
RXRPC_USER_CALL_ID - specifies the user ID for this call
|
||||||
|
|
||||||
|
MSG_MORE should be set in msghdr::msg_flags on all but the last message
|
||||||
|
for a particular call.
|
||||||
|
|
||||||
|
(9) The final ACK from the client will be posted for retrieval by recvmsg()
|
||||||
|
when it is received. It will take the form of a dataless message with two
|
||||||
|
control messages attached:
|
||||||
|
|
||||||
|
RXRPC_USER_CALL_ID - specifies the user ID for this call
|
||||||
|
RXRPC_ACK - indicates final ACK (no data)
|
||||||
|
|
||||||
|
MSG_EOR will be flagged to indicate that this is the final message for
|
||||||
|
this call.
|
||||||
|
|
||||||
|
(10) Up to the point the final packet of reply data is sent, the call can be
|
||||||
|
aborted by calling sendmsg() with a dataless message with the following
|
||||||
|
control messages attached:
|
||||||
|
|
||||||
|
RXRPC_USER_CALL_ID - specifies the user ID for this call
|
||||||
|
RXRPC_ABORT - indicates abort code (4 byte data)
|
||||||
|
|
||||||
|
Any packets waiting in the socket's receive queue will be discarded if
|
||||||
|
this is issued.
|
||||||
|
|
||||||
|
Note that all the communications for a particular service take place through
|
||||||
|
the one server socket, using control messages on sendmsg() and recvmsg() to
|
||||||
|
determine the call affected.
|
||||||
|
|
||||||
|
|
||||||
|
=========================
|
||||||
|
AF_RXRPC KERNEL INTERFACE
|
||||||
|
=========================
|
||||||
|
|
||||||
|
The AF_RXRPC module also provides an interface for use by in-kernel utilities
|
||||||
|
such as the AFS filesystem. This permits such a utility to:
|
||||||
|
|
||||||
|
(1) Use different keys directly on individual client calls on one socket
|
||||||
|
rather than having to open a whole slew of sockets, one for each key it
|
||||||
|
might want to use.
|
||||||
|
|
||||||
|
(2) Avoid having RxRPC call request_key() at the point of issue of a call or
|
||||||
|
opening of a socket. Instead the utility is responsible for requesting a
|
||||||
|
key at the appropriate point. AFS, for instance, would do this during VFS
|
||||||
|
operations such as open() or unlink(). The key is then handed through
|
||||||
|
when the call is initiated.
|
||||||
|
|
||||||
|
(3) Request the use of something other than GFP_KERNEL to allocate memory.
|
||||||
|
|
||||||
|
(4) Avoid the overhead of using the recvmsg() call. RxRPC messages can be
|
||||||
|
intercepted before they get put into the socket Rx queue and the socket
|
||||||
|
buffers manipulated directly.
|
||||||
|
|
||||||
|
To use the RxRPC facility, a kernel utility must still open an AF_RXRPC socket,
|
||||||
|
bind an addess as appropriate and listen if it's to be a server socket, but
|
||||||
|
then it passes this to the kernel interface functions.
|
||||||
|
|
||||||
|
The kernel interface functions are as follows:
|
||||||
|
|
||||||
|
(*) Begin a new client call.
|
||||||
|
|
||||||
|
struct rxrpc_call *
|
||||||
|
rxrpc_kernel_begin_call(struct socket *sock,
|
||||||
|
struct sockaddr_rxrpc *srx,
|
||||||
|
struct key *key,
|
||||||
|
unsigned long user_call_ID,
|
||||||
|
gfp_t gfp);
|
||||||
|
|
||||||
|
This allocates the infrastructure to make a new RxRPC call and assigns
|
||||||
|
call and connection numbers. The call will be made on the UDP port that
|
||||||
|
the socket is bound to. The call will go to the destination address of a
|
||||||
|
connected client socket unless an alternative is supplied (srx is
|
||||||
|
non-NULL).
|
||||||
|
|
||||||
|
If a key is supplied then this will be used to secure the call instead of
|
||||||
|
the key bound to the socket with the RXRPC_SECURITY_KEY sockopt. Calls
|
||||||
|
secured in this way will still share connections if at all possible.
|
||||||
|
|
||||||
|
The user_call_ID is equivalent to that supplied to sendmsg() in the
|
||||||
|
control data buffer. It is entirely feasible to use this to point to a
|
||||||
|
kernel data structure.
|
||||||
|
|
||||||
|
If this function is successful, an opaque reference to the RxRPC call is
|
||||||
|
returned. The caller now holds a reference on this and it must be
|
||||||
|
properly ended.
|
||||||
|
|
||||||
|
(*) End a client call.
|
||||||
|
|
||||||
|
void rxrpc_kernel_end_call(struct rxrpc_call *call);
|
||||||
|
|
||||||
|
This is used to end a previously begun call. The user_call_ID is expunged
|
||||||
|
from AF_RXRPC's knowledge and will not be seen again in association with
|
||||||
|
the specified call.
|
||||||
|
|
||||||
|
(*) Send data through a call.
|
||||||
|
|
||||||
|
int rxrpc_kernel_send_data(struct rxrpc_call *call, struct msghdr *msg,
|
||||||
|
size_t len);
|
||||||
|
|
||||||
|
This is used to supply either the request part of a client call or the
|
||||||
|
reply part of a server call. msg.msg_iovlen and msg.msg_iov specify the
|
||||||
|
data buffers to be used. msg_iov may not be NULL and must point
|
||||||
|
exclusively to in-kernel virtual addresses. msg.msg_flags may be given
|
||||||
|
MSG_MORE if there will be subsequent data sends for this call.
|
||||||
|
|
||||||
|
The msg must not specify a destination address, control data or any flags
|
||||||
|
other than MSG_MORE. len is the total amount of data to transmit.
|
||||||
|
|
||||||
|
(*) Abort a call.
|
||||||
|
|
||||||
|
void rxrpc_kernel_abort_call(struct rxrpc_call *call, u32 abort_code);
|
||||||
|
|
||||||
|
This is used to abort a call if it's still in an abortable state. The
|
||||||
|
abort code specified will be placed in the ABORT message sent.
|
||||||
|
|
||||||
|
(*) Intercept received RxRPC messages.
|
||||||
|
|
||||||
|
typedef void (*rxrpc_interceptor_t)(struct sock *sk,
|
||||||
|
unsigned long user_call_ID,
|
||||||
|
struct sk_buff *skb);
|
||||||
|
|
||||||
|
void
|
||||||
|
rxrpc_kernel_intercept_rx_messages(struct socket *sock,
|
||||||
|
rxrpc_interceptor_t interceptor);
|
||||||
|
|
||||||
|
This installs an interceptor function on the specified AF_RXRPC socket.
|
||||||
|
All messages that would otherwise wind up in the socket's Rx queue are
|
||||||
|
then diverted to this function. Note that care must be taken to process
|
||||||
|
the messages in the right order to maintain DATA message sequentiality.
|
||||||
|
|
||||||
|
The interceptor function itself is provided with the address of the socket
|
||||||
|
and handling the incoming message, the ID assigned by the kernel utility
|
||||||
|
to the call and the socket buffer containing the message.
|
||||||
|
|
||||||
|
The skb->mark field indicates the type of message:
|
||||||
|
|
||||||
|
MARK MEANING
|
||||||
|
=============================== =======================================
|
||||||
|
RXRPC_SKB_MARK_DATA Data message
|
||||||
|
RXRPC_SKB_MARK_FINAL_ACK Final ACK received for an incoming call
|
||||||
|
RXRPC_SKB_MARK_BUSY Client call rejected as server busy
|
||||||
|
RXRPC_SKB_MARK_REMOTE_ABORT Call aborted by peer
|
||||||
|
RXRPC_SKB_MARK_NET_ERROR Network error detected
|
||||||
|
RXRPC_SKB_MARK_LOCAL_ERROR Local error encountered
|
||||||
|
RXRPC_SKB_MARK_NEW_CALL New incoming call awaiting acceptance
|
||||||
|
|
||||||
|
The remote abort message can be probed with rxrpc_kernel_get_abort_code().
|
||||||
|
The two error messages can be probed with rxrpc_kernel_get_error_number().
|
||||||
|
A new call can be accepted with rxrpc_kernel_accept_call().
|
||||||
|
|
||||||
|
Data messages can have their contents extracted with the usual bunch of
|
||||||
|
socket buffer manipulation functions. A data message can be determined to
|
||||||
|
be the last one in a sequence with rxrpc_kernel_is_data_last(). When a
|
||||||
|
data message has been used up, rxrpc_kernel_data_delivered() should be
|
||||||
|
called on it..
|
||||||
|
|
||||||
|
Non-data messages should be handled to rxrpc_kernel_free_skb() to dispose
|
||||||
|
of. It is possible to get extra refs on all types of message for later
|
||||||
|
freeing, but this may pin the state of a call until the message is finally
|
||||||
|
freed.
|
||||||
|
|
||||||
|
(*) Accept an incoming call.
|
||||||
|
|
||||||
|
struct rxrpc_call *
|
||||||
|
rxrpc_kernel_accept_call(struct socket *sock,
|
||||||
|
unsigned long user_call_ID);
|
||||||
|
|
||||||
|
This is used to accept an incoming call and to assign it a call ID. This
|
||||||
|
function is similar to rxrpc_kernel_begin_call() and calls accepted must
|
||||||
|
be ended in the same way.
|
||||||
|
|
||||||
|
If this function is successful, an opaque reference to the RxRPC call is
|
||||||
|
returned. The caller now holds a reference on this and it must be
|
||||||
|
properly ended.
|
||||||
|
|
||||||
|
(*) Reject an incoming call.
|
||||||
|
|
||||||
|
int rxrpc_kernel_reject_call(struct socket *sock);
|
||||||
|
|
||||||
|
This is used to reject the first incoming call on the socket's queue with
|
||||||
|
a BUSY message. -ENODATA is returned if there were no incoming calls.
|
||||||
|
Other errors may be returned if the call had been aborted (-ECONNABORTED)
|
||||||
|
or had timed out (-ETIME).
|
||||||
|
|
||||||
|
(*) Record the delivery of a data message and free it.
|
||||||
|
|
||||||
|
void rxrpc_kernel_data_delivered(struct sk_buff *skb);
|
||||||
|
|
||||||
|
This is used to record a data message as having been delivered and to
|
||||||
|
update the ACK state for the call. The socket buffer will be freed.
|
||||||
|
|
||||||
|
(*) Free a message.
|
||||||
|
|
||||||
|
void rxrpc_kernel_free_skb(struct sk_buff *skb);
|
||||||
|
|
||||||
|
This is used to free a non-DATA socket buffer intercepted from an AF_RXRPC
|
||||||
|
socket.
|
||||||
|
|
||||||
|
(*) Determine if a data message is the last one on a call.
|
||||||
|
|
||||||
|
bool rxrpc_kernel_is_data_last(struct sk_buff *skb);
|
||||||
|
|
||||||
|
This is used to determine if a socket buffer holds the last data message
|
||||||
|
to be received for a call (true will be returned if it does, false
|
||||||
|
if not).
|
||||||
|
|
||||||
|
The data message will be part of the reply on a client call and the
|
||||||
|
request on an incoming call. In the latter case there will be more
|
||||||
|
messages, but in the former case there will not.
|
||||||
|
|
||||||
|
(*) Get the abort code from an abort message.
|
||||||
|
|
||||||
|
u32 rxrpc_kernel_get_abort_code(struct sk_buff *skb);
|
||||||
|
|
||||||
|
This is used to extract the abort code from a remote abort message.
|
||||||
|
|
||||||
|
(*) Get the error number from a local or network error message.
|
||||||
|
|
||||||
|
int rxrpc_kernel_get_error_number(struct sk_buff *skb);
|
||||||
|
|
||||||
|
This is used to extract the error number from a message indicating either
|
||||||
|
a local error occurred or a network error occurred.
|
@ -250,7 +250,6 @@ PRODUCT COMPONENTS AND RELATED FILES
|
|||||||
sdladrv.h SDLA support module API definitions
|
sdladrv.h SDLA support module API definitions
|
||||||
sdlasfm.h SDLA firmware module definitions
|
sdlasfm.h SDLA firmware module definitions
|
||||||
if_wanpipe.h WANPIPE Socket definitions
|
if_wanpipe.h WANPIPE Socket definitions
|
||||||
if_wanpipe_common.h WANPIPE Socket/Driver common definitions.
|
|
||||||
sdlapci.h WANPIPE PCI definitions
|
sdlapci.h WANPIPE PCI definitions
|
||||||
|
|
||||||
|
|
||||||
|
38
MAINTAINERS
38
MAINTAINERS
@ -384,7 +384,7 @@ S: Supported
|
|||||||
|
|
||||||
APPLETALK NETWORK LAYER
|
APPLETALK NETWORK LAYER
|
||||||
P: Arnaldo Carvalho de Melo
|
P: Arnaldo Carvalho de Melo
|
||||||
M: acme@conectiva.com.br
|
M: acme@ghostprotocols.net
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
ARC FRAMEBUFFER DRIVER
|
ARC FRAMEBUFFER DRIVER
|
||||||
@ -656,6 +656,7 @@ S: Supported
|
|||||||
ATMEL WIRELESS DRIVER
|
ATMEL WIRELESS DRIVER
|
||||||
P: Simon Kelley
|
P: Simon Kelley
|
||||||
M: simon@thekelleys.org.uk
|
M: simon@thekelleys.org.uk
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
W: http://www.thekelleys.org.uk/atmel
|
W: http://www.thekelleys.org.uk/atmel
|
||||||
W: http://atmelwlandriver.sourceforge.net/
|
W: http://atmelwlandriver.sourceforge.net/
|
||||||
S: Maintained
|
S: Maintained
|
||||||
@ -711,6 +712,7 @@ P: Larry Finger
|
|||||||
M: Larry.Finger@lwfinger.net
|
M: Larry.Finger@lwfinger.net
|
||||||
P: Stefano Brivio
|
P: Stefano Brivio
|
||||||
M: st3@riseup.net
|
M: st3@riseup.net
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
W: http://bcm43xx.berlios.de/
|
W: http://bcm43xx.berlios.de/
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
@ -892,6 +894,12 @@ M: maxextreme@gmail.com
|
|||||||
L: linux-kernel@vger.kernel.org
|
L: linux-kernel@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
|
CFG80211 and NL80211
|
||||||
|
P: Johannes Berg
|
||||||
|
M: johannes@sipsolutions.net
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
|
S: Maintained
|
||||||
|
|
||||||
COMMON INTERNET FILE SYSTEM (CIFS)
|
COMMON INTERNET FILE SYSTEM (CIFS)
|
||||||
P: Steve French
|
P: Steve French
|
||||||
M: sfrench@samba.org
|
M: sfrench@samba.org
|
||||||
@ -1034,9 +1042,8 @@ S: Maintained
|
|||||||
|
|
||||||
CYCLADES 2X SYNC CARD DRIVER
|
CYCLADES 2X SYNC CARD DRIVER
|
||||||
P: Arnaldo Carvalho de Melo
|
P: Arnaldo Carvalho de Melo
|
||||||
M: acme@conectiva.com.br
|
M: acme@ghostprotocols.net
|
||||||
W: http://advogato.org/person/acme
|
W: http://oops.ghostprotocols.net:81/blog
|
||||||
L: cycsyn-devel@bazar.conectiva.com.br
|
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
CYCLADES ASYNC MUX DRIVER
|
CYCLADES ASYNC MUX DRIVER
|
||||||
@ -1077,7 +1084,7 @@ S: Maintained
|
|||||||
|
|
||||||
DCCP PROTOCOL
|
DCCP PROTOCOL
|
||||||
P: Arnaldo Carvalho de Melo
|
P: Arnaldo Carvalho de Melo
|
||||||
M: acme@mandriva.com
|
M: acme@ghostprotocols.net
|
||||||
L: dccp@vger.kernel.org
|
L: dccp@vger.kernel.org
|
||||||
W: http://linux-net.osdl.org/index.php/DCCP
|
W: http://linux-net.osdl.org/index.php/DCCP
|
||||||
S: Maintained
|
S: Maintained
|
||||||
@ -1558,6 +1565,7 @@ S: Supported
|
|||||||
HOST AP DRIVER
|
HOST AP DRIVER
|
||||||
P: Jouni Malinen
|
P: Jouni Malinen
|
||||||
M: jkmaline@cc.hut.fi
|
M: jkmaline@cc.hut.fi
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
L: hostap@shmoo.com
|
L: hostap@shmoo.com
|
||||||
W: http://hostap.epitest.fi/
|
W: http://hostap.epitest.fi/
|
||||||
S: Maintained
|
S: Maintained
|
||||||
@ -1830,6 +1838,7 @@ P: Yi Zhu
|
|||||||
M: yi.zhu@intel.com
|
M: yi.zhu@intel.com
|
||||||
P: James Ketrenos
|
P: James Ketrenos
|
||||||
M: jketreno@linux.intel.com
|
M: jketreno@linux.intel.com
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
L: ipw2100-devel@lists.sourceforge.net
|
L: ipw2100-devel@lists.sourceforge.net
|
||||||
L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
|
L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
|
||||||
W: http://ipw2100.sourceforge.net
|
W: http://ipw2100.sourceforge.net
|
||||||
@ -1840,6 +1849,7 @@ P: Yi Zhu
|
|||||||
M: yi.zhu@intel.com
|
M: yi.zhu@intel.com
|
||||||
P: James Ketrenos
|
P: James Ketrenos
|
||||||
M: jketreno@linux.intel.com
|
M: jketreno@linux.intel.com
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
L: ipw2100-devel@lists.sourceforge.net
|
L: ipw2100-devel@lists.sourceforge.net
|
||||||
L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
|
L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
|
||||||
W: http://ipw2200.sourceforge.net
|
W: http://ipw2200.sourceforge.net
|
||||||
@ -1871,7 +1881,7 @@ S: Supported
|
|||||||
|
|
||||||
IPX NETWORK LAYER
|
IPX NETWORK LAYER
|
||||||
P: Arnaldo Carvalho de Melo
|
P: Arnaldo Carvalho de Melo
|
||||||
M: acme@conectiva.com.br
|
M: acme@ghostprotocols.net
|
||||||
L: netdev@vger.kernel.org
|
L: netdev@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
@ -2108,7 +2118,7 @@ S: Supported
|
|||||||
|
|
||||||
LLC (802.2)
|
LLC (802.2)
|
||||||
P: Arnaldo Carvalho de Melo
|
P: Arnaldo Carvalho de Melo
|
||||||
M: acme@conectiva.com.br
|
M: acme@ghostprotocols.net
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
LINUX FOR 64BIT POWERPC
|
LINUX FOR 64BIT POWERPC
|
||||||
@ -2532,6 +2542,7 @@ P: Pavel Roskin
|
|||||||
M: proski@gnu.org
|
M: proski@gnu.org
|
||||||
P: David Gibson
|
P: David Gibson
|
||||||
M: hermes@gibson.dropbear.id.au
|
M: hermes@gibson.dropbear.id.au
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
L: orinoco-users@lists.sourceforge.net
|
L: orinoco-users@lists.sourceforge.net
|
||||||
L: orinoco-devel@lists.sourceforge.net
|
L: orinoco-devel@lists.sourceforge.net
|
||||||
W: http://www.nongnu.org/orinoco/
|
W: http://www.nongnu.org/orinoco/
|
||||||
@ -2711,7 +2722,7 @@ S: Supported
|
|||||||
PRISM54 WIRELESS DRIVER
|
PRISM54 WIRELESS DRIVER
|
||||||
P: Prism54 Development Team
|
P: Prism54 Development Team
|
||||||
M: developers@islsm.org
|
M: developers@islsm.org
|
||||||
L: netdev@vger.kernel.org
|
L: linux-wireless@vger.kernel.org
|
||||||
W: http://prism54.org
|
W: http://prism54.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
@ -2782,7 +2793,7 @@ S: Maintained
|
|||||||
RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
|
RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
|
||||||
P: Corey Thomas
|
P: Corey Thomas
|
||||||
M: corey@world.std.com
|
M: corey@world.std.com
|
||||||
L: linux-kernel@vger.kernel.org
|
L: linux-wireless@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
RANDOM NUMBER DRIVER
|
RANDOM NUMBER DRIVER
|
||||||
@ -3045,7 +3056,7 @@ M: josejx@gentoo.org
|
|||||||
P: Daniel Drake
|
P: Daniel Drake
|
||||||
M: dsd@gentoo.org
|
M: dsd@gentoo.org
|
||||||
W: http://softmac.sipsolutions.net/
|
W: http://softmac.sipsolutions.net/
|
||||||
L: netdev@vger.kernel.org
|
L: linux-wireless@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
SOFTWARE RAID (Multiple Disks) SUPPORT
|
SOFTWARE RAID (Multiple Disks) SUPPORT
|
||||||
@ -3750,6 +3761,7 @@ S: Maintained
|
|||||||
WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS
|
WAVELAN NETWORK DRIVER & WIRELESS EXTENSIONS
|
||||||
P: Jean Tourrilhes
|
P: Jean Tourrilhes
|
||||||
M: jt@hpl.hp.com
|
M: jt@hpl.hp.com
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/
|
W: http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
@ -3766,8 +3778,9 @@ S: Maintained
|
|||||||
|
|
||||||
WL3501 WIRELESS PCMCIA CARD DRIVER
|
WL3501 WIRELESS PCMCIA CARD DRIVER
|
||||||
P: Arnaldo Carvalho de Melo
|
P: Arnaldo Carvalho de Melo
|
||||||
M: acme@conectiva.com.br
|
M: acme@ghostprotocols.net
|
||||||
W: http://advogato.org/person/acme
|
L: linux-wireless@vger.kernel.org
|
||||||
|
W: http://oops.ghostprotocols.net:81/blog
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
X.25 NETWORK LAYER
|
X.25 NETWORK LAYER
|
||||||
@ -3830,6 +3843,7 @@ M: dsd@gentoo.org
|
|||||||
P: Ulrich Kunitz
|
P: Ulrich Kunitz
|
||||||
M: kune@deine-taler.de
|
M: kune@deine-taler.de
|
||||||
W: http://zd1211.ath.cx/wiki/DriverRewrite
|
W: http://zd1211.ath.cx/wiki/DriverRewrite
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
L: zd1211-devs@lists.sourceforge.net (subscribers-only)
|
L: zd1211-devs@lists.sourceforge.net (subscribers-only)
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
|
@ -427,7 +427,6 @@ make_new_skb(struct net_device *dev)
|
|||||||
printk(KERN_NOTICE "%s: memory squeeze. dropping packet.\n", dev->name);
|
printk(KERN_NOTICE "%s: memory squeeze. dropping packet.\n", dev->name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
nskb->dev = dev;
|
|
||||||
|
|
||||||
skb_reserve(nskb, 2); /* Align IP on 16 byte boundaries */
|
skb_reserve(nskb, 2); /* Align IP on 16 byte boundaries */
|
||||||
|
|
||||||
@ -474,7 +473,7 @@ simeth_rx(struct net_device *dev)
|
|||||||
* XXX Fix me
|
* XXX Fix me
|
||||||
* Should really do a csum+copy here
|
* Should really do a csum+copy here
|
||||||
*/
|
*/
|
||||||
memcpy(skb->data, frame, len);
|
skb_copy_to_linear_data(skb, frame, len);
|
||||||
#endif
|
#endif
|
||||||
skb->protocol = eth_type_trans(skb, dev);
|
skb->protocol = eth_type_trans(skb, dev);
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ xpnet_receive(partid_t partid, int channel, struct xpnet_message *msg)
|
|||||||
"%lu)\n", skb->data, &msg->data,
|
"%lu)\n", skb->data, &msg->data,
|
||||||
(size_t) msg->embedded_bytes);
|
(size_t) msg->embedded_bytes);
|
||||||
|
|
||||||
memcpy(skb->data, &msg->data, (size_t) msg->embedded_bytes);
|
skb_copy_to_linear_data(skb, &msg->data, (size_t)msg->embedded_bytes);
|
||||||
} else {
|
} else {
|
||||||
dev_dbg(xpnet, "transferring buffer to the skb->data area;\n\t"
|
dev_dbg(xpnet, "transferring buffer to the skb->data area;\n\t"
|
||||||
"bte_copy(0x%p, 0x%p, %hu)\n", (void *)msg->buf_pa,
|
"bte_copy(0x%p, 0x%p, %hu)\n", (void *)msg->buf_pa,
|
||||||
@ -264,17 +264,16 @@ xpnet_receive(partid_t partid, int channel, struct xpnet_message *msg)
|
|||||||
|
|
||||||
dev_dbg(xpnet, "<skb->head=0x%p skb->data=0x%p skb->tail=0x%p "
|
dev_dbg(xpnet, "<skb->head=0x%p skb->data=0x%p skb->tail=0x%p "
|
||||||
"skb->end=0x%p skb->len=%d\n", (void *) skb->head,
|
"skb->end=0x%p skb->len=%d\n", (void *) skb->head,
|
||||||
(void *) skb->data, (void *) skb->tail, (void *) skb->end,
|
(void *)skb->data, skb_tail_pointer(skb), skb_end_pointer(skb),
|
||||||
skb->len);
|
skb->len);
|
||||||
|
|
||||||
skb->dev = xpnet_device;
|
|
||||||
skb->protocol = eth_type_trans(skb, xpnet_device);
|
skb->protocol = eth_type_trans(skb, xpnet_device);
|
||||||
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
skb->ip_summed = CHECKSUM_UNNECESSARY;
|
||||||
|
|
||||||
dev_dbg(xpnet, "passing skb to network layer; \n\tskb->head=0x%p "
|
dev_dbg(xpnet, "passing skb to network layer; \n\tskb->head=0x%p "
|
||||||
"skb->data=0x%p skb->tail=0x%p skb->end=0x%p skb->len=%d\n",
|
"skb->data=0x%p skb->tail=0x%p skb->end=0x%p skb->len=%d\n",
|
||||||
(void *) skb->head, (void *) skb->data, (void *) skb->tail,
|
(void *)skb->head, (void *)skb->data, skb_tail_pointer(skb),
|
||||||
(void *) skb->end, skb->len);
|
skb_end_pointer(skb), skb->len);
|
||||||
|
|
||||||
|
|
||||||
xpnet_device->last_rx = jiffies;
|
xpnet_device->last_rx = jiffies;
|
||||||
@ -476,7 +475,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
dev_dbg(xpnet, ">skb->head=0x%p skb->data=0x%p skb->tail=0x%p "
|
dev_dbg(xpnet, ">skb->head=0x%p skb->data=0x%p skb->tail=0x%p "
|
||||||
"skb->end=0x%p skb->len=%d\n", (void *) skb->head,
|
"skb->end=0x%p skb->len=%d\n", (void *) skb->head,
|
||||||
(void *) skb->data, (void *) skb->tail, (void *) skb->end,
|
(void *)skb->data, skb_tail_pointer(skb), skb_end_pointer(skb),
|
||||||
skb->len);
|
skb->len);
|
||||||
|
|
||||||
|
|
||||||
@ -498,7 +497,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
/* get the beginning of the first cacheline and end of last */
|
/* get the beginning of the first cacheline and end of last */
|
||||||
start_addr = ((u64) skb->data & ~(L1_CACHE_BYTES - 1));
|
start_addr = ((u64) skb->data & ~(L1_CACHE_BYTES - 1));
|
||||||
end_addr = L1_CACHE_ALIGN((u64) skb->tail);
|
end_addr = L1_CACHE_ALIGN((u64)skb_tail_pointer(skb));
|
||||||
|
|
||||||
/* calculate how many bytes to embed in the XPC message */
|
/* calculate how many bytes to embed in the XPC message */
|
||||||
embedded_bytes = 0;
|
embedded_bytes = 0;
|
||||||
@ -567,14 +566,15 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
msg->version = XPNET_VERSION_EMBED;
|
msg->version = XPNET_VERSION_EMBED;
|
||||||
dev_dbg(xpnet, "calling memcpy(0x%p, 0x%p, 0x%lx)\n",
|
dev_dbg(xpnet, "calling memcpy(0x%p, 0x%p, 0x%lx)\n",
|
||||||
&msg->data, skb->data, (size_t) embedded_bytes);
|
&msg->data, skb->data, (size_t) embedded_bytes);
|
||||||
memcpy(&msg->data, skb->data, (size_t) embedded_bytes);
|
skb_copy_from_linear_data(skb, &msg->data,
|
||||||
|
(size_t)embedded_bytes);
|
||||||
} else {
|
} else {
|
||||||
msg->version = XPNET_VERSION;
|
msg->version = XPNET_VERSION;
|
||||||
}
|
}
|
||||||
msg->magic = XPNET_MAGIC;
|
msg->magic = XPNET_MAGIC;
|
||||||
msg->size = end_addr - start_addr;
|
msg->size = end_addr - start_addr;
|
||||||
msg->leadin_ignore = (u64) skb->data - start_addr;
|
msg->leadin_ignore = (u64) skb->data - start_addr;
|
||||||
msg->tailout_ignore = end_addr - (u64) skb->tail;
|
msg->tailout_ignore = end_addr - (u64)skb_tail_pointer(skb);
|
||||||
msg->buf_pa = __pa(start_addr);
|
msg->buf_pa = __pa(start_addr);
|
||||||
|
|
||||||
dev_dbg(xpnet, "sending XPC message to %d:%d\nmsg->buf_pa="
|
dev_dbg(xpnet, "sending XPC message to %d:%d\nmsg->buf_pa="
|
||||||
|
@ -477,7 +477,6 @@ for (;;) {
|
|||||||
cep->stats.rx_dropped++;
|
cep->stats.rx_dropped++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skb->dev = dev;
|
|
||||||
skb_put(skb,pkt_len-4); /* Make room */
|
skb_put(skb,pkt_len-4); /* Make room */
|
||||||
eth_copy_and_sum(skb,
|
eth_copy_and_sum(skb,
|
||||||
(unsigned char *)__va(bdp->cbd_bufaddr),
|
(unsigned char *)__va(bdp->cbd_bufaddr),
|
||||||
|
@ -734,7 +734,6 @@ for (;;) {
|
|||||||
cep->stats.rx_dropped++;
|
cep->stats.rx_dropped++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skb->dev = dev;
|
|
||||||
skb_put(skb,pkt_len); /* Make room */
|
skb_put(skb,pkt_len); /* Make room */
|
||||||
eth_copy_and_sum(skb,
|
eth_copy_and_sum(skb,
|
||||||
(unsigned char *)__va(bdp->cbd_bufaddr),
|
(unsigned char *)__va(bdp->cbd_bufaddr),
|
||||||
|
@ -506,7 +506,6 @@ for (;;) {
|
|||||||
cep->stats.rx_dropped++;
|
cep->stats.rx_dropped++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skb->dev = dev;
|
|
||||||
skb_put(skb,pkt_len-4); /* Make room */
|
skb_put(skb,pkt_len-4); /* Make room */
|
||||||
eth_copy_and_sum(skb,
|
eth_copy_and_sum(skb,
|
||||||
cep->rx_vaddr[bdp - cep->rx_bd_base],
|
cep->rx_vaddr[bdp - cep->rx_bd_base],
|
||||||
|
@ -724,7 +724,6 @@ while (!(bdp->cbd_sc & BD_ENET_RX_EMPTY)) {
|
|||||||
printk("%s: Memory squeeze, dropping packet.\n", dev->name);
|
printk("%s: Memory squeeze, dropping packet.\n", dev->name);
|
||||||
fep->stats.rx_dropped++;
|
fep->stats.rx_dropped++;
|
||||||
} else {
|
} else {
|
||||||
skb->dev = dev;
|
|
||||||
skb_put(skb,pkt_len-4); /* Make room */
|
skb_put(skb,pkt_len-4); /* Make room */
|
||||||
eth_copy_and_sum(skb, data, pkt_len-4, 0);
|
eth_copy_and_sum(skb, data, pkt_len-4, 0);
|
||||||
skb->protocol=eth_type_trans(skb,dev);
|
skb->protocol=eth_type_trans(skb,dev);
|
||||||
|
@ -108,10 +108,10 @@ static void appldata_get_net_sum_data(void *data)
|
|||||||
collisions = 0;
|
collisions = 0;
|
||||||
read_lock(&dev_base_lock);
|
read_lock(&dev_base_lock);
|
||||||
for (dev = dev_base; dev != NULL; dev = dev->next) {
|
for (dev = dev_base; dev != NULL; dev = dev->next) {
|
||||||
if (dev->get_stats == NULL) {
|
stats = dev->get_stats(dev);
|
||||||
|
if (stats == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
stats = dev->get_stats(dev);
|
|
||||||
rx_packets += stats->rx_packets;
|
rx_packets += stats->rx_packets;
|
||||||
tx_packets += stats->tx_packets;
|
tx_packets += stats->tx_packets;
|
||||||
rx_bytes += stats->rx_bytes;
|
rx_bytes += stats->rx_bytes;
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
EXTRA_AFLAGS := -traditional
|
EXTRA_AFLAGS := -traditional
|
||||||
|
|
||||||
lib-y += delay.o string.o uaccess_std.o uaccess_pt.o qrnnd.o
|
lib-y += delay.o string.o uaccess_std.o uaccess_pt.o qrnnd.o
|
||||||
lib-$(CONFIG_32BIT) += div64.o
|
obj-$(CONFIG_32BIT) += div64.o
|
||||||
lib-$(CONFIG_64BIT) += uaccess_mvcos.o
|
lib-$(CONFIG_64BIT) += uaccess_mvcos.o
|
||||||
lib-$(CONFIG_SMP) += spinlock.o
|
lib-$(CONFIG_SMP) += spinlock.o
|
||||||
|
@ -147,5 +147,3 @@ uint32_t __div64_32(uint64_t *n, uint32_t base)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MARCH_G5 */
|
#endif /* MARCH_G5 */
|
||||||
|
|
||||||
EXPORT_SYMBOL(__div64_32);
|
|
||||||
|
@ -46,7 +46,7 @@ static int daemon_read(int fd, struct sk_buff **skb,
|
|||||||
{
|
{
|
||||||
*skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
|
*skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
|
||||||
if(*skb == NULL) return(-ENOMEM);
|
if(*skb == NULL) return(-ENOMEM);
|
||||||
return(net_recvfrom(fd, (*skb)->mac.raw,
|
return(net_recvfrom(fd, skb_mac_header(*skb),
|
||||||
(*skb)->dev->mtu + ETH_HEADER_OTHER));
|
(*skb)->dev->mtu + ETH_HEADER_OTHER));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ static int mcast_read(int fd, struct sk_buff **skb, struct uml_net_private *lp)
|
|||||||
{
|
{
|
||||||
*skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
|
*skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
|
||||||
if(*skb == NULL) return(-ENOMEM);
|
if(*skb == NULL) return(-ENOMEM);
|
||||||
return(net_recvfrom(fd, (*skb)->mac.raw,
|
return(net_recvfrom(fd, skb_mac_header(*skb),
|
||||||
(*skb)->dev->mtu + ETH_HEADER_OTHER));
|
(*skb)->dev->mtu + ETH_HEADER_OTHER));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ static int uml_net_rx(struct net_device *dev)
|
|||||||
|
|
||||||
skb->dev = dev;
|
skb->dev = dev;
|
||||||
skb_put(skb, dev->mtu);
|
skb_put(skb, dev->mtu);
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
pkt_len = (*lp->read)(lp->fd, &skb, lp);
|
pkt_len = (*lp->read)(lp->fd, &skb, lp);
|
||||||
|
|
||||||
if (pkt_len > 0) {
|
if (pkt_len > 0) {
|
||||||
|
@ -36,7 +36,7 @@ static int pcap_read(int fd, struct sk_buff **skb,
|
|||||||
{
|
{
|
||||||
*skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
|
*skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
|
||||||
if(*skb == NULL) return(-ENOMEM);
|
if(*skb == NULL) return(-ENOMEM);
|
||||||
return(pcap_user_read(fd, (*skb)->mac.raw,
|
return(pcap_user_read(fd, skb_mac_header(*skb),
|
||||||
(*skb)->dev->mtu + ETH_HEADER_OTHER,
|
(*skb)->dev->mtu + ETH_HEADER_OTHER,
|
||||||
(struct pcap_data *) &lp->user));
|
(struct pcap_data *) &lp->user));
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ static unsigned short slip_protocol(struct sk_buff *skbuff)
|
|||||||
static int slip_read(int fd, struct sk_buff **skb,
|
static int slip_read(int fd, struct sk_buff **skb,
|
||||||
struct uml_net_private *lp)
|
struct uml_net_private *lp)
|
||||||
{
|
{
|
||||||
return(slip_user_read(fd, (*skb)->mac.raw, (*skb)->dev->mtu,
|
return(slip_user_read(fd, skb_mac_header(*skb), (*skb)->dev->mtu,
|
||||||
(struct slip_data *) &lp->user));
|
(struct slip_data *) &lp->user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ static unsigned short slirp_protocol(struct sk_buff *skbuff)
|
|||||||
static int slirp_read(int fd, struct sk_buff **skb,
|
static int slirp_read(int fd, struct sk_buff **skb,
|
||||||
struct uml_net_private *lp)
|
struct uml_net_private *lp)
|
||||||
{
|
{
|
||||||
return(slirp_user_read(fd, (*skb)->mac.raw, (*skb)->dev->mtu,
|
return(slirp_user_read(fd, skb_mac_header(*skb), (*skb)->dev->mtu,
|
||||||
(struct slirp_data *) &lp->user));
|
(struct slirp_data *) &lp->user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ static int etap_read(int fd, struct sk_buff **skb, struct uml_net_private *lp)
|
|||||||
|
|
||||||
*skb = ether_adjust_skb(*skb, ETH_HEADER_ETHERTAP);
|
*skb = ether_adjust_skb(*skb, ETH_HEADER_ETHERTAP);
|
||||||
if(*skb == NULL) return(-ENOMEM);
|
if(*skb == NULL) return(-ENOMEM);
|
||||||
len = net_recvfrom(fd, (*skb)->mac.raw,
|
len = net_recvfrom(fd, skb_mac_header(*skb),
|
||||||
(*skb)->dev->mtu + 2 * ETH_HEADER_ETHERTAP);
|
(*skb)->dev->mtu + 2 * ETH_HEADER_ETHERTAP);
|
||||||
if(len <= 0) return(len);
|
if(len <= 0) return(len);
|
||||||
skb_pull(*skb, 2);
|
skb_pull(*skb, 2);
|
||||||
|
@ -43,7 +43,7 @@ static int tuntap_read(int fd, struct sk_buff **skb,
|
|||||||
{
|
{
|
||||||
*skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
|
*skb = ether_adjust_skb(*skb, ETH_HEADER_OTHER);
|
||||||
if(*skb == NULL) return(-ENOMEM);
|
if(*skb == NULL) return(-ENOMEM);
|
||||||
return(net_read(fd, (*skb)->mac.raw,
|
return(net_read(fd, skb_mac_header(*skb),
|
||||||
(*skb)->dev->mtu + ETH_HEADER_OTHER));
|
(*skb)->dev->mtu + ETH_HEADER_OTHER));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ static int iss_net_rx(struct net_device *dev)
|
|||||||
/* Setup skb */
|
/* Setup skb */
|
||||||
|
|
||||||
skb->dev = dev;
|
skb->dev = dev;
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
pkt_len = lp->tp.read(lp, &skb);
|
pkt_len = lp->tp.read(lp, &skb);
|
||||||
skb_put(skb, pkt_len);
|
skb_put(skb, pkt_len);
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@ static inline void fill_rx_pool (amb_dev * dev, unsigned char pool,
|
|||||||
}
|
}
|
||||||
// cast needed as there is no %? for pointer differences
|
// cast needed as there is no %? for pointer differences
|
||||||
PRINTD (DBG_SKB, "allocated skb at %p, head %p, area %li",
|
PRINTD (DBG_SKB, "allocated skb at %p, head %p, area %li",
|
||||||
skb, skb->head, (long) (skb->end - skb->head));
|
skb, skb->head, (long) (skb_end_pointer(skb) - skb->head));
|
||||||
rx.handle = virt_to_bus (skb);
|
rx.handle = virt_to_bus (skb);
|
||||||
rx.host_address = cpu_to_be32 (virt_to_bus (skb->data));
|
rx.host_address = cpu_to_be32 (virt_to_bus (skb->data));
|
||||||
if (rx_give (dev, &rx, pool))
|
if (rx_give (dev, &rx, pool))
|
||||||
|
@ -221,7 +221,7 @@ static int atmtcp_v_send(struct atm_vcc *vcc,struct sk_buff *skb)
|
|||||||
hdr->vpi = htons(vcc->vpi);
|
hdr->vpi = htons(vcc->vpi);
|
||||||
hdr->vci = htons(vcc->vci);
|
hdr->vci = htons(vcc->vci);
|
||||||
hdr->length = htonl(skb->len);
|
hdr->length = htonl(skb->len);
|
||||||
memcpy(skb_put(new_skb,skb->len),skb->data,skb->len);
|
skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
|
||||||
if (vcc->pop) vcc->pop(vcc,skb);
|
if (vcc->pop) vcc->pop(vcc,skb);
|
||||||
else dev_kfree_skb(skb);
|
else dev_kfree_skb(skb);
|
||||||
out_vcc->push(out_vcc,new_skb);
|
out_vcc->push(out_vcc,new_skb);
|
||||||
@ -310,7 +310,7 @@ static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
__net_timestamp(new_skb);
|
__net_timestamp(new_skb);
|
||||||
memcpy(skb_put(new_skb,skb->len),skb->data,skb->len);
|
skb_copy_from_linear_data(skb, skb_put(new_skb, skb->len), skb->len);
|
||||||
out_vcc->push(out_vcc,new_skb);
|
out_vcc->push(out_vcc,new_skb);
|
||||||
atomic_inc(&vcc->stats->tx);
|
atomic_inc(&vcc->stats->tx);
|
||||||
atomic_inc(&out_vcc->stats->rx);
|
atomic_inc(&out_vcc->stats->rx);
|
||||||
@ -352,7 +352,7 @@ static struct atm_dev atmtcp_control_dev = {
|
|||||||
.ops = &atmtcp_c_dev_ops,
|
.ops = &atmtcp_c_dev_ops,
|
||||||
.type = "atmtcp",
|
.type = "atmtcp",
|
||||||
.number = 999,
|
.number = 999,
|
||||||
.lock = SPIN_LOCK_UNLOCKED
|
.lock = __SPIN_LOCK_UNLOCKED(atmtcp_control_dev.lock)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ static int rx_aal0(struct atm_vcc *vcc)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
skb_put(skb,length);
|
skb_put(skb,length);
|
||||||
skb_set_timestamp(skb, &eni_vcc->timestamp);
|
skb->tstamp = eni_vcc->timestamp;
|
||||||
DPRINTK("got len %ld\n",length);
|
DPRINTK("got len %ld\n",length);
|
||||||
if (do_rx_dma(vcc,skb,1,length >> 2,length >> 2)) return 1;
|
if (do_rx_dma(vcc,skb,1,length >> 2,length >> 2)) return 1;
|
||||||
eni_vcc->rxing++;
|
eni_vcc->rxing++;
|
||||||
@ -701,7 +701,7 @@ static void get_service(struct atm_dev *dev)
|
|||||||
DPRINTK("Grr, servicing VCC %ld twice\n",vci);
|
DPRINTK("Grr, servicing VCC %ld twice\n",vci);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
do_gettimeofday(&ENI_VCC(vcc)->timestamp);
|
ENI_VCC(vcc)->timestamp = ktime_get_real();
|
||||||
ENI_VCC(vcc)->next = NULL;
|
ENI_VCC(vcc)->next = NULL;
|
||||||
if (vcc->qos.rxtp.traffic_class == ATM_CBR) {
|
if (vcc->qos.rxtp.traffic_class == ATM_CBR) {
|
||||||
if (eni_dev->fast)
|
if (eni_dev->fast)
|
||||||
|
@ -59,7 +59,7 @@ struct eni_vcc {
|
|||||||
int rxing; /* number of pending PDUs */
|
int rxing; /* number of pending PDUs */
|
||||||
int servicing; /* number of waiting VCs (0 or 1) */
|
int servicing; /* number of waiting VCs (0 or 1) */
|
||||||
int txing; /* number of pending TX bytes */
|
int txing; /* number of pending TX bytes */
|
||||||
struct timeval timestamp; /* for RX timing */
|
ktime_t timestamp; /* for RX timing */
|
||||||
struct atm_vcc *next; /* next pending RX */
|
struct atm_vcc *next; /* next pending RX */
|
||||||
struct sk_buff *last; /* last PDU being DMAed (used to carry
|
struct sk_buff *last; /* last PDU being DMAed (used to carry
|
||||||
discard information) */
|
discard information) */
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
$Id: fore200e.c,v 1.5 2000/04/14 10:10:34 davem Exp $
|
|
||||||
|
|
||||||
A FORE Systems 200E-series driver for ATM on Linux.
|
A FORE Systems 200E-series driver for ATM on Linux.
|
||||||
Christophe Lizzi (lizzi@cnam.fr), October 1999-March 2003.
|
Christophe Lizzi (lizzi@cnam.fr), October 1999-March 2003.
|
||||||
|
|
||||||
@ -1502,9 +1500,9 @@ fore200e_open(struct atm_vcc *vcc)
|
|||||||
/* pseudo-CBR bandwidth requested? */
|
/* pseudo-CBR bandwidth requested? */
|
||||||
if ((vcc->qos.txtp.traffic_class == ATM_CBR) && (vcc->qos.txtp.max_pcr > 0)) {
|
if ((vcc->qos.txtp.traffic_class == ATM_CBR) && (vcc->qos.txtp.max_pcr > 0)) {
|
||||||
|
|
||||||
down(&fore200e->rate_sf);
|
mutex_lock(&fore200e->rate_mtx);
|
||||||
if (fore200e->available_cell_rate < vcc->qos.txtp.max_pcr) {
|
if (fore200e->available_cell_rate < vcc->qos.txtp.max_pcr) {
|
||||||
up(&fore200e->rate_sf);
|
mutex_unlock(&fore200e->rate_mtx);
|
||||||
|
|
||||||
kfree(fore200e_vcc);
|
kfree(fore200e_vcc);
|
||||||
vc_map->vcc = NULL;
|
vc_map->vcc = NULL;
|
||||||
@ -1513,7 +1511,7 @@ fore200e_open(struct atm_vcc *vcc)
|
|||||||
|
|
||||||
/* reserve bandwidth */
|
/* reserve bandwidth */
|
||||||
fore200e->available_cell_rate -= vcc->qos.txtp.max_pcr;
|
fore200e->available_cell_rate -= vcc->qos.txtp.max_pcr;
|
||||||
up(&fore200e->rate_sf);
|
mutex_unlock(&fore200e->rate_mtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
vcc->itf = vcc->dev->number;
|
vcc->itf = vcc->dev->number;
|
||||||
@ -1599,9 +1597,9 @@ fore200e_close(struct atm_vcc* vcc)
|
|||||||
/* release reserved bandwidth, if any */
|
/* release reserved bandwidth, if any */
|
||||||
if ((vcc->qos.txtp.traffic_class == ATM_CBR) && (vcc->qos.txtp.max_pcr > 0)) {
|
if ((vcc->qos.txtp.traffic_class == ATM_CBR) && (vcc->qos.txtp.max_pcr > 0)) {
|
||||||
|
|
||||||
down(&fore200e->rate_sf);
|
mutex_lock(&fore200e->rate_mtx);
|
||||||
fore200e->available_cell_rate += vcc->qos.txtp.max_pcr;
|
fore200e->available_cell_rate += vcc->qos.txtp.max_pcr;
|
||||||
up(&fore200e->rate_sf);
|
mutex_unlock(&fore200e->rate_mtx);
|
||||||
|
|
||||||
clear_bit(ATM_VF_HASQOS, &vcc->flags);
|
clear_bit(ATM_VF_HASQOS, &vcc->flags);
|
||||||
}
|
}
|
||||||
@ -2064,16 +2062,16 @@ fore200e_change_qos(struct atm_vcc* vcc,struct atm_qos* qos, int flags)
|
|||||||
|
|
||||||
if ((qos->txtp.traffic_class == ATM_CBR) && (qos->txtp.max_pcr > 0)) {
|
if ((qos->txtp.traffic_class == ATM_CBR) && (qos->txtp.max_pcr > 0)) {
|
||||||
|
|
||||||
down(&fore200e->rate_sf);
|
mutex_lock(&fore200e->rate_mtx);
|
||||||
if (fore200e->available_cell_rate + vcc->qos.txtp.max_pcr < qos->txtp.max_pcr) {
|
if (fore200e->available_cell_rate + vcc->qos.txtp.max_pcr < qos->txtp.max_pcr) {
|
||||||
up(&fore200e->rate_sf);
|
mutex_unlock(&fore200e->rate_mtx);
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
fore200e->available_cell_rate += vcc->qos.txtp.max_pcr;
|
fore200e->available_cell_rate += vcc->qos.txtp.max_pcr;
|
||||||
fore200e->available_cell_rate -= qos->txtp.max_pcr;
|
fore200e->available_cell_rate -= qos->txtp.max_pcr;
|
||||||
|
|
||||||
up(&fore200e->rate_sf);
|
mutex_unlock(&fore200e->rate_mtx);
|
||||||
|
|
||||||
memcpy(&vcc->qos, qos, sizeof(struct atm_qos));
|
memcpy(&vcc->qos, qos, sizeof(struct atm_qos));
|
||||||
|
|
||||||
@ -2459,7 +2457,7 @@ fore200e_initialize(struct fore200e* fore200e)
|
|||||||
|
|
||||||
DPRINTK(2, "device %s being initialized\n", fore200e->name);
|
DPRINTK(2, "device %s being initialized\n", fore200e->name);
|
||||||
|
|
||||||
init_MUTEX(&fore200e->rate_sf);
|
mutex_init(&fore200e->rate_mtx);
|
||||||
spin_lock_init(&fore200e->q_lock);
|
spin_lock_init(&fore200e->q_lock);
|
||||||
|
|
||||||
cpq = fore200e->cp_queues = fore200e->virt_base + FORE200E_CP_QUEUES_OFFSET;
|
cpq = fore200e->cp_queues = fore200e->virt_base + FORE200E_CP_QUEUES_OFFSET;
|
||||||
|
@ -869,7 +869,7 @@ typedef struct fore200e {
|
|||||||
|
|
||||||
struct stats* stats; /* last snapshot of the stats */
|
struct stats* stats; /* last snapshot of the stats */
|
||||||
|
|
||||||
struct semaphore rate_sf; /* protects rate reservation ops */
|
struct mutex rate_mtx; /* protects rate reservation ops */
|
||||||
spinlock_t q_lock; /* protects queue ops */
|
spinlock_t q_lock; /* protects queue ops */
|
||||||
#ifdef FORE200E_USE_TASKLET
|
#ifdef FORE200E_USE_TASKLET
|
||||||
struct tasklet_struct tx_tasklet; /* performs tx interrupt work */
|
struct tasklet_struct tx_tasklet; /* performs tx interrupt work */
|
||||||
|
@ -1901,13 +1901,13 @@ he_service_rbrq(struct he_dev *he_dev, int group)
|
|||||||
case ATM_AAL0:
|
case ATM_AAL0:
|
||||||
/* 2.10.1.5 raw cell receive */
|
/* 2.10.1.5 raw cell receive */
|
||||||
skb->len = ATM_AAL0_SDU;
|
skb->len = ATM_AAL0_SDU;
|
||||||
skb->tail = skb->data + skb->len;
|
skb_set_tail_pointer(skb, skb->len);
|
||||||
break;
|
break;
|
||||||
case ATM_AAL5:
|
case ATM_AAL5:
|
||||||
/* 2.10.1.2 aal5 receive */
|
/* 2.10.1.2 aal5 receive */
|
||||||
|
|
||||||
skb->len = AAL5_LEN(skb->data, he_vcc->pdu_len);
|
skb->len = AAL5_LEN(skb->data, he_vcc->pdu_len);
|
||||||
skb->tail = skb->data + skb->len;
|
skb_set_tail_pointer(skb, skb->len);
|
||||||
#ifdef USE_CHECKSUM_HW
|
#ifdef USE_CHECKSUM_HW
|
||||||
if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) {
|
if (vcc->vpi == 0 && vcc->vci >= ATM_NOT_RSV_VCI) {
|
||||||
skb->ip_summed = CHECKSUM_COMPLETE;
|
skb->ip_summed = CHECKSUM_COMPLETE;
|
||||||
|
@ -1065,7 +1065,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
|
|||||||
vcc = vc->rx_vcc;
|
vcc = vc->rx_vcc;
|
||||||
|
|
||||||
pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(skb),
|
pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(skb),
|
||||||
skb->end - skb->data, PCI_DMA_FROMDEVICE);
|
skb_end_pointer(skb) - skb->data,
|
||||||
|
PCI_DMA_FROMDEVICE);
|
||||||
|
|
||||||
if ((vcc->qos.aal == ATM_AAL0) ||
|
if ((vcc->qos.aal == ATM_AAL0) ||
|
||||||
(vcc->qos.aal == ATM_AAL34)) {
|
(vcc->qos.aal == ATM_AAL34)) {
|
||||||
@ -1194,7 +1195,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
|
pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
|
||||||
skb->end - skb->data, PCI_DMA_FROMDEVICE);
|
skb_end_pointer(skb) - skb->data,
|
||||||
|
PCI_DMA_FROMDEVICE);
|
||||||
sb_pool_remove(card, skb);
|
sb_pool_remove(card, skb);
|
||||||
|
|
||||||
skb_trim(skb, len);
|
skb_trim(skb, len);
|
||||||
@ -1267,7 +1269,7 @@ idt77252_rx_raw(struct idt77252_dev *card)
|
|||||||
tail = readl(SAR_REG_RAWCT);
|
tail = readl(SAR_REG_RAWCT);
|
||||||
|
|
||||||
pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue),
|
pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue),
|
||||||
queue->end - queue->head - 16,
|
skb_end_pointer(queue) - queue->head - 16,
|
||||||
PCI_DMA_FROMDEVICE);
|
PCI_DMA_FROMDEVICE);
|
||||||
|
|
||||||
while (head != tail) {
|
while (head != tail) {
|
||||||
@ -1363,7 +1365,8 @@ drop:
|
|||||||
queue = card->raw_cell_head;
|
queue = card->raw_cell_head;
|
||||||
pci_dma_sync_single_for_cpu(card->pcidev,
|
pci_dma_sync_single_for_cpu(card->pcidev,
|
||||||
IDT77252_PRV_PADDR(queue),
|
IDT77252_PRV_PADDR(queue),
|
||||||
queue->end - queue->data,
|
(skb_end_pointer(queue) -
|
||||||
|
queue->data),
|
||||||
PCI_DMA_FROMDEVICE);
|
PCI_DMA_FROMDEVICE);
|
||||||
} else {
|
} else {
|
||||||
card->raw_cell_head = NULL;
|
card->raw_cell_head = NULL;
|
||||||
@ -1816,7 +1819,8 @@ push_rx_skb(struct idt77252_dev *card, struct sk_buff *skb, int queue)
|
|||||||
u32 handle;
|
u32 handle;
|
||||||
u32 addr;
|
u32 addr;
|
||||||
|
|
||||||
skb->data = skb->tail = skb->head;
|
skb->data = skb->head;
|
||||||
|
skb_reset_tail_pointer(skb);
|
||||||
skb->len = 0;
|
skb->len = 0;
|
||||||
|
|
||||||
skb_reserve(skb, 16);
|
skb_reserve(skb, 16);
|
||||||
@ -1835,7 +1839,6 @@ push_rx_skb(struct idt77252_dev *card, struct sk_buff *skb, int queue)
|
|||||||
skb_put(skb, SAR_FB_SIZE_3);
|
skb_put(skb, SAR_FB_SIZE_3);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_kfree_skb(skb);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1874,7 +1877,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
paddr = pci_map_single(card->pcidev, skb->data,
|
paddr = pci_map_single(card->pcidev, skb->data,
|
||||||
skb->end - skb->data,
|
skb_end_pointer(skb) - skb->data,
|
||||||
PCI_DMA_FROMDEVICE);
|
PCI_DMA_FROMDEVICE);
|
||||||
IDT77252_PRV_PADDR(skb) = paddr;
|
IDT77252_PRV_PADDR(skb) = paddr;
|
||||||
|
|
||||||
@ -1888,7 +1891,7 @@ add_rx_skb(struct idt77252_dev *card, int queue,
|
|||||||
|
|
||||||
outunmap:
|
outunmap:
|
||||||
pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
|
pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
|
||||||
skb->end - skb->data, PCI_DMA_FROMDEVICE);
|
skb_end_pointer(skb) - skb->data, PCI_DMA_FROMDEVICE);
|
||||||
|
|
||||||
handle = IDT77252_PRV_POOL(skb);
|
handle = IDT77252_PRV_POOL(skb);
|
||||||
card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL;
|
card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL;
|
||||||
@ -1905,12 +1908,14 @@ recycle_rx_skb(struct idt77252_dev *card, struct sk_buff *skb)
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb),
|
pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb),
|
||||||
skb->end - skb->data, PCI_DMA_FROMDEVICE);
|
skb_end_pointer(skb) - skb->data,
|
||||||
|
PCI_DMA_FROMDEVICE);
|
||||||
|
|
||||||
err = push_rx_skb(card, skb, POOL_QUEUE(handle));
|
err = push_rx_skb(card, skb, POOL_QUEUE(handle));
|
||||||
if (err) {
|
if (err) {
|
||||||
pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
|
pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb),
|
||||||
skb->end - skb->data, PCI_DMA_FROMDEVICE);
|
skb_end_pointer(skb) - skb->data,
|
||||||
|
PCI_DMA_FROMDEVICE);
|
||||||
sb_pool_remove(card, skb);
|
sb_pool_remove(card, skb);
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
}
|
}
|
||||||
@ -3122,7 +3127,8 @@ deinit_card(struct idt77252_dev *card)
|
|||||||
if (skb) {
|
if (skb) {
|
||||||
pci_unmap_single(card->pcidev,
|
pci_unmap_single(card->pcidev,
|
||||||
IDT77252_PRV_PADDR(skb),
|
IDT77252_PRV_PADDR(skb),
|
||||||
skb->end - skb->data,
|
(skb_end_pointer(skb) -
|
||||||
|
skb->data),
|
||||||
PCI_DMA_FROMDEVICE);
|
PCI_DMA_FROMDEVICE);
|
||||||
card->sbpool[i].skb[j] = NULL;
|
card->sbpool[i].skb[j] = NULL;
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
|
@ -2208,7 +2208,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
|
|||||||
if (i == 1 && ns_rsqe_eopdu(rsqe))
|
if (i == 1 && ns_rsqe_eopdu(rsqe))
|
||||||
*((u32 *) sb->data) |= 0x00000002;
|
*((u32 *) sb->data) |= 0x00000002;
|
||||||
skb_put(sb, NS_AAL0_HEADER);
|
skb_put(sb, NS_AAL0_HEADER);
|
||||||
memcpy(sb->tail, cell, ATM_CELL_PAYLOAD);
|
memcpy(skb_tail_pointer(sb), cell, ATM_CELL_PAYLOAD);
|
||||||
skb_put(sb, ATM_CELL_PAYLOAD);
|
skb_put(sb, ATM_CELL_PAYLOAD);
|
||||||
ATM_SKB(sb)->vcc = vcc;
|
ATM_SKB(sb)->vcc = vcc;
|
||||||
__net_timestamp(sb);
|
__net_timestamp(sb);
|
||||||
@ -2252,7 +2252,8 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
|
|||||||
vc->rx_iov = iovb;
|
vc->rx_iov = iovb;
|
||||||
NS_SKB(iovb)->iovcnt = 0;
|
NS_SKB(iovb)->iovcnt = 0;
|
||||||
iovb->len = 0;
|
iovb->len = 0;
|
||||||
iovb->tail = iovb->data = iovb->head;
|
iovb->data = iovb->head;
|
||||||
|
skb_reset_tail_pointer(iovb);
|
||||||
NS_SKB(iovb)->vcc = vcc;
|
NS_SKB(iovb)->vcc = vcc;
|
||||||
/* IMPORTANT: a pointer to the sk_buff containing the small or large
|
/* IMPORTANT: a pointer to the sk_buff containing the small or large
|
||||||
buffer is stored as iovec base, NOT a pointer to the
|
buffer is stored as iovec base, NOT a pointer to the
|
||||||
@ -2265,7 +2266,8 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
|
|||||||
recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, NS_MAX_IOVECS);
|
recycle_iovec_rx_bufs(card, (struct iovec *) iovb->data, NS_MAX_IOVECS);
|
||||||
NS_SKB(iovb)->iovcnt = 0;
|
NS_SKB(iovb)->iovcnt = 0;
|
||||||
iovb->len = 0;
|
iovb->len = 0;
|
||||||
iovb->tail = iovb->data = iovb->head;
|
iovb->data = iovb->head;
|
||||||
|
skb_reset_tail_pointer(iovb);
|
||||||
NS_SKB(iovb)->vcc = vcc;
|
NS_SKB(iovb)->vcc = vcc;
|
||||||
}
|
}
|
||||||
iov = &((struct iovec *) iovb->data)[NS_SKB(iovb)->iovcnt++];
|
iov = &((struct iovec *) iovb->data)[NS_SKB(iovb)->iovcnt++];
|
||||||
@ -2393,7 +2395,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
|
|||||||
skb->destructor = ns_lb_destructor;
|
skb->destructor = ns_lb_destructor;
|
||||||
#endif /* NS_USE_DESTRUCTORS */
|
#endif /* NS_USE_DESTRUCTORS */
|
||||||
skb_push(skb, NS_SMBUFSIZE);
|
skb_push(skb, NS_SMBUFSIZE);
|
||||||
memcpy(skb->data, sb->data, NS_SMBUFSIZE);
|
skb_copy_from_linear_data(sb, skb->data, NS_SMBUFSIZE);
|
||||||
skb_put(skb, len - NS_SMBUFSIZE);
|
skb_put(skb, len - NS_SMBUFSIZE);
|
||||||
ATM_SKB(skb)->vcc = vcc;
|
ATM_SKB(skb)->vcc = vcc;
|
||||||
__net_timestamp(skb);
|
__net_timestamp(skb);
|
||||||
@ -2477,7 +2479,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
|
|||||||
{
|
{
|
||||||
/* Copy the small buffer to the huge buffer */
|
/* Copy the small buffer to the huge buffer */
|
||||||
sb = (struct sk_buff *) iov->iov_base;
|
sb = (struct sk_buff *) iov->iov_base;
|
||||||
memcpy(hb->data, sb->data, iov->iov_len);
|
skb_copy_from_linear_data(sb, hb->data, iov->iov_len);
|
||||||
skb_put(hb, iov->iov_len);
|
skb_put(hb, iov->iov_len);
|
||||||
remaining = len - iov->iov_len;
|
remaining = len - iov->iov_len;
|
||||||
iov++;
|
iov++;
|
||||||
@ -2489,7 +2491,7 @@ static void dequeue_rx(ns_dev *card, ns_rsqe *rsqe)
|
|||||||
{
|
{
|
||||||
lb = (struct sk_buff *) iov->iov_base;
|
lb = (struct sk_buff *) iov->iov_base;
|
||||||
tocopy = min_t(int, remaining, iov->iov_len);
|
tocopy = min_t(int, remaining, iov->iov_len);
|
||||||
memcpy(hb->tail, lb->data, tocopy);
|
skb_copy_from_linear_data(lb, skb_tail_pointer(hb), tocopy);
|
||||||
skb_put(hb, tocopy);
|
skb_put(hb, tocopy);
|
||||||
iov++;
|
iov++;
|
||||||
remaining -= tocopy;
|
remaining -= tocopy;
|
||||||
|
@ -48,6 +48,15 @@ struct aoe_hdr {
|
|||||||
__be32 tag;
|
__be32 tag;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __KERNEL__
|
||||||
|
#include <linux/skbuff.h>
|
||||||
|
|
||||||
|
static inline struct aoe_hdr *aoe_hdr(const struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
return (struct aoe_hdr *)skb_mac_header(skb);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct aoe_atahdr {
|
struct aoe_atahdr {
|
||||||
unsigned char aflags;
|
unsigned char aflags;
|
||||||
unsigned char errfeat;
|
unsigned char errfeat;
|
||||||
|
@ -27,7 +27,8 @@ new_skb(ulong len)
|
|||||||
|
|
||||||
skb = alloc_skb(len, GFP_ATOMIC);
|
skb = alloc_skb(len, GFP_ATOMIC);
|
||||||
if (skb) {
|
if (skb) {
|
||||||
skb->nh.raw = skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
|
skb_reset_network_header(skb);
|
||||||
skb->protocol = __constant_htons(ETH_P_AOE);
|
skb->protocol = __constant_htons(ETH_P_AOE);
|
||||||
skb->priority = 0;
|
skb->priority = 0;
|
||||||
skb->next = skb->prev = NULL;
|
skb->next = skb->prev = NULL;
|
||||||
@ -118,7 +119,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
|
|||||||
|
|
||||||
/* initialize the headers & frame */
|
/* initialize the headers & frame */
|
||||||
skb = f->skb;
|
skb = f->skb;
|
||||||
h = (struct aoe_hdr *) skb->mac.raw;
|
h = aoe_hdr(skb);
|
||||||
ah = (struct aoe_atahdr *) (h+1);
|
ah = (struct aoe_atahdr *) (h+1);
|
||||||
skb_put(skb, sizeof *h + sizeof *ah);
|
skb_put(skb, sizeof *h + sizeof *ah);
|
||||||
memset(h, 0, skb->len);
|
memset(h, 0, skb->len);
|
||||||
@ -207,7 +208,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
|
|||||||
skb->dev = ifp;
|
skb->dev = ifp;
|
||||||
if (sl_tail == NULL)
|
if (sl_tail == NULL)
|
||||||
sl_tail = skb;
|
sl_tail = skb;
|
||||||
h = (struct aoe_hdr *) skb->mac.raw;
|
h = aoe_hdr(skb);
|
||||||
memset(h, 0, sizeof *h + sizeof *ch);
|
memset(h, 0, sizeof *h + sizeof *ch);
|
||||||
|
|
||||||
memset(h->dst, 0xff, sizeof h->dst);
|
memset(h->dst, 0xff, sizeof h->dst);
|
||||||
@ -300,7 +301,7 @@ rexmit(struct aoedev *d, struct frame *f)
|
|||||||
aoechr_error(buf);
|
aoechr_error(buf);
|
||||||
|
|
||||||
skb = f->skb;
|
skb = f->skb;
|
||||||
h = (struct aoe_hdr *) skb->mac.raw;
|
h = aoe_hdr(skb);
|
||||||
ah = (struct aoe_atahdr *) (h+1);
|
ah = (struct aoe_atahdr *) (h+1);
|
||||||
f->tag = n;
|
f->tag = n;
|
||||||
h->tag = cpu_to_be32(n);
|
h->tag = cpu_to_be32(n);
|
||||||
@ -529,7 +530,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
|
|||||||
char ebuf[128];
|
char ebuf[128];
|
||||||
u16 aoemajor;
|
u16 aoemajor;
|
||||||
|
|
||||||
hin = (struct aoe_hdr *) skb->mac.raw;
|
hin = aoe_hdr(skb);
|
||||||
aoemajor = be16_to_cpu(get_unaligned(&hin->major));
|
aoemajor = be16_to_cpu(get_unaligned(&hin->major));
|
||||||
d = aoedev_by_aoeaddr(aoemajor, hin->minor);
|
d = aoedev_by_aoeaddr(aoemajor, hin->minor);
|
||||||
if (d == NULL) {
|
if (d == NULL) {
|
||||||
@ -561,7 +562,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
|
|||||||
calc_rttavg(d, tsince(f->tag));
|
calc_rttavg(d, tsince(f->tag));
|
||||||
|
|
||||||
ahin = (struct aoe_atahdr *) (hin+1);
|
ahin = (struct aoe_atahdr *) (hin+1);
|
||||||
hout = (struct aoe_hdr *) f->skb->mac.raw;
|
hout = aoe_hdr(f->skb);
|
||||||
ahout = (struct aoe_atahdr *) (hout+1);
|
ahout = (struct aoe_atahdr *) (hout+1);
|
||||||
buf = f->buf;
|
buf = f->buf;
|
||||||
|
|
||||||
@ -695,7 +696,7 @@ aoecmd_ata_id(struct aoedev *d)
|
|||||||
|
|
||||||
/* initialize the headers & frame */
|
/* initialize the headers & frame */
|
||||||
skb = f->skb;
|
skb = f->skb;
|
||||||
h = (struct aoe_hdr *) skb->mac.raw;
|
h = aoe_hdr(skb);
|
||||||
ah = (struct aoe_atahdr *) (h+1);
|
ah = (struct aoe_atahdr *) (h+1);
|
||||||
skb_put(skb, sizeof *h + sizeof *ah);
|
skb_put(skb, sizeof *h + sizeof *ah);
|
||||||
memset(h, 0, skb->len);
|
memset(h, 0, skb->len);
|
||||||
@ -726,7 +727,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
|
|||||||
enum { MAXFRAMES = 16 };
|
enum { MAXFRAMES = 16 };
|
||||||
u16 n;
|
u16 n;
|
||||||
|
|
||||||
h = (struct aoe_hdr *) skb->mac.raw;
|
h = aoe_hdr(skb);
|
||||||
ch = (struct aoe_cfghdr *) (h+1);
|
ch = (struct aoe_cfghdr *) (h+1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -123,7 +123,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
|
|||||||
goto exit;
|
goto exit;
|
||||||
skb_push(skb, ETH_HLEN); /* (1) */
|
skb_push(skb, ETH_HLEN); /* (1) */
|
||||||
|
|
||||||
h = (struct aoe_hdr *) skb->mac.raw;
|
h = aoe_hdr(skb);
|
||||||
n = be32_to_cpu(get_unaligned(&h->tag));
|
n = be32_to_cpu(get_unaligned(&h->tag));
|
||||||
if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31))
|
if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31))
|
||||||
goto exit;
|
goto exit;
|
||||||
|
@ -527,7 +527,7 @@ static int bfusb_send_frame(struct sk_buff *skb)
|
|||||||
buf[2] = (size == BFUSB_MAX_BLOCK_SIZE) ? 0 : size;
|
buf[2] = (size == BFUSB_MAX_BLOCK_SIZE) ? 0 : size;
|
||||||
|
|
||||||
memcpy(skb_put(nskb, 3), buf, 3);
|
memcpy(skb_put(nskb, 3), buf, 3);
|
||||||
memcpy(skb_put(nskb, size), skb->data + sent, size);
|
skb_copy_from_linear_data_offset(skb, sent, skb_put(nskb, size), size);
|
||||||
|
|
||||||
sent += size;
|
sent += size;
|
||||||
count -= size;
|
count -= size;
|
||||||
|
@ -461,20 +461,20 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
|
|||||||
switch (info->rx_state) {
|
switch (info->rx_state) {
|
||||||
|
|
||||||
case RECV_WAIT_EVENT_HEADER:
|
case RECV_WAIT_EVENT_HEADER:
|
||||||
eh = (struct hci_event_hdr *)(info->rx_skb->data);
|
eh = hci_event_hdr(info->rx_skb);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = eh->plen;
|
info->rx_count = eh->plen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECV_WAIT_ACL_HEADER:
|
case RECV_WAIT_ACL_HEADER:
|
||||||
ah = (struct hci_acl_hdr *)(info->rx_skb->data);
|
ah = hci_acl_hdr(info->rx_skb);
|
||||||
dlen = __le16_to_cpu(ah->dlen);
|
dlen = __le16_to_cpu(ah->dlen);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = dlen;
|
info->rx_count = dlen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECV_WAIT_SCO_HEADER:
|
case RECV_WAIT_SCO_HEADER:
|
||||||
sh = (struct hci_sco_hdr *)(info->rx_skb->data);
|
sh = hci_sco_hdr(info->rx_skb);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = sh->dlen;
|
info->rx_count = sh->dlen;
|
||||||
break;
|
break;
|
||||||
|
@ -231,7 +231,7 @@ static void bpa10x_wakeup(struct bpa10x_data *data)
|
|||||||
cr = (struct usb_ctrlrequest *) urb->setup_packet;
|
cr = (struct usb_ctrlrequest *) urb->setup_packet;
|
||||||
cr->wLength = __cpu_to_le16(skb->len);
|
cr->wLength = __cpu_to_le16(skb->len);
|
||||||
|
|
||||||
memcpy(urb->transfer_buffer, skb->data, skb->len);
|
skb_copy_from_linear_data(skb, urb->transfer_buffer, skb->len);
|
||||||
urb->transfer_buffer_length = skb->len;
|
urb->transfer_buffer_length = skb->len;
|
||||||
|
|
||||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
@ -250,7 +250,7 @@ static void bpa10x_wakeup(struct bpa10x_data *data)
|
|||||||
skb = skb_dequeue(&data->tx_queue);
|
skb = skb_dequeue(&data->tx_queue);
|
||||||
|
|
||||||
if (skb) {
|
if (skb) {
|
||||||
memcpy(urb->transfer_buffer, skb->data, skb->len);
|
skb_copy_from_linear_data(skb, urb->transfer_buffer, skb->len);
|
||||||
urb->transfer_buffer_length = skb->len;
|
urb->transfer_buffer_length = skb->len;
|
||||||
|
|
||||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
|
@ -303,20 +303,20 @@ static void bt3c_receive(bt3c_info_t *info)
|
|||||||
switch (info->rx_state) {
|
switch (info->rx_state) {
|
||||||
|
|
||||||
case RECV_WAIT_EVENT_HEADER:
|
case RECV_WAIT_EVENT_HEADER:
|
||||||
eh = (struct hci_event_hdr *)(info->rx_skb->data);
|
eh = hci_event_hdr(info->rx_skb);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = eh->plen;
|
info->rx_count = eh->plen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECV_WAIT_ACL_HEADER:
|
case RECV_WAIT_ACL_HEADER:
|
||||||
ah = (struct hci_acl_hdr *)(info->rx_skb->data);
|
ah = hci_acl_hdr(info->rx_skb);
|
||||||
dlen = __le16_to_cpu(ah->dlen);
|
dlen = __le16_to_cpu(ah->dlen);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = dlen;
|
info->rx_count = dlen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECV_WAIT_SCO_HEADER:
|
case RECV_WAIT_SCO_HEADER:
|
||||||
sh = (struct hci_sco_hdr *)(info->rx_skb->data);
|
sh = hci_sco_hdr(info->rx_skb);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = sh->dlen;
|
info->rx_count = sh->dlen;
|
||||||
break;
|
break;
|
||||||
|
@ -250,20 +250,20 @@ static void btuart_receive(btuart_info_t *info)
|
|||||||
switch (info->rx_state) {
|
switch (info->rx_state) {
|
||||||
|
|
||||||
case RECV_WAIT_EVENT_HEADER:
|
case RECV_WAIT_EVENT_HEADER:
|
||||||
eh = (struct hci_event_hdr *)(info->rx_skb->data);
|
eh = hci_event_hdr(info->rx_skb);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = eh->plen;
|
info->rx_count = eh->plen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECV_WAIT_ACL_HEADER:
|
case RECV_WAIT_ACL_HEADER:
|
||||||
ah = (struct hci_acl_hdr *)(info->rx_skb->data);
|
ah = hci_acl_hdr(info->rx_skb);
|
||||||
dlen = __le16_to_cpu(ah->dlen);
|
dlen = __le16_to_cpu(ah->dlen);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = dlen;
|
info->rx_count = dlen;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RECV_WAIT_SCO_HEADER:
|
case RECV_WAIT_SCO_HEADER:
|
||||||
sh = (struct hci_sco_hdr *)(info->rx_skb->data);
|
sh = hci_sco_hdr(info->rx_skb);
|
||||||
info->rx_state = RECV_WAIT_DATA;
|
info->rx_state = RECV_WAIT_DATA;
|
||||||
info->rx_count = sh->dlen;
|
info->rx_count = sh->dlen;
|
||||||
break;
|
break;
|
||||||
|
@ -425,7 +425,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
skb_reserve(s, NSHL);
|
skb_reserve(s, NSHL);
|
||||||
memcpy(skb_put(s, skb->len), skb->data, skb->len);
|
skb_copy_from_linear_data(skb, skb_put(s, skb->len), skb->len);
|
||||||
if (skb->len & 0x0001)
|
if (skb->len & 0x0001)
|
||||||
*skb_put(s, 1) = 0; /* PAD */
|
*skb_put(s, 1) = 0; /* PAD */
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case H4_W4_EVENT_HDR:
|
case H4_W4_EVENT_HDR:
|
||||||
eh = (struct hci_event_hdr *) h4->rx_skb->data;
|
eh = hci_event_hdr(h4->rx_skb);
|
||||||
|
|
||||||
BT_DBG("Event header: evt 0x%2.2x plen %d", eh->evt, eh->plen);
|
BT_DBG("Event header: evt 0x%2.2x plen %d", eh->evt, eh->plen);
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case H4_W4_ACL_HDR:
|
case H4_W4_ACL_HDR:
|
||||||
ah = (struct hci_acl_hdr *) h4->rx_skb->data;
|
ah = hci_acl_hdr(h4->rx_skb);
|
||||||
dlen = __le16_to_cpu(ah->dlen);
|
dlen = __le16_to_cpu(ah->dlen);
|
||||||
|
|
||||||
BT_DBG("ACL header: dlen %d", dlen);
|
BT_DBG("ACL header: dlen %d", dlen);
|
||||||
@ -205,7 +205,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case H4_W4_SCO_HDR:
|
case H4_W4_SCO_HDR:
|
||||||
sh = (struct hci_sco_hdr *) h4->rx_skb->data;
|
sh = hci_sco_hdr(h4->rx_skb);
|
||||||
|
|
||||||
BT_DBG("SCO header: dlen %d", sh->dlen);
|
BT_DBG("SCO header: dlen %d", sh->dlen);
|
||||||
|
|
||||||
|
@ -4169,7 +4169,7 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
netif_stop_queue(dev);
|
netif_stop_queue(dev);
|
||||||
|
|
||||||
/* copy data to device buffers */
|
/* copy data to device buffers */
|
||||||
memcpy(info->tx_buf, skb->data, skb->len);
|
skb_copy_from_linear_data(skb, info->tx_buf, skb->len);
|
||||||
info->tx_get = 0;
|
info->tx_get = 0;
|
||||||
info->tx_put = info->tx_count = skb->len;
|
info->tx_put = info->tx_count = skb->len;
|
||||||
|
|
||||||
|
@ -881,15 +881,15 @@ EXPORT_SYMBOL(get_random_bytes);
|
|||||||
*/
|
*/
|
||||||
static void init_std_data(struct entropy_store *r)
|
static void init_std_data(struct entropy_store *r)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
ktime_t now;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock_irqsave(&r->lock, flags);
|
spin_lock_irqsave(&r->lock, flags);
|
||||||
r->entropy_count = 0;
|
r->entropy_count = 0;
|
||||||
spin_unlock_irqrestore(&r->lock, flags);
|
spin_unlock_irqrestore(&r->lock, flags);
|
||||||
|
|
||||||
do_gettimeofday(&tv);
|
now = ktime_get_real();
|
||||||
add_entropy_words(r, (__u32 *)&tv, sizeof(tv)/4);
|
add_entropy_words(r, (__u32 *)&now, sizeof(now)/4);
|
||||||
add_entropy_words(r, (__u32 *)utsname(),
|
add_entropy_words(r, (__u32 *)utsname(),
|
||||||
sizeof(*(utsname()))/4);
|
sizeof(*(utsname()))/4);
|
||||||
}
|
}
|
||||||
@ -911,14 +911,12 @@ void rand_initialize_irq(int irq)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If kmalloc returns null, we just won't use that entropy
|
* If kzalloc returns null, we just won't use that entropy
|
||||||
* source.
|
* source.
|
||||||
*/
|
*/
|
||||||
state = kmalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
|
state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
|
||||||
if (state) {
|
if (state)
|
||||||
memset(state, 0, sizeof(struct timer_rand_state));
|
|
||||||
irq_timer_state[irq] = state;
|
irq_timer_state[irq] = state;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_BLOCK
|
#ifdef CONFIG_BLOCK
|
||||||
@ -927,14 +925,12 @@ void rand_initialize_disk(struct gendisk *disk)
|
|||||||
struct timer_rand_state *state;
|
struct timer_rand_state *state;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If kmalloc returns null, we just won't use that entropy
|
* If kzalloc returns null, we just won't use that entropy
|
||||||
* source.
|
* source.
|
||||||
*/
|
*/
|
||||||
state = kmalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
|
state = kzalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
|
||||||
if (state) {
|
if (state)
|
||||||
memset(state, 0, sizeof(struct timer_rand_state));
|
|
||||||
disk->random = state;
|
disk->random = state;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1469,7 +1465,6 @@ late_initcall(seqgen_init);
|
|||||||
__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
|
__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
|
||||||
__be16 sport, __be16 dport)
|
__be16 sport, __be16 dport)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
|
||||||
__u32 seq;
|
__u32 seq;
|
||||||
__u32 hash[12];
|
__u32 hash[12];
|
||||||
struct keydata *keyptr = get_keyptr();
|
struct keydata *keyptr = get_keyptr();
|
||||||
@ -1485,8 +1480,7 @@ __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
|
|||||||
seq = twothirdsMD4Transform((const __u32 *)daddr, hash) & HASH_MASK;
|
seq = twothirdsMD4Transform((const __u32 *)daddr, hash) & HASH_MASK;
|
||||||
seq += keyptr->count;
|
seq += keyptr->count;
|
||||||
|
|
||||||
do_gettimeofday(&tv);
|
seq += ktime_get_real().tv64;
|
||||||
seq += tv.tv_usec + tv.tv_sec * 1000000;
|
|
||||||
|
|
||||||
return seq;
|
return seq;
|
||||||
}
|
}
|
||||||
@ -1521,7 +1515,6 @@ __u32 secure_ip_id(__be32 daddr)
|
|||||||
__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
|
__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
|
||||||
__be16 sport, __be16 dport)
|
__be16 sport, __be16 dport)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
|
||||||
__u32 seq;
|
__u32 seq;
|
||||||
__u32 hash[4];
|
__u32 hash[4];
|
||||||
struct keydata *keyptr = get_keyptr();
|
struct keydata *keyptr = get_keyptr();
|
||||||
@ -1543,12 +1536,11 @@ __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
|
|||||||
* As close as possible to RFC 793, which
|
* As close as possible to RFC 793, which
|
||||||
* suggests using a 250 kHz clock.
|
* suggests using a 250 kHz clock.
|
||||||
* Further reading shows this assumes 2 Mb/s networks.
|
* Further reading shows this assumes 2 Mb/s networks.
|
||||||
* For 10 Mb/s Ethernet, a 1 MHz clock is appropriate.
|
* For 10 Gb/s Ethernet, a 1 GHz clock is appropriate.
|
||||||
* That's funny, Linux has one built in! Use it!
|
* That's funny, Linux has one built in! Use it!
|
||||||
* (Networks are faster now - should this be increased?)
|
* (Networks are faster now - should this be increased?)
|
||||||
*/
|
*/
|
||||||
do_gettimeofday(&tv);
|
seq += ktime_get_real().tv64;
|
||||||
seq += tv.tv_usec + tv.tv_sec * 1000000;
|
|
||||||
#if 0
|
#if 0
|
||||||
printk("init_seq(%lx, %lx, %d, %d) = %d\n",
|
printk("init_seq(%lx, %lx, %d, %d) = %d\n",
|
||||||
saddr, daddr, sport, dport, seq);
|
saddr, daddr, sport, dport, seq);
|
||||||
@ -1556,8 +1548,6 @@ __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
|
|||||||
return seq;
|
return seq;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(secure_tcp_sequence_number);
|
|
||||||
|
|
||||||
/* Generate secure starting point for ephemeral IPV4 transport port search */
|
/* Generate secure starting point for ephemeral IPV4 transport port search */
|
||||||
u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)
|
u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)
|
||||||
{
|
{
|
||||||
@ -1598,7 +1588,6 @@ u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, __be16
|
|||||||
u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
|
u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
|
||||||
__be16 sport, __be16 dport)
|
__be16 sport, __be16 dport)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
|
||||||
u64 seq;
|
u64 seq;
|
||||||
__u32 hash[4];
|
__u32 hash[4];
|
||||||
struct keydata *keyptr = get_keyptr();
|
struct keydata *keyptr = get_keyptr();
|
||||||
@ -1611,8 +1600,7 @@ u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
|
|||||||
seq = half_md4_transform(hash, keyptr->secret);
|
seq = half_md4_transform(hash, keyptr->secret);
|
||||||
seq |= ((u64)keyptr->count) << (32 - HASH_BITS);
|
seq |= ((u64)keyptr->count) << (32 - HASH_BITS);
|
||||||
|
|
||||||
do_gettimeofday(&tv);
|
seq += ktime_get_real().tv64;
|
||||||
seq += tv.tv_usec + tv.tv_sec * 1000000;
|
|
||||||
seq &= (1ull << 48) - 1;
|
seq &= (1ull << 48) - 1;
|
||||||
#if 0
|
#if 0
|
||||||
printk("dccp init_seq(%lx, %lx, %d, %d) = %d\n",
|
printk("dccp init_seq(%lx, %lx, %d, %d) = %d\n",
|
||||||
|
@ -212,7 +212,7 @@ static void cn_rx_skb(struct sk_buff *__skb)
|
|||||||
skb = skb_get(__skb);
|
skb = skb_get(__skb);
|
||||||
|
|
||||||
if (skb->len >= NLMSG_SPACE(0)) {
|
if (skb->len >= NLMSG_SPACE(0)) {
|
||||||
nlh = (struct nlmsghdr *)skb->data;
|
nlh = nlmsg_hdr(skb);
|
||||||
|
|
||||||
if (nlh->nlmsg_len < sizeof(struct cn_msg) ||
|
if (nlh->nlmsg_len < sizeof(struct cn_msg) ||
|
||||||
skb->len < nlh->nlmsg_len ||
|
skb->len < nlh->nlmsg_len ||
|
||||||
@ -448,7 +448,7 @@ static int __devinit cn_init(void)
|
|||||||
|
|
||||||
dev->nls = netlink_kernel_create(NETLINK_CONNECTOR,
|
dev->nls = netlink_kernel_create(NETLINK_CONNECTOR,
|
||||||
CN_NETLINK_USERS + 0xf,
|
CN_NETLINK_USERS + 0xf,
|
||||||
dev->input, THIS_MODULE);
|
dev->input, NULL, THIS_MODULE);
|
||||||
if (!dev->nls)
|
if (!dev->nls)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
|
@ -834,7 +834,7 @@ static inline u16 ether1394_type_trans(struct sk_buff *skb,
|
|||||||
struct eth1394hdr *eth;
|
struct eth1394hdr *eth;
|
||||||
unsigned char *rawp;
|
unsigned char *rawp;
|
||||||
|
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull (skb, ETH1394_HLEN);
|
skb_pull (skb, ETH1394_HLEN);
|
||||||
eth = eth1394_hdr(skb);
|
eth = eth1394_hdr(skb);
|
||||||
|
|
||||||
@ -1668,7 +1668,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
|
|||||||
if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
|
if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
|
||||||
proto == htons(ETH_P_ARP) ||
|
proto == htons(ETH_P_ARP) ||
|
||||||
(proto == htons(ETH_P_IP) &&
|
(proto == htons(ETH_P_IP) &&
|
||||||
IN_MULTICAST(ntohl(skb->nh.iph->daddr)))) {
|
IN_MULTICAST(ntohl(ip_hdr(skb)->daddr)))) {
|
||||||
tx_type = ETH1394_GASP;
|
tx_type = ETH1394_GASP;
|
||||||
dest_node = LOCAL_BUS | ALL_NODES;
|
dest_node = LOCAL_BUS | ALL_NODES;
|
||||||
max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD;
|
max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD;
|
||||||
|
@ -90,7 +90,7 @@ struct eth1394hdr {
|
|||||||
|
|
||||||
static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb)
|
static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
return (struct eth1394hdr *)skb->mac.raw;
|
return (struct eth1394hdr *)skb_mac_header(skb);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -439,7 +439,8 @@ static void c2_rx_error(struct c2_port *c2_port, struct c2_element *elem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Setup the skb for reuse since we're dropping this pkt */
|
/* Setup the skb for reuse since we're dropping this pkt */
|
||||||
elem->skb->tail = elem->skb->data = elem->skb->head;
|
elem->skb->data = elem->skb->head;
|
||||||
|
skb_reset_tail_pointer(elem->skb);
|
||||||
|
|
||||||
/* Zero out the rxp hdr in the sk_buff */
|
/* Zero out the rxp hdr in the sk_buff */
|
||||||
memset(elem->skb->data, 0, sizeof(*rxp_hdr));
|
memset(elem->skb->data, 0, sizeof(*rxp_hdr));
|
||||||
@ -521,9 +522,8 @@ static void c2_rx_interrupt(struct net_device *netdev)
|
|||||||
* "sizeof(struct c2_rxp_hdr)".
|
* "sizeof(struct c2_rxp_hdr)".
|
||||||
*/
|
*/
|
||||||
skb->data += sizeof(*rxp_hdr);
|
skb->data += sizeof(*rxp_hdr);
|
||||||
skb->tail = skb->data + buflen;
|
skb_set_tail_pointer(skb, buflen);
|
||||||
skb->len = buflen;
|
skb->len = buflen;
|
||||||
skb->dev = netdev;
|
|
||||||
skb->protocol = eth_type_trans(skb, netdev);
|
skb->protocol = eth_type_trans(skb, netdev);
|
||||||
|
|
||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
|
@ -477,7 +477,7 @@ static void send_mpa_req(struct iwch_ep *ep, struct sk_buff *skb)
|
|||||||
BUG_ON(skb_cloned(skb));
|
BUG_ON(skb_cloned(skb));
|
||||||
|
|
||||||
mpalen = sizeof(*mpa) + ep->plen;
|
mpalen = sizeof(*mpa) + ep->plen;
|
||||||
if (skb->data + mpalen + sizeof(*req) > skb->end) {
|
if (skb->data + mpalen + sizeof(*req) > skb_end_pointer(skb)) {
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
skb=alloc_skb(mpalen + sizeof(*req), GFP_KERNEL);
|
skb=alloc_skb(mpalen + sizeof(*req), GFP_KERNEL);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
@ -507,7 +507,7 @@ static void send_mpa_req(struct iwch_ep *ep, struct sk_buff *skb)
|
|||||||
*/
|
*/
|
||||||
skb_get(skb);
|
skb_get(skb);
|
||||||
set_arp_failure_handler(skb, arp_failure_discard);
|
set_arp_failure_handler(skb, arp_failure_discard);
|
||||||
skb->h.raw = skb->data;
|
skb_reset_transport_header(skb);
|
||||||
len = skb->len;
|
len = skb->len;
|
||||||
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
||||||
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
||||||
@ -559,7 +559,7 @@ static int send_mpa_reject(struct iwch_ep *ep, const void *pdata, u8 plen)
|
|||||||
skb_get(skb);
|
skb_get(skb);
|
||||||
skb->priority = CPL_PRIORITY_DATA;
|
skb->priority = CPL_PRIORITY_DATA;
|
||||||
set_arp_failure_handler(skb, arp_failure_discard);
|
set_arp_failure_handler(skb, arp_failure_discard);
|
||||||
skb->h.raw = skb->data;
|
skb_reset_transport_header(skb);
|
||||||
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
||||||
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
||||||
req->wr_lo = htonl(V_WR_TID(ep->hwtid));
|
req->wr_lo = htonl(V_WR_TID(ep->hwtid));
|
||||||
@ -610,7 +610,7 @@ static int send_mpa_reply(struct iwch_ep *ep, const void *pdata, u8 plen)
|
|||||||
*/
|
*/
|
||||||
skb_get(skb);
|
skb_get(skb);
|
||||||
set_arp_failure_handler(skb, arp_failure_discard);
|
set_arp_failure_handler(skb, arp_failure_discard);
|
||||||
skb->h.raw = skb->data;
|
skb_reset_transport_header(skb);
|
||||||
len = skb->len;
|
len = skb->len;
|
||||||
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
req = (struct tx_data_wr *) skb_push(skb, sizeof(*req));
|
||||||
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
|
||||||
@ -821,7 +821,8 @@ static void process_mpa_reply(struct iwch_ep *ep, struct sk_buff *skb)
|
|||||||
/*
|
/*
|
||||||
* copy the new data into our accumulation buffer.
|
* copy the new data into our accumulation buffer.
|
||||||
*/
|
*/
|
||||||
memcpy(&(ep->mpa_pkt[ep->mpa_pkt_len]), skb->data, skb->len);
|
skb_copy_from_linear_data(skb, &(ep->mpa_pkt[ep->mpa_pkt_len]),
|
||||||
|
skb->len);
|
||||||
ep->mpa_pkt_len += skb->len;
|
ep->mpa_pkt_len += skb->len;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -940,7 +941,8 @@ static void process_mpa_request(struct iwch_ep *ep, struct sk_buff *skb)
|
|||||||
/*
|
/*
|
||||||
* Copy the new data into our accumulation buffer.
|
* Copy the new data into our accumulation buffer.
|
||||||
*/
|
*/
|
||||||
memcpy(&(ep->mpa_pkt[ep->mpa_pkt_len]), skb->data, skb->len);
|
skb_copy_from_linear_data(skb, &(ep->mpa_pkt[ep->mpa_pkt_len]),
|
||||||
|
skb->len);
|
||||||
ep->mpa_pkt_len += skb->len;
|
ep->mpa_pkt_len += skb->len;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1619,7 +1621,8 @@ static int terminate(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
|
|||||||
PDBG("%s ep %p\n", __FUNCTION__, ep);
|
PDBG("%s ep %p\n", __FUNCTION__, ep);
|
||||||
skb_pull(skb, sizeof(struct cpl_rdma_terminate));
|
skb_pull(skb, sizeof(struct cpl_rdma_terminate));
|
||||||
PDBG("%s saving %d bytes of term msg\n", __FUNCTION__, skb->len);
|
PDBG("%s saving %d bytes of term msg\n", __FUNCTION__, skb->len);
|
||||||
memcpy(ep->com.qp->attr.terminate_buffer, skb->data, skb->len);
|
skb_copy_from_linear_data(skb, ep->com.qp->attr.terminate_buffer,
|
||||||
|
skb->len);
|
||||||
ep->com.qp->attr.terminate_msg_len = skb->len;
|
ep->com.qp->attr.terminate_msg_len = skb->len;
|
||||||
ep->com.qp->attr.is_terminate_local = 0;
|
ep->com.qp->attr.is_terminate_local = 0;
|
||||||
return CPL_RET_BUF_DONE;
|
return CPL_RET_BUF_DONE;
|
||||||
|
@ -408,7 +408,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
|
|||||||
skb_put_frags(skb, IPOIB_CM_HEAD_SIZE, wc->byte_len, newskb);
|
skb_put_frags(skb, IPOIB_CM_HEAD_SIZE, wc->byte_len, newskb);
|
||||||
|
|
||||||
skb->protocol = ((struct ipoib_header *) skb->data)->proto;
|
skb->protocol = ((struct ipoib_header *) skb->data)->proto;
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb, IPOIB_ENCAP_LEN);
|
skb_pull(skb, IPOIB_ENCAP_LEN);
|
||||||
|
|
||||||
dev->last_rx = jiffies;
|
dev->last_rx = jiffies;
|
||||||
|
@ -216,7 +216,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
|
|||||||
if (wc->slid != priv->local_lid ||
|
if (wc->slid != priv->local_lid ||
|
||||||
wc->src_qp != priv->qp->qp_num) {
|
wc->src_qp != priv->qp->qp_num) {
|
||||||
skb->protocol = ((struct ipoib_header *) skb->data)->proto;
|
skb->protocol = ((struct ipoib_header *) skb->data)->proto;
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb, IPOIB_ENCAP_LEN);
|
skb_pull(skb, IPOIB_ENCAP_LEN);
|
||||||
|
|
||||||
dev->last_rx = jiffies;
|
dev->last_rx = jiffies;
|
||||||
|
@ -442,7 +442,7 @@ act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
skb_reserve(xmit_skb, 19);
|
skb_reserve(xmit_skb, 19);
|
||||||
memcpy(skb_put(xmit_skb, len), skb->data, len);
|
skb_copy_from_linear_data(skb, skb_put(xmit_skb, len), len);
|
||||||
} else {
|
} else {
|
||||||
xmit_skb = skb_clone(skb, GFP_ATOMIC);
|
xmit_skb = skb_clone(skb, GFP_ATOMIC);
|
||||||
if (!xmit_skb) {
|
if (!xmit_skb) {
|
||||||
|
@ -652,7 +652,7 @@ static int write_modem(struct cardstate *cs)
|
|||||||
* transmit data
|
* transmit data
|
||||||
*/
|
*/
|
||||||
count = min(bcs->tx_skb->len, (unsigned) ucs->bulk_out_size);
|
count = min(bcs->tx_skb->len, (unsigned) ucs->bulk_out_size);
|
||||||
memcpy(ucs->bulk_out_buffer, bcs->tx_skb->data, count);
|
skb_copy_from_linear_data(bcs->tx_skb, ucs->bulk_out_buffer, count);
|
||||||
skb_pull(bcs->tx_skb, count);
|
skb_pull(bcs->tx_skb, count);
|
||||||
atomic_set(&ucs->busy, 1);
|
atomic_set(&ucs->busy, 1);
|
||||||
gig_dbg(DEBUG_OUTPUT, "write_modem: send %d bytes", count);
|
gig_dbg(DEBUG_OUTPUT, "write_modem: send %d bytes", count);
|
||||||
|
@ -404,7 +404,8 @@ static void b1dma_dispatch_tx(avmcard *card)
|
|||||||
printk(KERN_DEBUG "tx: put 0x%x len=%d\n",
|
printk(KERN_DEBUG "tx: put 0x%x len=%d\n",
|
||||||
skb->data[2], txlen);
|
skb->data[2], txlen);
|
||||||
#endif
|
#endif
|
||||||
memcpy(dma->sendbuf.dmabuf, skb->data+2, skb->len-2);
|
skb_copy_from_linear_data_offset(skb, 2, dma->sendbuf.dmabuf,
|
||||||
|
skb->len - 2);
|
||||||
}
|
}
|
||||||
txlen = (txlen + 3) & ~3;
|
txlen = (txlen + 3) & ~3;
|
||||||
|
|
||||||
|
@ -457,7 +457,8 @@ static void c4_dispatch_tx(avmcard *card)
|
|||||||
printk(KERN_DEBUG "%s: tx put 0x%x len=%d\n",
|
printk(KERN_DEBUG "%s: tx put 0x%x len=%d\n",
|
||||||
card->name, skb->data[2], txlen);
|
card->name, skb->data[2], txlen);
|
||||||
#endif
|
#endif
|
||||||
memcpy(dma->sendbuf.dmabuf, skb->data+2, skb->len-2);
|
skb_copy_from_linear_data_offset(skb, 2, dma->sendbuf.dmabuf,
|
||||||
|
skb->len - 2);
|
||||||
}
|
}
|
||||||
txlen = (txlen + 3) & ~3;
|
txlen = (txlen + 3) & ~3;
|
||||||
|
|
||||||
|
@ -254,14 +254,16 @@ write_modem(struct BCState *bcs) {
|
|||||||
count = len;
|
count = len;
|
||||||
if (count > MAX_MODEM_BUF - fp) {
|
if (count > MAX_MODEM_BUF - fp) {
|
||||||
count = MAX_MODEM_BUF - fp;
|
count = MAX_MODEM_BUF - fp;
|
||||||
memcpy(cs->hw.elsa.transbuf + fp, bcs->tx_skb->data, count);
|
skb_copy_from_linear_data(bcs->tx_skb,
|
||||||
|
cs->hw.elsa.transbuf + fp, count);
|
||||||
skb_pull(bcs->tx_skb, count);
|
skb_pull(bcs->tx_skb, count);
|
||||||
cs->hw.elsa.transcnt += count;
|
cs->hw.elsa.transcnt += count;
|
||||||
ret = count;
|
ret = count;
|
||||||
count = len - count;
|
count = len - count;
|
||||||
fp = 0;
|
fp = 0;
|
||||||
}
|
}
|
||||||
memcpy((cs->hw.elsa.transbuf + fp), bcs->tx_skb->data, count);
|
skb_copy_from_linear_data(bcs->tx_skb,
|
||||||
|
cs->hw.elsa.transbuf + fp, count);
|
||||||
skb_pull(bcs->tx_skb, count);
|
skb_pull(bcs->tx_skb, count);
|
||||||
cs->hw.elsa.transcnt += count;
|
cs->hw.elsa.transcnt += count;
|
||||||
ret += count;
|
ret += count;
|
||||||
|
@ -1293,7 +1293,8 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
|
|||||||
oskb = skb;
|
oskb = skb;
|
||||||
skb = alloc_skb(oskb->len + i, GFP_ATOMIC);
|
skb = alloc_skb(oskb->len + i, GFP_ATOMIC);
|
||||||
memcpy(skb_put(skb, i), header, i);
|
memcpy(skb_put(skb, i), header, i);
|
||||||
memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len);
|
skb_copy_from_linear_data(oskb,
|
||||||
|
skb_put(skb, oskb->len), oskb->len);
|
||||||
dev_kfree_skb(oskb);
|
dev_kfree_skb(oskb);
|
||||||
}
|
}
|
||||||
st->l2.l2l1(st, PH_PULL | INDICATION, skb);
|
st->l2.l2l1(st, PH_PULL | INDICATION, skb);
|
||||||
|
@ -398,8 +398,9 @@ static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb)
|
|||||||
_len = CAPIMSG_LEN(skb->data);
|
_len = CAPIMSG_LEN(skb->data);
|
||||||
if (_len > 22) {
|
if (_len > 22) {
|
||||||
_len2 = _len - 22;
|
_len2 = _len - 22;
|
||||||
memcpy(msghead, skb->data, 22);
|
skb_copy_from_linear_data(skb, msghead, 22);
|
||||||
memcpy(skb->data + _len2, msghead, 22);
|
skb_copy_to_linear_data_offset(skb, _len2,
|
||||||
|
msghead, 22);
|
||||||
skb_pull(skb, _len2);
|
skb_pull(skb, _len2);
|
||||||
CAPIMSG_SETLEN(skb->data, 22);
|
CAPIMSG_SETLEN(skb->data, 22);
|
||||||
retval = capilib_data_b3_req(&cinfo->ncci_head,
|
retval = capilib_data_b3_req(&cinfo->ncci_head,
|
||||||
|
@ -214,8 +214,6 @@ hysdn_rx_netpkt(hysdn_card * card, unsigned char *buf, unsigned short len)
|
|||||||
lp->stats.rx_dropped++;
|
lp->stats.rx_dropped++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
skb->dev = &lp->netdev;
|
|
||||||
|
|
||||||
/* copy the data */
|
/* copy the data */
|
||||||
memcpy(skb_put(skb, len), buf, len);
|
memcpy(skb_put(skb, len), buf, len);
|
||||||
|
|
||||||
|
@ -113,7 +113,8 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf,
|
|||||||
(skb = hysdn_tx_netget(card)) != NULL)
|
(skb = hysdn_tx_netget(card)) != NULL)
|
||||||
{
|
{
|
||||||
if (skb->len <= maxlen) {
|
if (skb->len <= maxlen) {
|
||||||
memcpy(buf, skb->data, skb->len); /* copy the packet to the buffer */
|
/* copy the packet to the buffer */
|
||||||
|
skb_copy_from_linear_data(skb, buf, skb->len);
|
||||||
*len = skb->len;
|
*len = skb->len;
|
||||||
*chan = CHAN_NDIS_DATA;
|
*chan = CHAN_NDIS_DATA;
|
||||||
card->net_tx_busy = 1; /* we are busy sending network data */
|
card->net_tx_busy = 1; /* we are busy sending network data */
|
||||||
@ -126,7 +127,7 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf,
|
|||||||
((skb = hycapi_tx_capiget(card)) != NULL) )
|
((skb = hycapi_tx_capiget(card)) != NULL) )
|
||||||
{
|
{
|
||||||
if (skb->len <= maxlen) {
|
if (skb->len <= maxlen) {
|
||||||
memcpy(buf, skb->data, skb->len);
|
skb_copy_from_linear_data(skb, buf, skb->len);
|
||||||
*len = skb->len;
|
*len = skb->len;
|
||||||
*chan = CHAN_CAPI;
|
*chan = CHAN_CAPI;
|
||||||
hycapi_tx_capiack(card);
|
hycapi_tx_capiack(card);
|
||||||
|
@ -829,7 +829,7 @@ isdn_readbchan(int di, int channel, u_char * buf, u_char * fp, int len, wait_que
|
|||||||
dflag = 0;
|
dflag = 0;
|
||||||
}
|
}
|
||||||
count_put = count_pull;
|
count_put = count_pull;
|
||||||
memcpy(cp, skb->data, count_put);
|
skb_copy_from_linear_data(skb, cp, count_put);
|
||||||
cp += count_put;
|
cp += count_put;
|
||||||
len -= count_put;
|
len -= count_put;
|
||||||
#ifdef CONFIG_ISDN_AUDIO
|
#ifdef CONFIG_ISDN_AUDIO
|
||||||
|
@ -872,7 +872,8 @@ typedef struct {
|
|||||||
static void
|
static void
|
||||||
isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
|
isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
|
||||||
{
|
{
|
||||||
u_char *p = skb->nh.raw; /* hopefully, this was set correctly */
|
/* hopefully, this was set correctly */
|
||||||
|
const u_char *p = skb_network_header(skb);
|
||||||
unsigned short proto = ntohs(skb->protocol);
|
unsigned short proto = ntohs(skb->protocol);
|
||||||
int data_ofs;
|
int data_ofs;
|
||||||
ip_ports *ipp;
|
ip_ports *ipp;
|
||||||
@ -880,7 +881,7 @@ isdn_net_log_skb(struct sk_buff * skb, isdn_net_local * lp)
|
|||||||
|
|
||||||
addinfo[0] = '\0';
|
addinfo[0] = '\0';
|
||||||
/* This check stolen from 2.1.72 dev_queue_xmit_nit() */
|
/* This check stolen from 2.1.72 dev_queue_xmit_nit() */
|
||||||
if (skb->nh.raw < skb->data || skb->nh.raw >= skb->tail) {
|
if (p < skb->data || skb->network_header >= skb->tail) {
|
||||||
/* fall back to old isdn_net_log_packet method() */
|
/* fall back to old isdn_net_log_packet method() */
|
||||||
char * buf = skb->data;
|
char * buf = skb->data;
|
||||||
|
|
||||||
@ -1121,7 +1122,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
|
|||||||
if (!skb)
|
if (!skb)
|
||||||
return;
|
return;
|
||||||
if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
|
if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
|
||||||
int pullsize = (ulong)skb->nh.raw - (ulong)skb->data - ETH_HLEN;
|
const int pullsize = skb_network_offset(skb) - ETH_HLEN;
|
||||||
if (pullsize > 0) {
|
if (pullsize > 0) {
|
||||||
printk(KERN_DEBUG "isdn_net: Pull junk %d\n", pullsize);
|
printk(KERN_DEBUG "isdn_net: Pull junk %d\n", pullsize);
|
||||||
skb_pull(skb, pullsize);
|
skb_pull(skb, pullsize);
|
||||||
@ -1366,7 +1367,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
|
|||||||
struct ethhdr *eth;
|
struct ethhdr *eth;
|
||||||
unsigned char *rawp;
|
unsigned char *rawp;
|
||||||
|
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb, ETH_HLEN);
|
skb_pull(skb, ETH_HLEN);
|
||||||
eth = eth_hdr(skb);
|
eth = eth_hdr(skb);
|
||||||
|
|
||||||
@ -1786,7 +1787,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
|
|||||||
}
|
}
|
||||||
skb->dev = ndev;
|
skb->dev = ndev;
|
||||||
skb->pkt_type = PACKET_HOST;
|
skb->pkt_type = PACKET_HOST;
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
#ifdef ISDN_DEBUG_NET_DUMP
|
#ifdef ISDN_DEBUG_NET_DUMP
|
||||||
isdn_dumppkt("R:", skb->data, skb->len, 40);
|
isdn_dumppkt("R:", skb->data, skb->len, 40);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1100,7 +1100,8 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||||||
goto drop_packet;
|
goto drop_packet;
|
||||||
}
|
}
|
||||||
skb_put(skb, skb_old->len + 128);
|
skb_put(skb, skb_old->len + 128);
|
||||||
memcpy(skb->data, skb_old->data, skb_old->len);
|
skb_copy_from_linear_data(skb_old, skb->data,
|
||||||
|
skb_old->len);
|
||||||
if (net_dev->local->ppp_slot < 0) {
|
if (net_dev->local->ppp_slot < 0) {
|
||||||
printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
|
printk(KERN_ERR "%s: net_dev->local->ppp_slot(%d) out of range\n",
|
||||||
__FUNCTION__, net_dev->local->ppp_slot);
|
__FUNCTION__, net_dev->local->ppp_slot);
|
||||||
@ -1167,7 +1168,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
|
|||||||
mlp->huptimer = 0;
|
mlp->huptimer = 0;
|
||||||
#endif /* CONFIG_IPPP_FILTER */
|
#endif /* CONFIG_IPPP_FILTER */
|
||||||
skb->dev = dev;
|
skb->dev = dev;
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
netif_rx(skb);
|
netif_rx(skb);
|
||||||
/* net_dev->local->stats.rx_packets++; done in isdn_net.c */
|
/* net_dev->local->stats.rx_packets++; done in isdn_net.c */
|
||||||
return;
|
return;
|
||||||
@ -1902,7 +1903,9 @@ void isdn_ppp_mp_reassembly( isdn_net_dev * net_dev, isdn_net_local * lp,
|
|||||||
while( from != to ) {
|
while( from != to ) {
|
||||||
unsigned int len = from->len - MP_HEADER_LEN;
|
unsigned int len = from->len - MP_HEADER_LEN;
|
||||||
|
|
||||||
memcpy(skb_put(skb,len), from->data+MP_HEADER_LEN, len);
|
skb_copy_from_linear_data_offset(from, MP_HEADER_LEN,
|
||||||
|
skb_put(skb,len),
|
||||||
|
len);
|
||||||
frag = from->next;
|
frag = from->next;
|
||||||
isdn_ppp_mp_free_skb(mp, from);
|
isdn_ppp_mp_free_skb(mp, from);
|
||||||
from = frag;
|
from = frag;
|
||||||
|
@ -415,7 +415,8 @@ isdnloop_sendbuf(int channel, struct sk_buff *skb, isdnloop_card * card)
|
|||||||
spin_lock_irqsave(&card->isdnloop_lock, flags);
|
spin_lock_irqsave(&card->isdnloop_lock, flags);
|
||||||
nskb = dev_alloc_skb(skb->len);
|
nskb = dev_alloc_skb(skb->len);
|
||||||
if (nskb) {
|
if (nskb) {
|
||||||
memcpy(skb_put(nskb, len), skb->data, len);
|
skb_copy_from_linear_data(skb,
|
||||||
|
skb_put(nskb, len), len);
|
||||||
skb_queue_tail(&card->bqueue[channel], nskb);
|
skb_queue_tail(&card->bqueue[channel], nskb);
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
} else
|
} else
|
||||||
|
@ -429,8 +429,9 @@ int capi_decode_conn_ind(struct pcbit_chan * chan,
|
|||||||
if (!(info->data.setup.CallingPN = kmalloc(len - count + 1, GFP_ATOMIC)))
|
if (!(info->data.setup.CallingPN = kmalloc(len - count + 1, GFP_ATOMIC)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
memcpy(info->data.setup.CallingPN, skb->data + count + 1,
|
skb_copy_from_linear_data_offset(skb, count + 1,
|
||||||
len - count);
|
info->data.setup.CallingPN,
|
||||||
|
len - count);
|
||||||
info->data.setup.CallingPN[len - count] = 0;
|
info->data.setup.CallingPN[len - count] = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -457,8 +458,9 @@ int capi_decode_conn_ind(struct pcbit_chan * chan,
|
|||||||
if (!(info->data.setup.CalledPN = kmalloc(len - count + 1, GFP_ATOMIC)))
|
if (!(info->data.setup.CalledPN = kmalloc(len - count + 1, GFP_ATOMIC)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
memcpy(info->data.setup.CalledPN, skb->data + count + 1,
|
skb_copy_from_linear_data_offset(skb, count + 1,
|
||||||
len - count);
|
info->data.setup.CalledPN,
|
||||||
|
len - count);
|
||||||
info->data.setup.CalledPN[len - count] = 0;
|
info->data.setup.CalledPN[len - count] = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -539,7 +541,7 @@ int capi_decode_conn_actv_ind(struct pcbit_chan * chan, struct sk_buff *skb)
|
|||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (len > 1 && len < 31) {
|
if (len > 1 && len < 31) {
|
||||||
memcpy(str, skb->data + 2, len - 1);
|
skb_copy_from_linear_data_offset(skb, 2, str, len - 1);
|
||||||
str[len] = 0;
|
str[len] = 0;
|
||||||
printk(KERN_DEBUG "Connected Party Number: %s\n", str);
|
printk(KERN_DEBUG "Connected Party Number: %s\n", str);
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ static unsigned short dvb_net_eth_type_trans(struct sk_buff *skb,
|
|||||||
struct ethhdr *eth;
|
struct ethhdr *eth;
|
||||||
unsigned char *rawp;
|
unsigned char *rawp;
|
||||||
|
|
||||||
skb->mac.raw=skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb,dev->hard_header_len);
|
skb_pull(skb,dev->hard_header_len);
|
||||||
eth = eth_hdr(skb);
|
eth = eth_hdr(skb);
|
||||||
|
|
||||||
@ -600,6 +600,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
|
|||||||
/* Check CRC32, we've got it in our skb already. */
|
/* Check CRC32, we've got it in our skb already. */
|
||||||
unsigned short ulen = htons(priv->ule_sndu_len);
|
unsigned short ulen = htons(priv->ule_sndu_len);
|
||||||
unsigned short utype = htons(priv->ule_sndu_type);
|
unsigned short utype = htons(priv->ule_sndu_type);
|
||||||
|
const u8 *tail;
|
||||||
struct kvec iov[3] = {
|
struct kvec iov[3] = {
|
||||||
{ &ulen, sizeof ulen },
|
{ &ulen, sizeof ulen },
|
||||||
{ &utype, sizeof utype },
|
{ &utype, sizeof utype },
|
||||||
@ -613,10 +614,11 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
|
|||||||
}
|
}
|
||||||
|
|
||||||
ule_crc = iov_crc32(ule_crc, iov, 3);
|
ule_crc = iov_crc32(ule_crc, iov, 3);
|
||||||
expected_crc = *((u8 *)priv->ule_skb->tail - 4) << 24 |
|
tail = skb_tail_pointer(priv->ule_skb);
|
||||||
*((u8 *)priv->ule_skb->tail - 3) << 16 |
|
expected_crc = *(tail - 4) << 24 |
|
||||||
*((u8 *)priv->ule_skb->tail - 2) << 8 |
|
*(tail - 3) << 16 |
|
||||||
*((u8 *)priv->ule_skb->tail - 1);
|
*(tail - 2) << 8 |
|
||||||
|
*(tail - 1);
|
||||||
if (ule_crc != expected_crc) {
|
if (ule_crc != expected_crc) {
|
||||||
printk(KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n",
|
printk(KERN_WARNING "%lu: CRC32 check FAILED: %08x / %08x, SNDU len %d type %#x, ts_remain %d, next 2: %x.\n",
|
||||||
priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned short *)from_where : 0);
|
priv->ts_count, ule_crc, expected_crc, priv->ule_sndu_len, priv->ule_sndu_type, ts_remain, ts_remain > 2 ? *(unsigned short *)from_where : 0);
|
||||||
@ -695,7 +697,9 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy(dest_addr, priv->ule_skb->data, ETH_ALEN);
|
skb_copy_from_linear_data(priv->ule_skb,
|
||||||
|
dest_addr,
|
||||||
|
ETH_ALEN);
|
||||||
skb_pull(priv->ule_skb, ETH_ALEN);
|
skb_pull(priv->ule_skb, ETH_ALEN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -714,6 +714,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
|
|||||||
LANSendRequest_t *pSendReq;
|
LANSendRequest_t *pSendReq;
|
||||||
SGETransaction32_t *pTrans;
|
SGETransaction32_t *pTrans;
|
||||||
SGESimple64_t *pSimple;
|
SGESimple64_t *pSimple;
|
||||||
|
const unsigned char *mac;
|
||||||
dma_addr_t dma;
|
dma_addr_t dma;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ctx;
|
int ctx;
|
||||||
@ -753,7 +754,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
|
|||||||
/* Set the mac.raw pointer, since this apparently isn't getting
|
/* Set the mac.raw pointer, since this apparently isn't getting
|
||||||
* done before we get the skb. Pull the data pointer past the mac data.
|
* done before we get the skb. Pull the data pointer past the mac data.
|
||||||
*/
|
*/
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb, 12);
|
skb_pull(skb, 12);
|
||||||
|
|
||||||
dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len,
|
dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len,
|
||||||
@ -784,6 +785,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
|
|||||||
// IOC_AND_NETDEV_NAMES_s_s(dev),
|
// IOC_AND_NETDEV_NAMES_s_s(dev),
|
||||||
// ctx, skb, skb->data));
|
// ctx, skb, skb->data));
|
||||||
|
|
||||||
|
mac = skb_mac_header(skb);
|
||||||
#ifdef QLOGIC_NAA_WORKAROUND
|
#ifdef QLOGIC_NAA_WORKAROUND
|
||||||
{
|
{
|
||||||
struct NAA_Hosed *nh;
|
struct NAA_Hosed *nh;
|
||||||
@ -793,12 +795,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
|
|||||||
drops. */
|
drops. */
|
||||||
read_lock_irq(&bad_naa_lock);
|
read_lock_irq(&bad_naa_lock);
|
||||||
for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) {
|
for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) {
|
||||||
if ((nh->ieee[0] == skb->mac.raw[0]) &&
|
if ((nh->ieee[0] == mac[0]) &&
|
||||||
(nh->ieee[1] == skb->mac.raw[1]) &&
|
(nh->ieee[1] == mac[1]) &&
|
||||||
(nh->ieee[2] == skb->mac.raw[2]) &&
|
(nh->ieee[2] == mac[2]) &&
|
||||||
(nh->ieee[3] == skb->mac.raw[3]) &&
|
(nh->ieee[3] == mac[3]) &&
|
||||||
(nh->ieee[4] == skb->mac.raw[4]) &&
|
(nh->ieee[4] == mac[4]) &&
|
||||||
(nh->ieee[5] == skb->mac.raw[5])) {
|
(nh->ieee[5] == mac[5])) {
|
||||||
cur_naa = nh->NAA;
|
cur_naa = nh->NAA;
|
||||||
dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value "
|
dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value "
|
||||||
"= %04x.\n", cur_naa));
|
"= %04x.\n", cur_naa));
|
||||||
@ -810,12 +812,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) |
|
pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) |
|
||||||
(skb->mac.raw[0] << 8) |
|
(mac[0] << 8) |
|
||||||
(skb->mac.raw[1] << 0));
|
(mac[1] << 0));
|
||||||
pTrans->TransactionDetails[1] = cpu_to_le32((skb->mac.raw[2] << 24) |
|
pTrans->TransactionDetails[1] = cpu_to_le32((mac[2] << 24) |
|
||||||
(skb->mac.raw[3] << 16) |
|
(mac[3] << 16) |
|
||||||
(skb->mac.raw[4] << 8) |
|
(mac[4] << 8) |
|
||||||
(skb->mac.raw[5] << 0));
|
(mac[5] << 0));
|
||||||
|
|
||||||
pSimple = (SGESimple64_t *) &pTrans->TransactionDetails[2];
|
pSimple = (SGESimple64_t *) &pTrans->TransactionDetails[2];
|
||||||
|
|
||||||
@ -930,7 +932,7 @@ mpt_lan_receive_post_turbo(struct net_device *dev, u32 tmsg)
|
|||||||
pci_dma_sync_single_for_cpu(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
|
pci_dma_sync_single_for_cpu(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
|
||||||
priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
|
priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
|
||||||
|
|
||||||
memcpy(skb_put(skb, len), old_skb->data, len);
|
skb_copy_from_linear_data(old_skb, skb_put(skb, len), len);
|
||||||
|
|
||||||
pci_dma_sync_single_for_device(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
|
pci_dma_sync_single_for_device(mpt_dev->pcidev, priv->RcvCtl[ctx].dma,
|
||||||
priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
|
priv->RcvCtl[ctx].len, PCI_DMA_FROMDEVICE);
|
||||||
@ -1091,7 +1093,7 @@ mpt_lan_receive_post_reply(struct net_device *dev,
|
|||||||
priv->RcvCtl[ctx].dma,
|
priv->RcvCtl[ctx].dma,
|
||||||
priv->RcvCtl[ctx].len,
|
priv->RcvCtl[ctx].len,
|
||||||
PCI_DMA_FROMDEVICE);
|
PCI_DMA_FROMDEVICE);
|
||||||
memcpy(skb_put(skb, l), old_skb->data, l);
|
skb_copy_from_linear_data(old_skb, skb_put(skb, l), l);
|
||||||
|
|
||||||
pci_dma_sync_single_for_device(mpt_dev->pcidev,
|
pci_dma_sync_single_for_device(mpt_dev->pcidev,
|
||||||
priv->RcvCtl[ctx].dma,
|
priv->RcvCtl[ctx].dma,
|
||||||
@ -1120,7 +1122,7 @@ mpt_lan_receive_post_reply(struct net_device *dev,
|
|||||||
priv->RcvCtl[ctx].len,
|
priv->RcvCtl[ctx].len,
|
||||||
PCI_DMA_FROMDEVICE);
|
PCI_DMA_FROMDEVICE);
|
||||||
|
|
||||||
memcpy(skb_put(skb, len), old_skb->data, len);
|
skb_copy_from_linear_data(old_skb, skb_put(skb, len), len);
|
||||||
|
|
||||||
pci_dma_sync_single_for_device(mpt_dev->pcidev,
|
pci_dma_sync_single_for_device(mpt_dev->pcidev,
|
||||||
priv->RcvCtl[ctx].dma,
|
priv->RcvCtl[ctx].dma,
|
||||||
@ -1549,7 +1551,7 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
|
|||||||
struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data;
|
struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data;
|
||||||
struct fcllc *fcllc;
|
struct fcllc *fcllc;
|
||||||
|
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb, sizeof(struct mpt_lan_ohdr));
|
skb_pull(skb, sizeof(struct mpt_lan_ohdr));
|
||||||
|
|
||||||
if (fch->dtype == htons(0xffff)) {
|
if (fch->dtype == htons(0xffff)) {
|
||||||
|
@ -735,7 +735,6 @@ static void el_receive(struct net_device *dev)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
skb_reserve(skb,2); /* Force 16 byte alignment */
|
skb_reserve(skb,2); /* Force 16 byte alignment */
|
||||||
skb->dev = dev;
|
|
||||||
/*
|
/*
|
||||||
* The read increments through the bytes. The interrupt
|
* The read increments through the bytes. The interrupt
|
||||||
* handler will fix the pointer when it returns to
|
* handler will fix the pointer when it returns to
|
||||||
|
@ -615,7 +615,6 @@ static void receive_packet(struct net_device *dev, int len)
|
|||||||
if (test_and_set_bit(0, (void *) &adapter->dmaing))
|
if (test_and_set_bit(0, (void *) &adapter->dmaing))
|
||||||
printk(KERN_ERR "%s: rx blocked, DMA in progress, dir %d\n", dev->name, adapter->current_dma.direction);
|
printk(KERN_ERR "%s: rx blocked, DMA in progress, dir %d\n", dev->name, adapter->current_dma.direction);
|
||||||
|
|
||||||
skb->dev = dev;
|
|
||||||
adapter->current_dma.direction = 0;
|
adapter->current_dma.direction = 0;
|
||||||
adapter->current_dma.length = rlen;
|
adapter->current_dma.length = rlen;
|
||||||
adapter->current_dma.skb = skb;
|
adapter->current_dma.skb = skb;
|
||||||
@ -1026,7 +1025,7 @@ static int send_packet(struct net_device *dev, struct sk_buff *skb)
|
|||||||
adapter->current_dma.start_time = jiffies;
|
adapter->current_dma.start_time = jiffies;
|
||||||
|
|
||||||
if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS || nlen != skb->len) {
|
if ((unsigned long)(skb->data + nlen) >= MAX_DMA_ADDRESS || nlen != skb->len) {
|
||||||
memcpy(adapter->dma_buffer, skb->data, nlen);
|
skb_copy_from_linear_data(skb, adapter->dma_buffer, nlen);
|
||||||
memset(adapter->dma_buffer+skb->len, 0, nlen-skb->len);
|
memset(adapter->dma_buffer+skb->len, 0, nlen-skb->len);
|
||||||
target = isa_virt_to_bus(adapter->dma_buffer);
|
target = isa_virt_to_bus(adapter->dma_buffer);
|
||||||
}
|
}
|
||||||
|
@ -873,7 +873,6 @@ static void el16_rx(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
skb_reserve(skb,2);
|
skb_reserve(skb,2);
|
||||||
skb->dev = dev;
|
|
||||||
|
|
||||||
/* 'skb->data' points to the start of sk_buff data area. */
|
/* 'skb->data' points to the start of sk_buff data area. */
|
||||||
memcpy_fromio(skb_put(skb,pkt_len), data_frame + 10, pkt_len);
|
memcpy_fromio(skb_put(skb,pkt_len), data_frame + 10, pkt_len);
|
||||||
|
@ -1091,7 +1091,6 @@ el3_rx(struct net_device *dev)
|
|||||||
printk("Receiving packet size %d status %4.4x.\n",
|
printk("Receiving packet size %d status %4.4x.\n",
|
||||||
pkt_len, rx_status);
|
pkt_len, rx_status);
|
||||||
if (skb != NULL) {
|
if (skb != NULL) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb, 2); /* Align IP on 16 byte */
|
skb_reserve(skb, 2); /* Align IP on 16 byte */
|
||||||
|
|
||||||
/* 'skb->data' points to the start of sk_buff data area. */
|
/* 'skb->data' points to the start of sk_buff data area. */
|
||||||
|
@ -1292,7 +1292,6 @@ static int corkscrew_rx(struct net_device *dev)
|
|||||||
printk("Receiving packet size %d status %4.4x.\n",
|
printk("Receiving packet size %d status %4.4x.\n",
|
||||||
pkt_len, rx_status);
|
pkt_len, rx_status);
|
||||||
if (skb != NULL) {
|
if (skb != NULL) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
||||||
/* 'skb_put()' points to the start of sk_buff data area. */
|
/* 'skb_put()' points to the start of sk_buff data area. */
|
||||||
insl(ioaddr + RX_FIFO,
|
insl(ioaddr + RX_FIFO,
|
||||||
@ -1363,7 +1362,6 @@ static int boomerang_rx(struct net_device *dev)
|
|||||||
copying to a properly sized skbuff. */
|
copying to a properly sized skbuff. */
|
||||||
if (pkt_len < rx_copybreak
|
if (pkt_len < rx_copybreak
|
||||||
&& (skb = dev_alloc_skb(pkt_len + 4)) != 0) {
|
&& (skb = dev_alloc_skb(pkt_len + 4)) != 0) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
||||||
/* 'skb_put()' points to the start of sk_buff data area. */
|
/* 'skb_put()' points to the start of sk_buff data area. */
|
||||||
memcpy(skb_put(skb, pkt_len),
|
memcpy(skb_put(skb, pkt_len),
|
||||||
|
@ -988,7 +988,6 @@ static void elmc_rcv_int(struct net_device *dev)
|
|||||||
rbd->status = 0;
|
rbd->status = 0;
|
||||||
skb = (struct sk_buff *) dev_alloc_skb(totlen + 2);
|
skb = (struct sk_buff *) dev_alloc_skb(totlen + 2);
|
||||||
if (skb != NULL) {
|
if (skb != NULL) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb, 2); /* 16 byte alignment */
|
skb_reserve(skb, 2); /* 16 byte alignment */
|
||||||
skb_put(skb,totlen);
|
skb_put(skb,totlen);
|
||||||
eth_copy_and_sum(skb, (char *) p->base+(unsigned long) rbd->buffer,totlen,0);
|
eth_copy_and_sum(skb, (char *) p->base+(unsigned long) rbd->buffer,totlen,0);
|
||||||
@ -1146,7 +1145,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
if (len != skb->len)
|
if (len != skb->len)
|
||||||
memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN);
|
memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN);
|
||||||
memcpy((char *) p->xmit_cbuffs[p->xmit_count], (char *) (skb->data), skb->len);
|
skb_copy_from_linear_data(skb, (char *) p->xmit_cbuffs[p->xmit_count], skb->len);
|
||||||
|
|
||||||
#if (NUM_XMIT_BUFFS == 1)
|
#if (NUM_XMIT_BUFFS == 1)
|
||||||
#ifdef NO_NOPCOMMANDS
|
#ifdef NO_NOPCOMMANDS
|
||||||
|
@ -1189,7 +1189,6 @@ static void mc32_rx_ring(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
skb->protocol=eth_type_trans(skb,dev);
|
skb->protocol=eth_type_trans(skb,dev);
|
||||||
skb->dev=dev;
|
|
||||||
dev->last_rx = jiffies;
|
dev->last_rx = jiffies;
|
||||||
lp->net_stats.rx_packets++;
|
lp->net_stats.rx_packets++;
|
||||||
lp->net_stats.rx_bytes += length;
|
lp->net_stats.rx_bytes += length;
|
||||||
|
@ -2414,7 +2414,6 @@ static int vortex_rx(struct net_device *dev)
|
|||||||
printk(KERN_DEBUG "Receiving packet size %d status %4.4x.\n",
|
printk(KERN_DEBUG "Receiving packet size %d status %4.4x.\n",
|
||||||
pkt_len, rx_status);
|
pkt_len, rx_status);
|
||||||
if (skb != NULL) {
|
if (skb != NULL) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
||||||
/* 'skb_put()' points to the start of sk_buff data area. */
|
/* 'skb_put()' points to the start of sk_buff data area. */
|
||||||
if (vp->bus_master &&
|
if (vp->bus_master &&
|
||||||
@ -2491,7 +2490,6 @@ boomerang_rx(struct net_device *dev)
|
|||||||
/* Check if the packet is long enough to just accept without
|
/* Check if the packet is long enough to just accept without
|
||||||
copying to a properly sized skbuff. */
|
copying to a properly sized skbuff. */
|
||||||
if (pkt_len < rx_copybreak && (skb = dev_alloc_skb(pkt_len + 2)) != 0) {
|
if (pkt_len < rx_copybreak && (skb = dev_alloc_skb(pkt_len + 2)) != 0) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
|
||||||
pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
|
pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
|
||||||
/* 'skb_put()' points to the start of sk_buff data area. */
|
/* 'skb_put()' points to the start of sk_buff data area. */
|
||||||
|
@ -331,7 +331,6 @@ static int lance_rx (struct net_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve (skb, 2); /* 16 byte align */
|
skb_reserve (skb, 2); /* 16 byte align */
|
||||||
skb_put (skb, len); /* make room */
|
skb_put (skb, len); /* make room */
|
||||||
eth_copy_and_sum(skb,
|
eth_copy_and_sum(skb,
|
||||||
@ -568,7 +567,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
if (skb->len < ETH_ZLEN)
|
if (skb->len < ETH_ZLEN)
|
||||||
memset((char *)&ib->tx_buf[entry][0], 0, ETH_ZLEN);
|
memset((char *)&ib->tx_buf[entry][0], 0, ETH_ZLEN);
|
||||||
memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen);
|
skb_copy_from_linear_data(skb, &ib->tx_buf[entry][0], skblen);
|
||||||
|
|
||||||
/* Now, give the packet to the lance */
|
/* Now, give the packet to the lance */
|
||||||
ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
|
ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
|
||||||
|
@ -573,7 +573,6 @@ rx_status_loop:
|
|||||||
}
|
}
|
||||||
|
|
||||||
skb_reserve(new_skb, RX_OFFSET);
|
skb_reserve(new_skb, RX_OFFSET);
|
||||||
new_skb->dev = dev;
|
|
||||||
|
|
||||||
pci_unmap_single(cp->pdev, mapping,
|
pci_unmap_single(cp->pdev, mapping,
|
||||||
buflen, PCI_DMA_FROMDEVICE);
|
buflen, PCI_DMA_FROMDEVICE);
|
||||||
@ -807,7 +806,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||||||
if (mss)
|
if (mss)
|
||||||
flags |= LargeSend | ((mss & MSSMask) << MSSShift);
|
flags |= LargeSend | ((mss & MSSMask) << MSSShift);
|
||||||
else if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
else if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||||
const struct iphdr *ip = skb->nh.iph;
|
const struct iphdr *ip = ip_hdr(skb);
|
||||||
if (ip->protocol == IPPROTO_TCP)
|
if (ip->protocol == IPPROTO_TCP)
|
||||||
flags |= IPCS | TCPCS;
|
flags |= IPCS | TCPCS;
|
||||||
else if (ip->protocol == IPPROTO_UDP)
|
else if (ip->protocol == IPPROTO_UDP)
|
||||||
@ -826,7 +825,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||||||
u32 first_len, first_eor;
|
u32 first_len, first_eor;
|
||||||
dma_addr_t first_mapping;
|
dma_addr_t first_mapping;
|
||||||
int frag, first_entry = entry;
|
int frag, first_entry = entry;
|
||||||
const struct iphdr *ip = skb->nh.iph;
|
const struct iphdr *ip = ip_hdr(skb);
|
||||||
|
|
||||||
/* We must give this initial chunk to the device last.
|
/* We must give this initial chunk to the device last.
|
||||||
* Otherwise we could race with the device.
|
* Otherwise we could race with the device.
|
||||||
@ -1082,7 +1081,6 @@ static int cp_refill_rx (struct cp_private *cp)
|
|||||||
if (!skb)
|
if (!skb)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
|
||||||
skb->dev = cp->dev;
|
|
||||||
skb_reserve(skb, RX_OFFSET);
|
skb_reserve(skb, RX_OFFSET);
|
||||||
|
|
||||||
mapping = pci_map_single(cp->pdev, skb->data, cp->rx_buf_sz,
|
mapping = pci_map_single(cp->pdev, skb->data, cp->rx_buf_sz,
|
||||||
|
@ -1904,10 +1904,10 @@ static __inline__ void wrap_copy(struct sk_buff *skb, const unsigned char *ring,
|
|||||||
u32 left = RX_BUF_LEN - offset;
|
u32 left = RX_BUF_LEN - offset;
|
||||||
|
|
||||||
if (size > left) {
|
if (size > left) {
|
||||||
memcpy(skb->data, ring + offset, left);
|
skb_copy_to_linear_data(skb, ring + offset, left);
|
||||||
memcpy(skb->data+left, ring, size - left);
|
skb_copy_to_linear_data_offset(skb, left, ring, size - left);
|
||||||
} else
|
} else
|
||||||
memcpy(skb->data, ring + offset, size);
|
skb_copy_to_linear_data(skb, ring + offset, size);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2013,7 +2013,6 @@ no_early_rx:
|
|||||||
|
|
||||||
skb = dev_alloc_skb (pkt_size + 2);
|
skb = dev_alloc_skb (pkt_size + 2);
|
||||||
if (likely(skb)) {
|
if (likely(skb)) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve (skb, 2); /* 16 byte align the IP fields. */
|
skb_reserve (skb, 2); /* 16 byte align the IP fields. */
|
||||||
#if RX_BUF_IDX == 3
|
#if RX_BUF_IDX == 3
|
||||||
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
|
wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
|
||||||
|
@ -830,7 +830,6 @@ memory_squeeze:
|
|||||||
lp->stats.rx_dropped++;
|
lp->stats.rx_dropped++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skb->dev = dev;
|
|
||||||
if (!rx_in_place) {
|
if (!rx_in_place) {
|
||||||
/* 16 byte align the data fields */
|
/* 16 byte align the data fields */
|
||||||
skb_reserve(skb, 2);
|
skb_reserve(skb, 2);
|
||||||
|
@ -206,7 +206,7 @@ obj-$(CONFIG_TR) += tokenring/
|
|||||||
obj-$(CONFIG_WAN) += wan/
|
obj-$(CONFIG_WAN) += wan/
|
||||||
obj-$(CONFIG_ARCNET) += arcnet/
|
obj-$(CONFIG_ARCNET) += arcnet/
|
||||||
obj-$(CONFIG_NET_PCMCIA) += pcmcia/
|
obj-$(CONFIG_NET_PCMCIA) += pcmcia/
|
||||||
obj-$(CONFIG_NET_RADIO) += wireless/
|
obj-y += wireless/
|
||||||
obj-$(CONFIG_NET_TULIP) += tulip/
|
obj-$(CONFIG_NET_TULIP) += tulip/
|
||||||
obj-$(CONFIG_HAMRADIO) += hamradio/
|
obj-$(CONFIG_HAMRADIO) += hamradio/
|
||||||
obj-$(CONFIG_IRDA) += irda/
|
obj-$(CONFIG_IRDA) += irda/
|
||||||
|
@ -320,7 +320,6 @@ static int lance_rx (struct net_device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve (skb, 2); /* 16 byte align */
|
skb_reserve (skb, 2); /* 16 byte align */
|
||||||
skb_put (skb, len); /* make room */
|
skb_put (skb, len); /* make room */
|
||||||
eth_copy_and_sum(skb,
|
eth_copy_and_sum(skb,
|
||||||
@ -599,7 +598,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||||||
ib->btx_ring [entry].length = (-len) | 0xf000;
|
ib->btx_ring [entry].length = (-len) | 0xf000;
|
||||||
ib->btx_ring [entry].misc = 0;
|
ib->btx_ring [entry].misc = 0;
|
||||||
|
|
||||||
memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen);
|
skb_copy_from_linear_data(skb, &ib->tx_buf [entry][0], skblen);
|
||||||
|
|
||||||
/* Clear the slack of the packet, do I need this? */
|
/* Clear the slack of the packet, do I need this? */
|
||||||
if (len != skblen)
|
if (len != skblen)
|
||||||
|
@ -2027,7 +2027,6 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
|
|||||||
*/
|
*/
|
||||||
csum = retdesc->tcp_udp_csum;
|
csum = retdesc->tcp_udp_csum;
|
||||||
|
|
||||||
skb->dev = dev;
|
|
||||||
skb->protocol = eth_type_trans(skb, dev);
|
skb->protocol = eth_type_trans(skb, dev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -798,9 +798,7 @@ static int amd8111e_rx_poll(struct net_device *dev, int * budget)
|
|||||||
pci_unmap_single(lp->pci_dev,lp->rx_dma_addr[rx_index],
|
pci_unmap_single(lp->pci_dev,lp->rx_dma_addr[rx_index],
|
||||||
lp->rx_buff_len-2, PCI_DMA_FROMDEVICE);
|
lp->rx_buff_len-2, PCI_DMA_FROMDEVICE);
|
||||||
skb_put(skb, pkt_len);
|
skb_put(skb, pkt_len);
|
||||||
skb->dev = dev;
|
|
||||||
lp->rx_skbuff[rx_index] = new_skb;
|
lp->rx_skbuff[rx_index] = new_skb;
|
||||||
new_skb->dev = dev;
|
|
||||||
lp->rx_dma_addr[rx_index] = pci_map_single(lp->pci_dev,
|
lp->rx_dma_addr[rx_index] = pci_map_single(lp->pci_dev,
|
||||||
new_skb->data,
|
new_skb->data,
|
||||||
lp->rx_buff_len-2,
|
lp->rx_buff_len-2,
|
||||||
@ -926,9 +924,7 @@ static int amd8111e_rx(struct net_device *dev)
|
|||||||
pci_unmap_single(lp->pci_dev,lp->rx_dma_addr[rx_index],
|
pci_unmap_single(lp->pci_dev,lp->rx_dma_addr[rx_index],
|
||||||
lp->rx_buff_len-2, PCI_DMA_FROMDEVICE);
|
lp->rx_buff_len-2, PCI_DMA_FROMDEVICE);
|
||||||
skb_put(skb, pkt_len);
|
skb_put(skb, pkt_len);
|
||||||
skb->dev = dev;
|
|
||||||
lp->rx_skbuff[rx_index] = new_skb;
|
lp->rx_skbuff[rx_index] = new_skb;
|
||||||
new_skb->dev = dev;
|
|
||||||
lp->rx_dma_addr[rx_index] = pci_map_single(lp->pci_dev,
|
lp->rx_dma_addr[rx_index] = pci_map_single(lp->pci_dev,
|
||||||
new_skb->data, lp->rx_buff_len-2,PCI_DMA_FROMDEVICE);
|
new_skb->data, lp->rx_buff_len-2,PCI_DMA_FROMDEVICE);
|
||||||
|
|
||||||
|
@ -853,9 +853,9 @@ static void cops_rx(struct net_device *dev)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb->mac.raw = skb->data; /* Point to entire packet. */
|
skb_reset_mac_header(skb); /* Point to entire packet. */
|
||||||
skb_pull(skb,3);
|
skb_pull(skb,3);
|
||||||
skb->h.raw = skb->data; /* Point to data (Skip header). */
|
skb_reset_transport_header(skb); /* Point to data (Skip header). */
|
||||||
|
|
||||||
/* Update the counters. */
|
/* Update the counters. */
|
||||||
lp->stats.rx_packets++;
|
lp->stats.rx_packets++;
|
||||||
|
@ -770,13 +770,13 @@ static int sendup_buffer (struct net_device *dev)
|
|||||||
skb->data[0] = dnode;
|
skb->data[0] = dnode;
|
||||||
skb->data[1] = snode;
|
skb->data[1] = snode;
|
||||||
skb->data[2] = llaptype;
|
skb->data[2] = llaptype;
|
||||||
skb->mac.raw = skb->data; /* save pointer to llap header */
|
skb_reset_mac_header(skb); /* save pointer to llap header */
|
||||||
skb_pull(skb,3);
|
skb_pull(skb,3);
|
||||||
|
|
||||||
/* copy ddp(s,e)hdr + contents */
|
/* copy ddp(s,e)hdr + contents */
|
||||||
memcpy(skb->data,(void*)ltdmabuf,len);
|
skb_copy_to_linear_data(skb, ltdmabuf, len);
|
||||||
|
|
||||||
skb->h.raw = skb->data;
|
skb_reset_transport_header(skb);
|
||||||
|
|
||||||
stats->rx_packets++;
|
stats->rx_packets++;
|
||||||
stats->rx_bytes+=skb->len;
|
stats->rx_bytes+=skb->len;
|
||||||
@ -917,13 +917,14 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
struct lt_sendlap cbuf;
|
struct lt_sendlap cbuf;
|
||||||
|
unsigned char *hdr;
|
||||||
|
|
||||||
cbuf.command = LT_SENDLAP;
|
cbuf.command = LT_SENDLAP;
|
||||||
cbuf.dnode = skb->data[0];
|
cbuf.dnode = skb->data[0];
|
||||||
cbuf.laptype = skb->data[2];
|
cbuf.laptype = skb->data[2];
|
||||||
skb_pull(skb,3); /* skip past LLAP header */
|
skb_pull(skb,3); /* skip past LLAP header */
|
||||||
cbuf.length = skb->len; /* this is host order */
|
cbuf.length = skb->len; /* this is host order */
|
||||||
skb->h.raw=skb->data;
|
skb_reset_transport_header(skb);
|
||||||
|
|
||||||
if(debug & DEBUG_UPPER) {
|
if(debug & DEBUG_UPPER) {
|
||||||
printk("command ");
|
printk("command ");
|
||||||
@ -932,11 +933,13 @@ static int ltpc_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
printk("\n");
|
printk("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
do_write(dev,&cbuf,sizeof(cbuf),skb->h.raw,skb->len);
|
hdr = skb_transport_header(skb);
|
||||||
|
do_write(dev, &cbuf, sizeof(cbuf), hdr, skb->len);
|
||||||
|
|
||||||
if(debug & DEBUG_UPPER) {
|
if(debug & DEBUG_UPPER) {
|
||||||
printk("sent %d ddp bytes\n",skb->len);
|
printk("sent %d ddp bytes\n",skb->len);
|
||||||
for(i=0;i<skb->len;i++) printk("%02x ",skb->h.raw[i]);
|
for (i = 0; i < skb->len; i++)
|
||||||
|
printk("%02x ", hdr[i]);
|
||||||
printk("\n");
|
printk("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ static void rx(struct net_device *dev, int bufnum,
|
|||||||
|
|
||||||
pkt = (struct archdr *) skb->data;
|
pkt = (struct archdr *) skb->data;
|
||||||
|
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb, ARC_HDR_SIZE);
|
skb_pull(skb, ARC_HDR_SIZE);
|
||||||
|
|
||||||
/* up to sizeof(pkt->soft) has already been copied from the card */
|
/* up to sizeof(pkt->soft) has already been copied from the card */
|
||||||
|
@ -519,9 +519,12 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
|
|||||||
* real header when we do rebuild_header.
|
* real header when we do rebuild_header.
|
||||||
*/
|
*/
|
||||||
*(uint16_t *) skb_push(skb, 2) = type;
|
*(uint16_t *) skb_push(skb, 2) = type;
|
||||||
if (skb->nh.raw - skb->mac.raw != 2)
|
/*
|
||||||
|
* XXX: Why not use skb->mac_len?
|
||||||
|
*/
|
||||||
|
if (skb->network_header - skb->mac_header != 2)
|
||||||
BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n",
|
BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n",
|
||||||
(int)(skb->nh.raw - skb->mac.raw));
|
(int)(skb->network_header - skb->mac_header));
|
||||||
return -2; /* return error -- can't transmit yet! */
|
return -2; /* return error -- can't transmit yet! */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -554,11 +557,13 @@ static int arcnet_rebuild_header(struct sk_buff *skb)
|
|||||||
unsigned short type;
|
unsigned short type;
|
||||||
uint8_t daddr=0;
|
uint8_t daddr=0;
|
||||||
struct ArcProto *proto;
|
struct ArcProto *proto;
|
||||||
|
/*
|
||||||
if (skb->nh.raw - skb->mac.raw != 2) {
|
* XXX: Why not use skb->mac_len?
|
||||||
|
*/
|
||||||
|
if (skb->network_header - skb->mac_header != 2) {
|
||||||
BUGMSG(D_NORMAL,
|
BUGMSG(D_NORMAL,
|
||||||
"rebuild_header: shouldn't be here! (hdrsize=%d)\n",
|
"rebuild_header: shouldn't be here! (hdrsize=%d)\n",
|
||||||
(int)(skb->nh.raw - skb->mac.raw));
|
(int)(skb->network_header - skb->mac_header));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
type = *(uint16_t *) skb_pull(skb, 2);
|
type = *(uint16_t *) skb_pull(skb, 2);
|
||||||
|
@ -122,10 +122,8 @@ static void rx(struct net_device *dev, int bufnum,
|
|||||||
}
|
}
|
||||||
skb_put(skb, length + ARC_HDR_SIZE + sizeof(int));
|
skb_put(skb, length + ARC_HDR_SIZE + sizeof(int));
|
||||||
skb->dev = dev;
|
skb->dev = dev;
|
||||||
|
skb_reset_mac_header(skb);
|
||||||
pkt = (struct archdr *) skb->data;
|
pkt = (struct archdr *)skb_mac_header(skb);
|
||||||
|
|
||||||
skb->mac.raw = skb->data;
|
|
||||||
skb_pull(skb, ARC_HDR_SIZE);
|
skb_pull(skb, ARC_HDR_SIZE);
|
||||||
|
|
||||||
/* up to sizeof(pkt->soft) has already been copied from the card */
|
/* up to sizeof(pkt->soft) has already been copied from the card */
|
||||||
@ -270,13 +268,13 @@ static int ack_tx(struct net_device *dev, int acked)
|
|||||||
skb_put(ackskb, length + ARC_HDR_SIZE );
|
skb_put(ackskb, length + ARC_HDR_SIZE );
|
||||||
ackskb->dev = dev;
|
ackskb->dev = dev;
|
||||||
|
|
||||||
ackpkt = (struct archdr *) ackskb->data;
|
skb_reset_mac_header(ackskb);
|
||||||
|
ackpkt = (struct archdr *)skb_mac_header(ackskb);
|
||||||
ackskb->mac.raw = ackskb->data;
|
|
||||||
/* skb_pull(ackskb, ARC_HDR_SIZE); */
|
/* skb_pull(ackskb, ARC_HDR_SIZE); */
|
||||||
|
|
||||||
|
|
||||||
memcpy(ackpkt, lp->outgoing.skb->data, ARC_HDR_SIZE+sizeof(struct arc_cap));
|
skb_copy_from_linear_data(lp->outgoing.skb, ackpkt,
|
||||||
|
ARC_HDR_SIZE + sizeof(struct arc_cap));
|
||||||
ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */
|
ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */
|
||||||
ackpkt->soft.cap.mes.ack=acked;
|
ackpkt->soft.cap.mes.ack=acked;
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
|
|||||||
int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
|
int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
|
||||||
|
|
||||||
/* Pull off the arcnet header. */
|
/* Pull off the arcnet header. */
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb, hdr_size);
|
skb_pull(skb, hdr_size);
|
||||||
|
|
||||||
if (pkt->hard.dest == 0)
|
if (pkt->hard.dest == 0)
|
||||||
|
@ -96,7 +96,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
|
|||||||
int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
|
int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
|
||||||
|
|
||||||
/* Pull off the arcnet header. */
|
/* Pull off the arcnet header. */
|
||||||
skb->mac.raw = skb->data;
|
skb_reset_mac_header(skb);
|
||||||
skb_pull(skb, hdr_size);
|
skb_pull(skb, hdr_size);
|
||||||
|
|
||||||
if (pkt->hard.dest == 0)
|
if (pkt->hard.dest == 0)
|
||||||
|
@ -743,7 +743,6 @@ static int ariadne_rx(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb,2); /* 16 byte align */
|
skb_reserve(skb,2); /* 16 byte align */
|
||||||
skb_put(skb,pkt_len); /* Make room */
|
skb_put(skb,pkt_len); /* Make room */
|
||||||
eth_copy_and_sum(skb, (char *)priv->rx_buff[entry], pkt_len,0);
|
eth_copy_and_sum(skb, (char *)priv->rx_buff[entry], pkt_len,0);
|
||||||
|
@ -526,7 +526,6 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
|
|||||||
skb = dev_alloc_skb(len + 2);
|
skb = dev_alloc_skb(len + 2);
|
||||||
|
|
||||||
if (skb) {
|
if (skb) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb, 2);
|
skb_reserve(skb, 2);
|
||||||
|
|
||||||
am_readbuffer(dev, pktaddr, skb_put(skb, len), len);
|
am_readbuffer(dev, pktaddr, skb_put(skb, len), len);
|
||||||
|
@ -858,7 +858,6 @@ static void at91ether_rx(struct net_device *dev)
|
|||||||
skb_reserve(skb, 2);
|
skb_reserve(skb, 2);
|
||||||
memcpy(skb_put(skb, pktlen), p_recv, pktlen);
|
memcpy(skb_put(skb, pktlen), p_recv, pktlen);
|
||||||
|
|
||||||
skb->dev = dev;
|
|
||||||
skb->protocol = eth_type_trans(skb, dev);
|
skb->protocol = eth_type_trans(skb, dev);
|
||||||
dev->last_rx = jiffies;
|
dev->last_rx = jiffies;
|
||||||
lp->stats.rx_bytes += pktlen;
|
lp->stats.rx_bytes += pktlen;
|
||||||
|
@ -255,7 +255,6 @@ static int ep93xx_rx(struct net_device *dev, int *budget)
|
|||||||
|
|
||||||
skb = dev_alloc_skb(length + 2);
|
skb = dev_alloc_skb(length + 2);
|
||||||
if (likely(skb != NULL)) {
|
if (likely(skb != NULL)) {
|
||||||
skb->dev = dev;
|
|
||||||
skb_reserve(skb, 2);
|
skb_reserve(skb, 2);
|
||||||
dma_sync_single(NULL, ep->descs->rdesc[entry].buf_addr,
|
dma_sync_single(NULL, ep->descs->rdesc[entry].buf_addr,
|
||||||
length, DMA_FROM_DEVICE);
|
length, DMA_FROM_DEVICE);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user