Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171465
b: refs/heads/master
c: f6d773c
h: refs/heads/master
i:
  171463: 696e77c
v: v3
  • Loading branch information
David S. Miller committed Nov 9, 2009
1 parent 3cee9a0 commit 4f78592
Show file tree
Hide file tree
Showing 376 changed files with 11,326 additions and 5,469 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: bcb628d579a61d0ab0cac4c6cc8a403de5254920
refs/heads/master: f6d773cd4f3c18c40ab25a5cb92453756237840e
1 change: 1 addition & 0 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3655,6 +3655,7 @@ L: netdev@vger.kernel.org
W: http://www.linuxfoundation.org/en/Net
W: http://patchwork.ozlabs.org/project/netdev/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6.git
S: Maintained
F: net/
F: include/net/
Expand Down
59 changes: 47 additions & 12 deletions trunk/drivers/ieee802154/fakehard.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,29 @@
#include <net/nl802154.h>
#include <net/wpan-phy.h>

struct wpan_phy *net_to_phy(struct net_device *dev)
struct fakehard_priv {
struct wpan_phy *phy;
};

static struct wpan_phy *fake_to_phy(const struct net_device *dev)
{
return container_of(dev->dev.parent, struct wpan_phy, dev);
struct fakehard_priv *priv = netdev_priv(dev);
return priv->phy;
}

/**
* fake_get_phy - Return a phy corresponding to this device.
* @dev: The network device for which to return the wan-phy object
*
* This function returns a wpan-phy object corresponding to the passed
* network device. Reference counter for wpan-phy object is incremented,
* so when the wpan-phy isn't necessary, you should drop the reference
* via @wpan_phy_put() call.
*/
static struct wpan_phy *fake_get_phy(const struct net_device *dev)
{
struct wpan_phy *phy = fake_to_phy(dev);
return to_phy(get_device(&phy->dev));
}

/**
Expand All @@ -43,7 +63,7 @@ struct wpan_phy *net_to_phy(struct net_device *dev)
*
* Return the ID of the PAN from the PIB.
*/
static u16 fake_get_pan_id(struct net_device *dev)
static u16 fake_get_pan_id(const struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);

Expand All @@ -58,7 +78,7 @@ static u16 fake_get_pan_id(struct net_device *dev)
* 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)
static u16 fake_get_short_addr(const struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);

Expand All @@ -78,7 +98,7 @@ static u16 fake_get_short_addr(struct net_device *dev)
* 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)
static u8 fake_get_dsn(const struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);

