Commit 388f7ef7 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

parents d5eebf42 560c22fe
...@@ -812,7 +812,7 @@ config SMC91X ...@@ -812,7 +812,7 @@ config SMC91X
tristate "SMC 91C9x/91C1xxx support" tristate "SMC 91C9x/91C1xxx support"
select CRC32 select CRC32
select MII select MII
depends on NET_ETHERNET && (ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH) depends on NET_ETHERNET && (ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || SOC_AU1X00)
help help
This is a driver for SMC's 91x series of Ethernet chipsets, This is a driver for SMC's 91x series of Ethernet chipsets,
including the SMC91C94 and the SMC91C111. Say Y if you want it including the SMC91C94 and the SMC91C111. Say Y if you want it
......
This diff is collapsed.
...@@ -133,7 +133,7 @@ int gfar_mdio_probe(struct device *dev) ...@@ -133,7 +133,7 @@ int gfar_mdio_probe(struct device *dev)
if (NULL == dev) if (NULL == dev)
return -EINVAL; return -EINVAL;
new_bus = kmalloc(sizeof(struct mii_bus), GFP_KERNEL); new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
if (NULL == new_bus) if (NULL == new_bus)
return -ENOMEM; return -ENOMEM;
......
...@@ -72,8 +72,6 @@ static void dump_tx_desc(int dbg_lvl, struct net_device *dev, int i); ...@@ -72,8 +72,6 @@ static void dump_tx_desc(int dbg_lvl, struct net_device *dev, int i);
static void dump_rx_desc(int dbg_lvl, struct net_device *dev, int i); static void dump_rx_desc(int dbg_lvl, struct net_device *dev, int i);
static void dump_skb(int dbg_lvl, struct net_device *dev, static void dump_skb(int dbg_lvl, struct net_device *dev,
struct sk_buff *skb); struct sk_buff *skb);
static void dump_hw_addr(int dbg_lvl, struct net_device *dev,
const char* pfx, unsigned char* addr_str);
static void update_stats(struct gt96100_private *gp); static void update_stats(struct gt96100_private *gp);
static void abort(struct net_device *dev, u32 abort_bits); static void abort(struct net_device *dev, u32 abort_bits);
static void hard_stop(struct net_device *dev); static void hard_stop(struct net_device *dev);
...@@ -334,13 +332,13 @@ dump_MII(int dbg_lvl, struct net_device *dev) ...@@ -334,13 +332,13 @@ dump_MII(int dbg_lvl, struct net_device *dev)
static void static void
dump_hw_addr(int dbg_lvl, struct net_device *dev, const char* pfx, dump_hw_addr(int dbg_lvl, struct net_device *dev, const char* pfx,
unsigned char* addr_str) const char* func, unsigned char* addr_str)
{ {
int i; int i;
char buf[100], octet[5]; char buf[100], octet[5];
if (dbg_lvl <= GT96100_DEBUG) { if (dbg_lvl <= GT96100_DEBUG) {
strcpy(buf, pfx); sprintf(buf, pfx, func);
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
sprintf(octet, "%2.2x%s", sprintf(octet, "%2.2x%s",
addr_str[i], i<5 ? ":" : "\n"); addr_str[i], i<5 ? ":" : "\n");
...@@ -708,7 +706,7 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num) ...@@ -708,7 +706,7 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
info("%s found at 0x%x, irq %d\n", info("%s found at 0x%x, irq %d\n",
chip_name(gp->chip_rev), gtif->iobase, gtif->irq); chip_name(gp->chip_rev), gtif->iobase, gtif->irq);
dump_hw_addr(0, dev, "HW Address ", dev->dev_addr); dump_hw_addr(0, dev, "%s: HW Address ", __FUNCTION__, dev->dev_addr);
info("%s chip revision=%d\n", chip_name(gp->chip_rev), gp->chip_rev); info("%s chip revision=%d\n", chip_name(gp->chip_rev), gp->chip_rev);
info("%s ethernet port %d\n", chip_name(gp->chip_rev), gp->port_num); info("%s ethernet port %d\n", chip_name(gp->chip_rev), gp->port_num);
info("external PHY ID1=0x%04x, ID2=0x%04x\n", phy_id1, phy_id2); info("external PHY ID1=0x%04x, ID2=0x%04x\n", phy_id1, phy_id2);
...@@ -1488,7 +1486,7 @@ gt96100_set_rx_mode(struct net_device *dev) ...@@ -1488,7 +1486,7 @@ gt96100_set_rx_mode(struct net_device *dev)
gt96100_add_hash_entry(dev, dev->dev_addr); gt96100_add_hash_entry(dev, dev->dev_addr);
for (mcptr = dev->mc_list; mcptr; mcptr = mcptr->next) { for (mcptr = dev->mc_list; mcptr; mcptr = mcptr->next) {
dump_hw_addr(2, dev, __FUNCTION__ ": addr=", dump_hw_addr(2, dev, "%s: addr=", __FUNCTION__,
mcptr->dmi_addr); mcptr->dmi_addr);
gt96100_add_hash_entry(dev, mcptr->dmi_addr); gt96100_add_hash_entry(dev, mcptr->dmi_addr);
} }
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#include "ibmveth.h" #include "ibmveth.h"
#define DEBUG 1 #undef DEBUG
#define ibmveth_printk(fmt, args...) \ #define ibmveth_printk(fmt, args...) \
printk(KERN_INFO "%s: " fmt, __FILE__, ## args) printk(KERN_INFO "%s: " fmt, __FILE__, ## args)
......
This diff is collapsed.
...@@ -289,6 +289,38 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l) ...@@ -289,6 +289,38 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)
#define RPC_LSA_DEFAULT RPC_LED_TX_RX #define RPC_LSA_DEFAULT RPC_LED_TX_RX
#define RPC_LSB_DEFAULT RPC_LED_100_10 #define RPC_LSB_DEFAULT RPC_LED_100_10
#elif defined(CONFIG_SOC_AU1X00)
#include <au1xxx.h>
/* We can only do 16-bit reads and writes in the static memory space. */
#define SMC_CAN_USE_8BIT 0
#define SMC_CAN_USE_16BIT 1
#define SMC_CAN_USE_32BIT 0
#define SMC_IO_SHIFT 0
#define SMC_NOWAIT 1
#define SMC_inw(a, r) au_readw((unsigned long)((a) + (r)))
#define SMC_insw(a, r, p, l) \
do { \
unsigned long _a = (unsigned long)((a) + (r)); \
int _l = (l); \
u16 *_p = (u16 *)(p); \
while (_l-- > 0) \
*_p++ = au_readw(_a); \
} while(0)
#define SMC_outw(v, a, r) au_writew(v, (unsigned long)((a) + (r)))
#define SMC_outsw(a, r, p, l) \
do { \
unsigned long _a = (unsigned long)((a) + (r)); \
int _l = (l); \
const u16 *_p = (const u16 *)(p); \
while (_l-- > 0) \
au_writew(*_p++ , _a); \
} while(0)
#define set_irq_type(irq, type) do {} while (0)
#else #else
#define SMC_CAN_USE_8BIT 1 #define SMC_CAN_USE_8BIT 1
......
...@@ -330,7 +330,7 @@ config PCI_HERMES ...@@ -330,7 +330,7 @@ config PCI_HERMES
config ATMEL config ATMEL
tristate "Atmel at76c50x chipset 802.11b support" tristate "Atmel at76c50x chipset 802.11b support"
depends on NET_RADIO && EXPERIMENTAL depends on NET_RADIO
select FW_LOADER select FW_LOADER
select CRC32 select CRC32
---help--- ---help---
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
#include "atmel.h" #include "atmel.h"
#define DRIVER_MAJOR 0 #define DRIVER_MAJOR 0
#define DRIVER_MINOR 96 #define DRIVER_MINOR 98
MODULE_AUTHOR("Simon Kelley"); MODULE_AUTHOR("Simon Kelley");
MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards.");
...@@ -1504,7 +1504,7 @@ static int atmel_read_proc(char *page, char **start, off_t off, ...@@ -1504,7 +1504,7 @@ static int atmel_read_proc(char *page, char **start, off_t off,
return len; return len;
} }
struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWType fw_type, struct net_device *init_atmel_card( unsigned short irq, unsigned long port, const AtmelFWType fw_type,
struct device *sys_dev, int (*card_present)(void *), void *card) struct device *sys_dev, int (*card_present)(void *), void *card)
{ {
struct net_device *dev; struct net_device *dev;
...@@ -1605,8 +1605,8 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT ...@@ -1605,8 +1605,8 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT
goto err_out_free; goto err_out_free;
} }
if (priv->bus_type == BUS_TYPE_PCI && if (!request_region(dev->base_addr, 32,
!request_region( dev->base_addr, 64, dev->name )) { priv->bus_type == BUS_TYPE_PCCARD ? "atmel_cs" : "atmel_pci")) {
goto err_out_irq; goto err_out_irq;
} }
...@@ -1622,15 +1622,16 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT ...@@ -1622,15 +1622,16 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT
create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv); create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv);
printk(KERN_INFO "%s: Atmel at76c50x wireless. Version %d.%d simon@thekelleys.org.uk\n", printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
dev->name, DRIVER_MAJOR, DRIVER_MINOR); dev->name, DRIVER_MAJOR, DRIVER_MINOR,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] );
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
return dev; return dev;
err_out_res: err_out_res:
if (priv->bus_type == BUS_TYPE_PCI) release_region( dev->base_addr, 32);
release_region( dev->base_addr, 64 );
err_out_irq: err_out_irq:
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
err_out_free: err_out_free:
...@@ -1640,7 +1641,7 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT ...@@ -1640,7 +1641,7 @@ struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWT
EXPORT_SYMBOL(init_atmel_card); EXPORT_SYMBOL(init_atmel_card);
void stop_atmel_card(struct net_device *dev, int freeres) void stop_atmel_card(struct net_device *dev)
{ {
struct atmel_private *priv = netdev_priv(dev); struct atmel_private *priv = netdev_priv(dev);
...@@ -1654,10 +1655,7 @@ void stop_atmel_card(struct net_device *dev, int freeres) ...@@ -1654,10 +1655,7 @@ void stop_atmel_card(struct net_device *dev, int freeres)
remove_proc_entry("driver/atmel", NULL); remove_proc_entry("driver/atmel", NULL);
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
kfree(priv->firmware); kfree(priv->firmware);
if (freeres) { release_region(dev->base_addr, 32);
/* PCMCIA frees this stuff, so only for PCI */
release_region(dev->base_addr, 64);
}
free_netdev(dev); free_netdev(dev);
} }
...@@ -1810,9 +1808,9 @@ static int atmel_set_encode(struct net_device *dev, ...@@ -1810,9 +1808,9 @@ static int atmel_set_encode(struct net_device *dev,
} }
if(dwrq->flags & IW_ENCODE_RESTRICTED) if(dwrq->flags & IW_ENCODE_RESTRICTED)
priv->exclude_unencrypted = 1; priv->exclude_unencrypted = 1;
if(dwrq->flags & IW_ENCODE_OPEN) if(dwrq->flags & IW_ENCODE_OPEN)
priv->exclude_unencrypted = 0; priv->exclude_unencrypted = 0;
return -EINPROGRESS; /* Call commit handler */ return -EINPROGRESS; /* Call commit handler */
} }
...@@ -1827,11 +1825,12 @@ static int atmel_get_encode(struct net_device *dev, ...@@ -1827,11 +1825,12 @@ static int atmel_get_encode(struct net_device *dev,
if (!priv->wep_is_on) if (!priv->wep_is_on)
dwrq->flags = IW_ENCODE_DISABLED; dwrq->flags = IW_ENCODE_DISABLED;
else if (priv->exclude_unencrypted) else {
dwrq->flags = IW_ENCODE_RESTRICTED; if (priv->exclude_unencrypted)
else dwrq->flags = IW_ENCODE_RESTRICTED;
dwrq->flags = IW_ENCODE_OPEN; else
dwrq->flags = IW_ENCODE_OPEN;
}
/* Which key do we want ? -1 -> tx index */ /* Which key do we want ? -1 -> tx index */
if (index < 0 || index >= 4) if (index < 0 || index >= 4)
index = priv->default_key; index = priv->default_key;
...@@ -2645,8 +2644,8 @@ static void handle_beacon_probe(struct atmel_private *priv, u16 capability, u8 c ...@@ -2645,8 +2644,8 @@ static void handle_beacon_probe(struct atmel_private *priv, u16 capability, u8 c
} }
} }
static void send_authentication_request(struct atmel_private *priv, u8 *challenge, int challenge_len) static void send_authentication_request(struct atmel_private *priv, u16 system, u8 *challenge, int challenge_len)
{ {
struct ieee80211_hdr_4addr header; struct ieee80211_hdr_4addr header;
struct auth_body auth; struct auth_body auth;
...@@ -2658,14 +2657,11 @@ static void send_authentication_request(struct atmel_private *priv, u8 *challeng ...@@ -2658,14 +2657,11 @@ static void send_authentication_request(struct atmel_private *priv, u8 *challeng
memcpy(header.addr2, priv->dev->dev_addr, 6); memcpy(header.addr2, priv->dev->dev_addr, 6);
memcpy(header.addr3, priv->CurrentBSSID, 6); memcpy(header.addr3, priv->CurrentBSSID, 6);
if (priv->wep_is_on) { if (priv->wep_is_on && priv->CurrentAuthentTransactionSeqNum != 1)
auth.alg = cpu_to_le16(C80211_MGMT_AAN_SHAREDKEY);
/* no WEP for authentication frames with TrSeqNo 1 */ /* no WEP for authentication frames with TrSeqNo 1 */
if (priv->CurrentAuthentTransactionSeqNum != 1) header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
} else { auth.alg = cpu_to_le16(system);
auth.alg = cpu_to_le16(C80211_MGMT_AAN_OPENSYSTEM);
}
auth.status = 0; auth.status = 0;
auth.trans_seq = cpu_to_le16(priv->CurrentAuthentTransactionSeqNum); auth.trans_seq = cpu_to_le16(priv->CurrentAuthentTransactionSeqNum);
...@@ -2834,6 +2830,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) ...@@ -2834,6 +2830,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
struct auth_body *auth = (struct auth_body *)priv->rx_buf; struct auth_body *auth = (struct auth_body *)priv->rx_buf;
u16 status = le16_to_cpu(auth->status); u16 status = le16_to_cpu(auth->status);
u16 trans_seq_no = le16_to_cpu(auth->trans_seq); u16 trans_seq_no = le16_to_cpu(auth->trans_seq);
u16 system = le16_to_cpu(auth->alg);
if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) { if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) {
/* no WEP */ /* no WEP */
...@@ -2855,7 +2852,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) ...@@ -2855,7 +2852,7 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
if (trans_seq_no == 0x0002 && if (trans_seq_no == 0x0002 &&
auth->el_id == C80211_MGMT_ElementID_ChallengeText) { auth->el_id == C80211_MGMT_ElementID_ChallengeText) {
send_authentication_request(priv, auth->chall_text, auth->chall_text_len); send_authentication_request(priv, system, auth->chall_text, auth->chall_text_len);
return; return;
} }
...@@ -2872,14 +2869,20 @@ static void authenticate(struct atmel_private *priv, u16 frame_len) ...@@ -2872,14 +2869,20 @@ static void authenticate(struct atmel_private *priv, u16 frame_len)
} }
} }
if (status == C80211_MGMT_SC_AuthAlgNotSupported && priv->connect_to_any_BSS) { if (status == C80211_MGMT_SC_AuthAlgNotSupported) {
int bss_index; /* Do opensystem first, then try sharedkey */
if (system == C80211_MGMT_AAN_OPENSYSTEM) {
priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80; priv->CurrentAuthentTransactionSeqNum = 0x001;
send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0);
if ((bss_index = retrieve_bss(priv)) != -1) { } else if (priv->connect_to_any_BSS) {
atmel_join_bss(priv, bss_index); int bss_index;
return;
priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80;
if ((bss_index = retrieve_bss(priv)) != -1) {
atmel_join_bss(priv, bss_index);
return;
}
} }
} }
...@@ -3205,7 +3208,7 @@ static void atmel_management_timer(u_long a) ...@@ -3205,7 +3208,7 @@ static void atmel_management_timer(u_long a)
priv->AuthenticationRequestRetryCnt++; priv->AuthenticationRequestRetryCnt++;
priv->CurrentAuthentTransactionSeqNum = 0x0001; priv->CurrentAuthentTransactionSeqNum = 0x0001;
mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES);
send_authentication_request(priv, NULL, 0); send_authentication_request(priv, C80211_MGMT_AAN_OPENSYSTEM, NULL, 0);
} }
break; break;
...@@ -3312,7 +3315,7 @@ static void atmel_command_irq(struct atmel_private *priv) ...@@ -3312,7 +3315,7 @@ static void atmel_command_irq(struct atmel_private *priv)
mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES); mod_timer(&priv->management_timer, jiffies + MGMT_JIFFIES);
priv->CurrentAuthentTransactionSeqNum = 0x0001; priv->CurrentAuthentTransactionSeqNum = 0x0001;
send_authentication_request(priv, NULL, 0); send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0);
} }
return; return;
} }
...@@ -3482,11 +3485,6 @@ static int probe_atmel_card(struct net_device *dev) ...@@ -3482,11 +3485,6 @@ static int probe_atmel_card(struct net_device *dev)
printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name); printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name);
memcpy(dev->dev_addr, default_mac, 6); memcpy(dev->dev_addr, default_mac, 6);
} }
printk(KERN_INFO "%s: MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
dev->name,
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5] );
} }
return rc; return rc;
......
...@@ -35,9 +35,9 @@ typedef enum { ...@@ -35,9 +35,9 @@ typedef enum {
ATMEL_FW_TYPE_506 ATMEL_FW_TYPE_506
} AtmelFWType; } AtmelFWType;
struct net_device *init_atmel_card(unsigned short, int, const AtmelFWType, struct device *, struct net_device *init_atmel_card(unsigned short, unsigned long, const AtmelFWType, struct device *,
int (*present_func)(void *), void * ); int (*present_func)(void *), void * );
void stop_atmel_card( struct net_device *, int ); void stop_atmel_card( struct net_device *);
int atmel_open( struct net_device * ); int atmel_open( struct net_device * );
#endif #endif
This diff is collapsed.
...@@ -72,7 +72,7 @@ static int __devinit atmel_pci_probe(struct pci_dev *pdev, ...@@ -72,7 +72,7 @@ static int __devinit atmel_pci_probe(struct pci_dev *pdev,
static void __devexit atmel_pci_remove(struct pci_dev *pdev) static void __devexit atmel_pci_remove(struct pci_dev *pdev)
{ {
stop_atmel_card(pci_get_drvdata(pdev), 1); stop_atmel_card(pci_get_drvdata(pdev));
} }
static int __init atmel_init_module(void) static int __init atmel_init_module(void)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Author(s): Original Code written by * Author(s): Original Code written by
* DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) * DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
* Rewritten by * Rewritten by
* Frank Pavlic (pavlic@de.ibm.com) and * Frank Pavlic (fpavlic@de.ibm.com) and
* Martin Schwidefsky <schwidefsky@de.ibm.com> * Martin Schwidefsky <schwidefsky@de.ibm.com>
* *
* $Revision: 1.99 $ $Date: 2005/05/11 08:10:17 $ * $Revision: 1.99 $ $Date: 2005/05/11 08:10:17 $
...@@ -2342,6 +2342,6 @@ __exit lcs_cleanup_module(void) ...@@ -2342,6 +2342,6 @@ __exit lcs_cleanup_module(void)
module_init(lcs_init_module); module_init(lcs_init_module);
module_exit(lcs_cleanup_module); module_exit(lcs_cleanup_module);
MODULE_AUTHOR("Frank Pavlic <pavlic@de.ibm.com>"); MODULE_AUTHOR("Frank Pavlic <fpavlic@de.ibm.com>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/trdevice.h> #include <linux/trdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/ctype.h>
#include <net/ipv6.h> #include <net/ipv6.h>
#include <linux/in6.h> #include <linux/in6.h>
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
#include "qeth_mpc.h" #include "qeth_mpc.h"
#define VERSION_QETH_H "$Revision: 1.142 $" #define VERSION_QETH_H "$Revision: 1.152 $"
#ifdef CONFIG_QETH_IPV6 #ifdef CONFIG_QETH_IPV6
#define QETH_VERSION_IPV6 ":IPv6" #define QETH_VERSION_IPV6 ":IPv6"
...@@ -718,8 +719,6 @@ struct qeth_reply { ...@@ -718,8 +719,6 @@ struct qeth_reply {
atomic_t refcnt; atomic_t refcnt;
}; };
#define QETH_BROADCAST_WITH_ECHO 1
#define QETH_BROADCAST_WITHOUT_ECHO 2
struct qeth_card_blkt { struct qeth_card_blkt {
int time_total; int time_total;
...@@ -727,8 +726,10 @@ struct qeth_card_blkt { ...@@ -727,8 +726,10 @@ struct qeth_card_blkt {
int inter_packet_jumbo; int inter_packet_jumbo;
}; };
#define QETH_BROADCAST_WITH_ECHO 0x01
#define QETH_BROADCAST_WITHOUT_ECHO 0x02
#define QETH_LAYER2_MAC_READ 0x01
#define QETH_LAYER2_MAC_REGISTERED 0x02
struct qeth_card_info { struct qeth_card_info {
unsigned short unit_addr2; unsigned short unit_addr2;
unsigned short cula; unsigned short cula;
...@@ -736,7 +737,7 @@ struct qeth_card_info { ...@@ -736,7 +737,7 @@ struct qeth_card_info {
__u16 func_level; __u16 func_level;
char mcl_level[QETH_MCL_LENGTH + 1]; char mcl_level[QETH_MCL_LENGTH + 1];
int guestlan; int guestlan;
int layer2_mac_registered; int mac_bits;
int portname_required; int portname_required;
int portno; int portno;
char portname[9]; char portname[9];
...@@ -749,6 +750,7 @@ struct qeth_card_info { ...@@ -749,6 +750,7 @@ struct qeth_card_info {
int unique_id; int unique_id;
struct qeth_card_blkt blkt; struct qeth_card_blkt blkt;
__u32 csum_mask; __u32 csum_mask;
enum qeth_ipa_promisc_modes promisc_mode;
}; };
struct qeth_card_options { struct qeth_card_options {
...@@ -775,6 +777,7 @@ struct qeth_card_options { ...@@ -775,6 +777,7 @@ struct qeth_card_options {
enum qeth_threads { enum qeth_threads {
QETH_SET_IP_THREAD = 1, QETH_SET_IP_THREAD = 1,
QETH_RECOVER_THREAD = 2, QETH_RECOVER_THREAD = 2,
QETH_SET_PROMISC_MODE_THREAD = 4,
}; };
struct qeth_osn_info { struct qeth_osn_info {
...@@ -1074,6 +1077,26 @@ qeth_get_qdio_q_format(struct qeth_card *card) ...@@ -1074,6 +1077,26 @@ qeth_get_qdio_q_format(struct qeth_card *card)
} }
} }
static inline int
qeth_isdigit(char * buf)
{
while (*buf) {
if (!isdigit(*buf++))
return 0;
}
return 1;
}
static inline int
qeth_isxdigit(char * buf)
{
while (*buf) {
if (!isxdigit(*buf++))
return 0;
}
return 1;
}
static inline void static inline void
qeth_ipaddr4_to_string(const __u8 *addr, char *buf) qeth_ipaddr4_to_string(const __u8 *addr, char *buf)
{ {
...@@ -1090,18 +1113,27 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr) ...@@ -1090,18 +1113,27 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr)
int i; int i;
start = buf; start = buf;
for (i = 0; i < 3; i++) { for (i = 0; i < 4; i++) {
if (!(end = strchr(start, '.'))) if (i == 3) {
end = strchr(start,0xa);
if (end)
len = end - start;
else
len = strlen(start);
}
else {
end = strchr(start, '.');
len = end - start;
}
if ((len <= 0) || (len > 3))
return -EINVAL; return -EINVAL;
len = end - start;
memset(abuf, 0, 4); memset(abuf, 0, 4);
strncpy(abuf, start, len); strncpy(abuf, start, len);
if (!qeth_isdigit(abuf))
return -EINVAL;
addr[i] = simple_strtoul(abuf, &tmp, 10); addr[i] = simple_strtoul(abuf, &tmp, 10);
start = end + 1; start = end + 1;
} }
memset(abuf, 0, 4);
strcpy(abuf, start);
addr[3] = simple_strtoul(abuf, &tmp, 10);
return 0; return 0;
} }
...@@ -1128,18 +1160,27 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr) ...@@ -1128,18 +1160,27 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr)
tmp_addr = (u16 *)addr; tmp_addr = (u16 *)addr;
start = buf; start = buf;
for (i = 0; i < 7; i++) { for (i = 0; i < 8; i++) {
if (!(end = strchr(start, ':'))) if (i == 7) {
end = strchr(start,0xa);
if (end)
len = end - start;
else
len = strlen(start);
}
else {
end = strchr(start, ':');
len = end - start;
}
if ((len <= 0) || (len > 4))
return -EINVAL; return -EINVAL;
len = end - start;
memset(abuf, 0, 5); memset(abuf, 0, 5);
strncpy(abuf, start, len); strncpy(abuf, start, len);
if (!qeth_isxdigit(abuf))
return -EINVAL;
tmp_addr[i] = simple_strtoul(abuf, &tmp, 16); tmp_addr[i] = simple_strtoul(abuf, &tmp, 16);
start = end + 1; start = end + 1;
} }
memset(abuf, 0, 5);
strcpy(abuf, start);
tmp_addr[7] = simple_strtoul(abuf, &tmp, 16);
return 0; return 0;
} }
......
This diff is collapsed.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Linux on zSeries OSA Express and HiperSockets support * Linux on zSeries OSA Express and HiperSockets support
* *
* Copyright 2000,2003 IBM Corporation * Copyright 2000,2003 IBM Corporation
* Author(s): Frank Pavlic <pavlic@de.ibm.com> * Author(s): Frank Pavlic <fpavlic@de.ibm.com>
* Thomas Spatzier <tspat@de.ibm.com> * Thomas Spatzier <tspat@de.ibm.com>
* *
*/ */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Copyright 2000,2003 IBM Corporation * Copyright 2000,2003 IBM Corporation
* Author(s): Utz Bacher <utz.bacher@de.ibm.com> * Author(s): Utz Bacher <utz.bacher@de.ibm.com>
* Thomas Spatzier <tspat@de.ibm.com> * Thomas Spatzier <tspat@de.ibm.com>
* Frank Pavlic <pavlic@de.ibm.com> * Frank Pavlic <fpavlic@de.ibm.com>
* *
*/ */
#ifndef __QETH_MPC_H__ #ifndef __QETH_MPC_H__
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <asm/qeth.h> #include <asm/qeth.h>
#define VERSION_QETH_MPC_H "$Revision: 1.43 $" #define VERSION_QETH_MPC_H "$Revision: 1.44 $"
extern const char *VERSION_QETH_MPC_C; extern const char *VERSION_QETH_MPC_C;
...@@ -217,7 +217,7 @@ enum qeth_ipa_setadp_cmd { ...@@ -217,7 +217,7 @@ enum qeth_ipa_setadp_cmd {
IPA_SETADP_SEND_OSA_MESSAGE = 0x0100, IPA_SETADP_SEND_OSA_MESSAGE = 0x0100,
IPA_SETADP_SET_SNMP_CONTROL = 0x0200, IPA_SETADP_SET_SNMP_CONTROL = 0x0200,
IPA_SETADP_READ_SNMP_PARMS = 0x0400, IPA_SETADP_READ_SNMP_PARMS = 0x0400,
IPA_SETADP_WRITE_SNMP_PARMS = 0x0800, IPA_SETADP_SET_PROMISC_MODE = 0x0800,
IPA_SETADP_QUERY_CARD_INFO = 0x1000, IPA_SETADP_QUERY_CARD_INFO = 0x1000,
}; };
enum qeth_ipa_mac_ops { enum qeth_ipa_mac_ops {
...@@ -232,9 +232,12 @@ enum qeth_ipa_addr_ops { ...@@ -232,9 +232,12 @@ enum qeth_ipa_addr_ops {
CHANGE_ADDR_ADD_ADDR = 1, CHANGE_ADDR_ADD_ADDR = 1,
CHANGE_ADDR_DEL_ADDR = 2, CHANGE_ADDR_DEL_ADDR = 2,
CHANGE_ADDR_FLUSH_ADDR_TABLE = 4, CHANGE_ADDR_FLUSH_ADDR_TABLE = 4,
}; };
enum qeth_ipa_promisc_modes {
SET_PROMISC_MODE_OFF = 0,
SET_PROMISC_MODE_ON = 1,
};
/* (SET)DELIP(M) IPA stuff ***************************************************/ /* (SET)DELIP(M) IPA stuff ***************************************************/
struct qeth_ipacmd_setdelip4 { struct qeth_ipacmd_setdelip4 {
__u8 ip_addr[4]; __u8 ip_addr[4];
......
/* /*
* *
* linux/drivers/s390/net/qeth_sys.c ($Revision: 1.55 $) * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.58 $)
* *
* Linux on zSeries OSA Express and HiperSockets support * Linux on zSeries OSA Express and HiperSockets support
* This file contains code related to sysfs. * This file contains code related to sysfs.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Copyright 2000,2003 IBM Corporation * Copyright 2000,2003 IBM Corporation
* *
* Author(s): Thomas Spatzier <tspat@de.ibm.com> * Author(s): Thomas Spatzier <tspat@de.ibm.com>
* Frank Pavlic <pavlic@de.ibm.com> * Frank Pavlic <fpavlic@de.ibm.com>
* *
*/ */
#include <linux/list.h> #include <linux/list.h>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "qeth_mpc.h" #include "qeth_mpc.h"
#include "qeth_fs.h" #include "qeth_fs.h"
const char *VERSION_QETH_SYS_C = "$Revision: 1.55 $"; const char *VERSION_QETH_SYS_C = "$Revision: 1.58 $";
/*****************************************************************************/ /*****************************************************************************/
/* */ /* */
...@@ -1117,7 +1117,7 @@ qeth_parse_ipatoe(const char* buf, enum qeth_prot_versions proto, ...@@ -1117,7 +1117,7 @@ qeth_parse_ipatoe(const char* buf, enum qeth_prot_versions proto,
start = buf; start = buf;
/* get address string */ /* get address string */
end = strchr(start, '/'); end = strchr(start, '/');
if (!end){ if (!end || (end-start >= 49)){
PRINT_WARN("Invalid format for ipato_addx/delx. " PRINT_WARN("Invalid format for ipato_addx/delx. "
"Use <ip addr>/<mask bits>\n"); "Use <ip addr>/<mask bits>\n");
return -EINVAL; return -EINVAL;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright 2004 IBM Corporation * Copyright 2004 IBM Corporation
* *
* Author(s): Frank Pavlic <pavlic@de.ibm.com> * Author(s): Frank Pavlic <fpavlic@de.ibm.com>
* *
* $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $ * $Revision: 1.7 $ $Date: 2005/05/04 20:19:18 $
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment