Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159287
b: refs/heads/master
c: 2f6d7c1
h: refs/heads/master
i:
  159285: 8fb932f
  159283: 0713e8d
  159279: c4e1607
v: v3
  • Loading branch information
David S. Miller committed Jul 31, 2009
1 parent f454807 commit a32eac9
Show file tree
Hide file tree
Showing 93 changed files with 1,334 additions and 663 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e4247d457c6a42e4a05cb7dfa4e6ea1fa65c112
refs/heads/master: 2f6d7c1b34403b97fa57473edcb6749d1db5ace3
4 changes: 2 additions & 2 deletions trunk/Documentation/DocBook/kernel-hacking.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ printk(KERN_INFO "i = %u\n", i);
</para>

<programlisting>
__u32 ipaddress;
printk(KERN_INFO "my ip: %d.%d.%d.%d\n", NIPQUAD(ipaddress));
__be32 ipaddress;
printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
</programlisting>

<para>
Expand Down
2 changes: 2 additions & 0 deletions trunk/Documentation/networking/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ framerelay.txt
- info on using Frame Relay/Data Link Connection Identifier (DLCI).
generic_netlink.txt
- info on Generic Netlink
ieee802154.txt
- Linux IEEE 802.15.4 implementation, API and drivers
ip-sysctl.txt
- /proc/sys/net/ipv4/* variables
ip_dynaddr.txt
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/networking/ieee802154.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c
SoftMAC
=======

We are going to provide intermediate layer impelementing IEEE 802.15.4 MAC
We are going to provide intermediate layer implementing IEEE 802.15.4 MAC
in software. This is currently WIP.

See header include/net/ieee802154/mac802154.h and several drivers in
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/atm/solos-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
}

snr = next_string(skb);
if (!str)
if (!snr)
return -EIO;
attn = next_string(skb);
if (!attn)
Expand Down
130 changes: 125 additions & 5 deletions trunk/drivers/ieee802154/fakehard.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,92 @@
#include <linux/skbuff.h>
#include <linux/if_arp.h>

#include <net/ieee802154/af_ieee802154.h>
#include <net/ieee802154/netdevice.h>
#include <net/ieee802154/mac_def.h>
#include <net/ieee802154/nl802154.h>

#include <net/af_ieee802154.h>
#include <net/ieee802154_netdev.h>
#include <net/ieee802154.h>
#include <net/nl802154.h>

/**
* fake_get_pan_id - Retrieve the PAN ID of the device.
* @dev: The network device to retrieve the PAN of.
*
* Return the ID of the PAN from the PIB.
*/
static u16 fake_get_pan_id(struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);

return 0xeba1;
}

/**
* fake_get_short_addr - Retrieve the short address of the device.
* @dev: The network device to retrieve the short address of.
*
* Returns the IEEE 802.15.4 short-form address cached for this
* device. If the device has not yet had a short address assigned
* then this should return 0xFFFF to indicate a lack of association.
*/
static u16 fake_get_short_addr(struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);

return 0x1;
}

/**
* fake_get_dsn - Retrieve the DSN of the device.
* @dev: The network device to retrieve the DSN for.
*
* Returns the IEEE 802.15.4 DSN for the network device.
* The DSN is the sequence number which will be added to each
* packet or MAC command frame by the MAC during transmission.
*
* DSN means 'Data Sequence Number'.
*
* Note: This is in section 7.2.1.2 of the IEEE 802.15.4-2006
* document.
*/
static u8 fake_get_dsn(struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);

return 0x00; /* DSN are implemented in HW, so return just 0 */
}

/**
* fake_get_bsn - Retrieve the BSN of the device.
* @dev: The network device to retrieve the BSN for.
*
* Returns the IEEE 802.15.4 BSN for the network device.
* The BSN is the sequence number which will be added to each
* beacon frame sent by the MAC.
*
* BSN means 'Beacon Sequence Number'.
*
* Note: This is in section 7.2.1.2 of the IEEE 802.15.4-2006
* document.
*/
static u8 fake_get_bsn(struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);