Expand All @@ -98,7 +118,7 @@ static u8 fake_get_dsn(struct net_device *dev)
* 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)
static u8 fake_get_bsn(const struct net_device *dev)
{
BUG_ON(dev->type != ARPHRD_IEEE802154);

Expand All @@ -121,7 +141,7 @@ static u8 fake_get_bsn(struct net_device *dev)
static int fake_assoc_req(struct net_device *dev,
struct ieee802154_addr *addr, u8 channel, u8 page, u8 cap)
{
struct wpan_phy *phy = net_to_phy(dev);
struct wpan_phy *phy = fake_to_phy(dev);

mutex_lock(&phy->pib_lock);
phy->current_channel = channel;
Expand Down Expand Up @@ -196,7 +216,7 @@ static int fake_start_req(struct net_device *dev, struct ieee802154_addr *addr,
u8 bcn_ord, u8 sf_ord, u8 pan_coord, u8 blx,
u8 coord_realign)
{
struct wpan_phy *phy = net_to_phy(dev);
struct wpan_phy *phy = fake_to_phy(dev);

mutex_lock(&phy->pib_lock);
phy->current_channel = channel;
Expand Down Expand Up @@ -239,6 +259,8 @@ static struct ieee802154_mlme_ops fake_mlme = {
.start_req = fake_start_req,
.scan_req = fake_scan_req,

.get_phy = fake_get_phy,

.get_pan_id = fake_get_pan_id,
.get_short_addr = fake_get_short_addr,
.get_dsn = fake_get_dsn,
Expand Down Expand Up @@ -313,7 +335,7 @@ static const struct net_device_ops fake_ops = {

static void ieee802154_fake_destruct(struct net_device *dev)
{
struct wpan_phy *phy = net_to_phy(dev);
struct wpan_phy *phy = fake_to_phy(dev);

wpan_phy_unregister(phy);
free_netdev(dev);
Expand All @@ -338,13 +360,14 @@ static void ieee802154_fake_setup(struct net_device *dev)
static int __devinit ieee802154fake_probe(struct platform_device *pdev)
{
struct net_device *dev;
struct fakehard_priv *priv;
struct wpan_phy *phy = wpan_phy_alloc(0);
int err;

if (!phy)
return -ENOMEM;

dev = alloc_netdev(0, "hardwpan%d", ieee802154_fake_setup);
dev = alloc_netdev(sizeof(struct fakehard_priv), "hardwpan%d", ieee802154_fake_setup);
if (!dev) {
wpan_phy_free(phy);
return -ENOMEM;
Expand All @@ -356,12 +379,23 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev)
dev->addr_len);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);

phy->channels_supported = (1 << 27) - 1;
/*
* For now we'd like to emulate 2.4 GHz-only device,
* both O-QPSK and CSS
*/
/* 2.4 GHz O-QPSK 802.15.4-2003 */
phy->channels_supported[0] |= 0x7FFF800;
/* 2.4 GHz CSS 802.15.4a-2007 */
phy->channels_supported[3] |= 0x3fff;

phy->transmit_power = 0xbf;

dev->netdev_ops = &fake_ops;
dev->ml_priv = &fake_mlme;

priv = netdev_priv(dev);
priv->phy = phy;

/*
* If the name is a format string the caller wants us to do a
* name allocation.
Expand All @@ -372,11 +406,12 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev)
goto out;
}

wpan_phy_set_dev(phy, &pdev->dev);
SET_NETDEV_DEV(dev, &phy->dev);

platform_set_drvdata(pdev, dev);

err = wpan_phy_register(&pdev->dev, phy);
err = wpan_phy_register(phy);
if (err)
goto out;

Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/isdn/hardware/eicon/maintidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,9 @@ static int process_idi_event (diva_strace_context_t* pLib,
}
if (!strncmp("State\\Layer2 No1", path, pVar->path_length)) {
char* tmp = &pLib->lines[0].pInterface->Layer2[0];
dword l2_state;
diva_strace_read_uint (pVar, &l2_state);
dword l2_state;
if (diva_strace_read_uint(pVar, &l2_state))
return -1;

switch (l2_state) {
case 0:
Expand Down
18 changes: 9 additions & 9 deletions trunk/drivers/isdn/hardware/eicon/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -2692,7 +2692,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
if (!(fax_control_bits & T30_CONTROL_BIT_MORE_DOCUMENTS)
|| (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS))
{
len = (byte)(&(((T30_INFO *) 0)->universal_6));
len = offsetof(T30_INFO, universal_6);
fax_info_change = false;
if (ncpi->length >= 4)
{
Expand Down Expand Up @@ -2754,7 +2754,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
for (i = 0; i < w; i++)
((T30_INFO *)(plci->fax_connect_info_buffer))->station_id[i] = fax_parms[4].info[1+i];
((T30_INFO *)(plci->fax_connect_info_buffer))->head_line_len = 0;
len = (byte)(((T30_INFO *) 0)->station_id + 20);
len = offsetof(T30_INFO, station_id) + 20;
w = fax_parms[5].length;
if (w > 20)
w = 20;
Expand Down Expand Up @@ -2788,7 +2788,7 @@ static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
}
else
{
len = (byte)(&(((T30_INFO *) 0)->universal_6));
len = offsetof(T30_INFO, universal_6);
}
fax_info_change = true;

Expand Down Expand Up @@ -2892,7 +2892,7 @@ static byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
&& (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_ENABLE_NSF)
&& (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP))
{
len = ((byte)(((T30_INFO *) 0)->station_id + 20));
len = offsetof(T30_INFO, station_id) + 20;
if (plci->fax_connect_info_length < len)
{
((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0;
Expand Down Expand Up @@ -3802,7 +3802,7 @@ static byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a,
break;
}
ncpi = &m_parms[1];
len = ((byte)(((T30_INFO *) 0)->station_id + 20));
len = offsetof(T30_INFO, station_id) + 20;
if (plci->fax_connect_info_length < len)
{
((T30_INFO *)(plci->fax_connect_info_buffer))->station_id_len = 0;
Expand Down Expand Up @@ -6844,7 +6844,7 @@ static void nl_ind(PLCI *plci)
if ((plci->requested_options_conn | plci->requested_options | a->requested_options_table[plci->appl->Id-1])
& ((1L << PRIVATE_FAX_SUB_SEP_PWD) | (1L << PRIVATE_FAX_NONSTANDARD)))
{
i = ((word)(((T30_INFO *) 0)->station_id + 20)) + ((T30_INFO *)plci->NL.RBuffer->P)->head_line_len;
i = offsetof(T30_INFO, station_id) + 20 + ((T30_INFO *)plci->NL.RBuffer->P)->head_line_len;
while (i < plci->NL.RBuffer->length)
plci->ncpi_buffer[++len] = plci->NL.RBuffer->P[i++];
}
Expand Down Expand Up @@ -7236,7 +7236,7 @@ static void nl_ind(PLCI *plci)
{
plci->RData[1].P = plci->RData[0].P;
plci->RData[1].PLength = plci->RData[0].PLength;
plci->RData[0].P = v120_header_buffer + (-((int) v120_header_buffer) & 3);
plci->RData[0].P = v120_header_buffer + (-((unsigned long)v120_header_buffer) & 3);
if ((plci->NL.RBuffer->P[0] & V120_HEADER_EXTEND_BIT) || (plci->NL.RLength == 1))
plci->RData[0].PLength = 1;
else
Expand Down Expand Up @@ -8473,7 +8473,7 @@ static word add_b23(PLCI *plci, API_PARSE *bp)
fax_control_bits |= T30_CONTROL_BIT_ACCEPT_SEL_POLLING;
}
len = nlc[0];
pos = ((byte)(((T30_INFO *) 0)->station_id + 20));
pos = offsetof(T30_INFO, station_id) + 20;
if (pos < plci->fax_connect_info_length)
{
for (i = 1 + plci->fax_connect_info_buffer[pos]; i != 0; i--)
Expand Down Expand Up @@ -8525,7 +8525,7 @@ static word add_b23(PLCI *plci, API_PARSE *bp)
}

PUT_WORD(&(((T30_INFO *)&nlc[1])->control_bits_low), fax_control_bits);
len = ((byte)(((T30_INFO *) 0)->station_id + 20));
len = offsetof(T30_INFO, station_id) + 20;
for (i = 0; i < len; i++)
plci->fax_connect_info_buffer[i] = nlc[1+i];
((T30_INFO *) plci->fax_connect_info_buffer)->head_line_len = 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/isdn/hisax/amd7930_fn.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ Amd7930_l1hw(struct PStack *st, int pr, void *arg)
if (cs->debug & L1_DEB_WARN)
debugl1(cs, "Amd7930: l1hw: l2l1 tx_skb exist this shouldn't happen");
skb_queue_tail(&cs->sq, skb);
spin_unlock_irqrestore(&cs->lock, flags);
break;
}
if (cs->debug & DEB_DLOG_HEX)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/hisax/diva.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ MemwaitforXFW(struct IsdnCardState *cs, int hscx)
{
int to = 50;

while ((!(MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) {
while (((MemReadHSCX(cs, hscx, HSCX_STAR) & 0x44) != 0x40) && to) {
udelay(1);
to--;
}
Expand Down
22 changes: 11 additions & 11 deletions trunk/drivers/isdn/hisax/elsa_ser.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,62 +477,62 @@ static void
modem_set_init(struct IsdnCardState *cs) {
int timeout;

#define RCV_DELAY 20000
#define RCV_DELAY 20
modem_write_cmd(cs, MInit_1, strlen(MInit_1));
timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY);
mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_2, strlen(MInit_2));
timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY);
mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_3, strlen(MInit_3));
timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY);
mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_4, strlen(MInit_4));
timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY );
mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_5, strlen(MInit_5));
timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY);
mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_6, strlen(MInit_6));
timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY);
mdelay(RCV_DELAY);
modem_write_cmd(cs, MInit_7, strlen(MInit_7));
timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY);
mdelay(RCV_DELAY);
}

static void
modem_set_dial(struct IsdnCardState *cs, int outgoing) {
int timeout;
#define RCV_DELAY 20000
#define RCV_DELAY 20

modem_write_cmd(cs, MInit_speed28800, strlen(MInit_speed28800));
timeout = 1000;
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY);
mdelay(RCV_DELAY);
if (outgoing)
modem_write_cmd(cs, MInit_dialout, strlen(MInit_dialout));
else
Expand All @@ -541,7 +541,7 @@ modem_set_dial(struct IsdnCardState *cs, int outgoing) {
while(timeout-- && cs->hw.elsa.transcnt)
udelay(1000);
debugl1(cs, "msi tout=%d", timeout);
udelay(RCV_DELAY);
mdelay(RCV_DELAY);
}

static void
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/isdn/hisax/hfc_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,8 +817,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish)
}
/* we have a complete hdlc packet */
if (finish) {
if ((!fifo->skbuff->data[fifo->skbuff->len - 1])
&& (fifo->skbuff->len > 3)) {
if (fifo->skbuff->len > 3 &&
!fifo->skbuff->data[fifo->skbuff->len - 1]) {

if (fifon == HFCUSB_D_RX) {
DBG(HFCUSB_DBG_DCHANNEL,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/hisax/hscx_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ waitforXFW(struct IsdnCardState *cs, int hscx)
{
int to = 50;

while ((!(READHSCX(cs, hscx, HSCX_STAR) & 0x44) == 0x40) && to) {
while (((READHSCX(cs, hscx, HSCX_STAR) & 0x44) != 0x40) && to) {
udelay(1);
to--;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/isdn/hisax/icc.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ ICC_l1hw(struct PStack *st, int pr, void *arg)
if (cs->debug & L1_DEB_WARN)
debugl1(cs, " l2l1 tx_skb exist this shouldn't happen");
skb_queue_tail(&cs->sq, skb);
spin_unlock_irqrestore(&cs->lock, flags);
break;
}
if (cs->debug & DEB_DLOG_HEX)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/mISDN/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ base_sock_create(struct net *net, struct socket *sock, int protocol)
}

static int
mISDN_sock_create(struct net *net, struct socket *sock, int proto)
mISDN_sock_create(struct net *net, struct socket *sock, int proto, int kern)
{
int err = -EPROTONOSUPPORT;

Expand Down
Loading

0 comments on commit 4f78592

Please sign in to comment.