return 0x00; /* BSN are implemented in HW, so return just 0 */
}

/**
* fake_assoc_req - Make an association request to the HW.
* @dev: The network device which we are associating to a network.
* @addr: The coordinator with which we wish to associate.
* @channel: The channel on which to associate.
* @cap: The capability information field to use in the association.
*
* Start an association with a coordinator. The coordinator's address
* and PAN ID can be found in @addr.
*
* Note: This is in section 7.3.1 and 7.5.3.1 of the IEEE
* 802.15.4-2006 document.
*/
static int fake_assoc_req(struct net_device *dev,
struct ieee802154_addr *addr, u8 channel, u8 cap)
{
Expand All @@ -67,18 +120,70 @@ static int fake_assoc_req(struct net_device *dev,
IEEE802154_SUCCESS);
}

/**
* fake_assoc_resp - Send an association response to a device.
* @dev: The network device on which to send the response.
* @addr: The address of the device to respond to.
* @short_addr: The assigned short address for the device (if any).
* @status: The result of the association request.
*
* Queue the association response of the coordinator to another
* device's attempt to associate with the network which we
* coordinate. This is then added to the indirect-send queue to be
* transmitted to the end device when it polls for data.
*
* Note: This is in section 7.3.2 and 7.5.3.1 of the IEEE
* 802.15.4-2006 document.
*/
static int fake_assoc_resp(struct net_device *dev,
struct ieee802154_addr *addr, u16 short_addr, u8 status)
{
return 0;
}

/**
* fake_disassoc_req - Disassociate a device from a network.
* @dev: The network device on which we're disassociating a device.
* @addr: The device to disassociate from the network.
* @reason: The reason to give to the device for being disassociated.
*
* This sends a disassociation notification to the device being
* disassociated from the network.
*
* Note: This is in section 7.5.3.2 of the IEEE 802.15.4-2006
* document, with the reason described in 7.3.3.2.
*/
static int fake_disassoc_req(struct net_device *dev,
struct ieee802154_addr *addr, u8 reason)
{
return ieee802154_nl_disassoc_confirm(dev, IEEE802154_SUCCESS);
}

/**
* fake_start_req - Start an IEEE 802.15.4 PAN.
* @dev: The network device on which to start the PAN.
* @addr: The coordinator address to use when starting the PAN.
* @channel: The channel on which to start the PAN.
* @bcn_ord: Beacon order.
* @sf_ord: Superframe order.
* @pan_coord: Whether or not we are the PAN coordinator or just
* requesting a realignment perhaps?
* @blx: Battery Life Extension feature bitfield.
* @coord_realign: Something to realign something else.
*
* If pan_coord is non-zero then this starts a network with the
* provided parameters, otherwise it attempts a coordinator
* realignment of the stated network instead.
*
* Note: This is in section 7.5.2.3 of the IEEE 802.15.4-2006
* document, with 7.3.8 describing coordinator realignment.
*
* Note: There is currently no way to notify the coordinator userland
* program of whether or not the PAN has started successfully. As
* such, the coordinator program cannot know when the MAC has
* completed starting the network and will simply have to assume
* completeness based on some form of time delay.
*/
static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr,
u8 channel,
u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx,
Expand All @@ -87,6 +192,21 @@ static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr,
return 0;
}

/**
* fake_scan_req - Start a channel scan.
* @dev: The network device on which to perform a channel scan.
* @type: The type of scan to perform.
* @channels: The channel bitmask to scan.
* @duration: How long to spend on each channel.
*
* This starts either a passive (energy) scan or an active (PAN) scan
* on the channels indicated in the @channels bitmask. The duration of
* the scan is measured in terms of superframe duration. Specifically,
* the scan will spend aBaseSuperFrameDuration * ((2^n) + 1) on each
* channel.
*
* Note: This is in section 7.5.2.1 of the IEEE 802.15.4-2006 document.
*/
static int fake_scan_req(struct net_device *dev, u8 type, u32 channels,
u8 duration)
{
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/isdn/hardware/mISDN/iohelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
#ifndef _IOHELPER_H
#define _IOHELPER_H

typedef u8 (read_reg_t)(void *, u8);
typedef void (write_reg_t)(void *, u8, u8);
typedef void (fifo_func_t)(void *, u8, u8 *, int);
typedef u8 (read_reg_func)(void *hwp, u8 offset);
typedef void (write_reg_func)(void *hwp, u8 offset, u8 value);
typedef void (fifo_func)(void *hwp, u8 offset, u8 *datap, int size);

struct _ioport {
u32 port;
Expand Down Expand Up @@ -90,7 +90,7 @@ struct _ioport {
*dp++ = readb(((typ *)hw->adr) + off);\
} \
static void WriteFiFo##name##_MIO(void *p, u8 off, u8 *dp, int size) {\
struct inf_hw *hw = p;\
struct hws *hw = p;\
while (size--)\
writeb(*dp++, ((typ *)hw->adr) + off);\
}
Expand All @@ -106,4 +106,4 @@ struct _ioport {
ASSIGN_FUNC(typ, IPAC, target);\
} while (0)

#endif
#endif
16 changes: 8 additions & 8 deletions trunk/drivers/isdn/hardware/mISDN/ipac.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ struct isac_hw {
u32 off; /* offset to isac regs */
char *name;
spinlock_t *hwlock; /* lock HW acccess */
read_reg_t *read_reg;
write_reg_t *write_reg;
fifo_func_t *read_fifo;
fifo_func_t *write_fifo;
read_reg_func *read_reg;
write_reg_func *write_reg;
fifo_func *read_fifo;
fifo_func *write_fifo;
int (*monitor)(void *, u32, u8 *, int);
void (*release)(struct isac_hw *);
int (*init)(struct isac_hw *);
Expand Down Expand Up @@ -73,10 +73,10 @@ struct ipac_hw {
spinlock_t *hwlock; /* lock HW acccess */
struct module *owner;
u32 type;
read_reg_t *read_reg;
write_reg_t *write_reg;
fifo_func_t *read_fifo;
fifo_func_t *write_fifo;
read_reg_func *read_reg;
write_reg_func *write_reg;
fifo_func *read_fifo;
fifo_func *write_fifo;
void (*release)(struct ipac_hw *);
int (*init)(struct ipac_hw *);
int (*ctrl)(struct ipac_hw *, u32, u_long);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/isdn/hardware/mISDN/isar.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ struct isar_hw {
spinlock_t *hwlock; /* lock HW acccess */
char *name;
struct module *owner;
read_reg_t *read_reg;
write_reg_t *write_reg;
fifo_func_t *read_fifo;
fifo_func_t *write_fifo;
read_reg_func *read_reg;
write_reg_func *write_reg;
fifo_func *read_fifo;
fifo_func *write_fifo;
int (*ctrl)(void *, u32, u_long);
void (*release)(struct isar_hw *);
int (*init)(struct isar_hw *);
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/net/3c515.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,9 @@ static int corkscrew_open(struct net_device *dev)
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
vp->rx_ring[i].addr = isa_virt_to_bus(skb->data);
}
vp->rx_ring[i - 1].next = isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */
if (i != 0)
vp->rx_ring[i - 1].next =
isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */
outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr);
}
if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/at1700.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
pos3 = mca_read_stored_pos( slot, 3 );
pos4 = mca_read_stored_pos( slot, 4 );

for (l_i = 0; l_i < 0x09; l_i++)
for (l_i = 0; l_i < 8; l_i++)
if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i])
break;
ioaddr = at1700_mca_probe_list[l_i];
Expand Down
Loading

0 comments on commit a32eac9

Please sign in to comment.