Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198620
b: refs/heads/master
c: a261af9
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed May 25, 2010
1 parent 6bc50e5 commit 59dbba1
Show file tree
Hide file tree
Showing 33 changed files with 388 additions and 223 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: a65e4cb402b5f3e120570ba1faca4354d47e8f2f
refs/heads/master: a261af927df64523925c98369106de15af9d7b5e
6 changes: 6 additions & 0 deletions trunk/drivers/isdn/capi/kcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,12 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
if (ctr->state == CAPI_CTR_DETECTED)
goto reset_unlock_out;

if (ctr->reset_ctr == NULL) {
printk(KERN_DEBUG "kcapi: reset: no reset function\n");
retval = -ESRCH;
goto reset_unlock_out;
}

ctr->reset_ctr(ctr);

retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);
Expand Down
28 changes: 2 additions & 26 deletions trunk/drivers/isdn/gigaset/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,30 +932,6 @@ void gigaset_isdn_stop(struct cardstate *cs)
* ============================
*/

/*
* load firmware
*/
static int gigaset_load_firmware(struct capi_ctr *ctr, capiloaddata *data)
{
struct cardstate *cs = ctr->driverdata;

/* AVM specific operation, not needed for Gigaset -- ignore */
dev_notice(cs->dev, "load_firmware ignored\n");

return 0;
}

/*
* reset (deactivate) controller
*/
static void gigaset_reset_ctr(struct capi_ctr *ctr)
{
struct cardstate *cs = ctr->driverdata;

/* AVM specific operation, not needed for Gigaset -- ignore */
dev_notice(cs->dev, "reset_ctr ignored\n");
}

/*
* register CAPI application
*/
Expand Down Expand Up @@ -2213,8 +2189,8 @@ int gigaset_isdn_regdev(struct cardstate *cs, const char *isdnid)
iif->ctr.driverdata = cs;
strncpy(iif->ctr.name, isdnid, sizeof(iif->ctr.name));
iif->ctr.driver_name = "gigaset";
iif->ctr.load_firmware = gigaset_load_firmware;
iif->ctr.reset_ctr = gigaset_reset_ctr;
iif->ctr.load_firmware = NULL;
iif->ctr.reset_ctr = NULL;
iif->ctr.register_appl = gigaset_register_appl;
iif->ctr.release_appl = gigaset_release_appl;
iif->ctr.send_message = gigaset_send_message;
Expand Down
10 changes: 6 additions & 4 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2487,17 +2487,19 @@ static int __devinit be_probe(struct pci_dev *pdev,
status = be_cmd_POST(adapter);
if (status)
goto ctrl_clean;

status = be_cmd_reset_function(adapter);
if (status)
goto ctrl_clean;
}

/* tell fw we're ready to fire cmds */
status = be_cmd_fw_init(adapter);
if (status)
goto ctrl_clean;

if (be_physfn(adapter)) {
status = be_cmd_reset_function(adapter);
if (status)
goto ctrl_clean;
}

status = be_stats_init(adapter);
if (status)
goto ctrl_clean;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,7 @@ static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)
return 0;

out_err_mdiobus_register:
kfree(miibus->irq);
mdiobus_free(miibus);
out_err_alloc:
peripheral_free_list(pin_req);
Expand All @@ -1638,6 +1639,7 @@ static int __devexit bfin_mii_bus_remove(struct platform_device *pdev)
struct mii_bus *miibus = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
mdiobus_unregister(miibus);
kfree(miibus->irq);
mdiobus_free(miibus);
peripheral_free_list(pin_req);
return 0;
Expand Down
29 changes: 21 additions & 8 deletions trunk/drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,10 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
{
struct vic_provinfo *vp;
u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
unsigned short *uuid;
u8 *uuid;
char uuid_str[38];
static char *uuid_fmt = "%04X%04X-%04X-%04X-%04X-%04X%04X%04X";
static char *uuid_fmt = "%02X%02X%02X%02X-%02X%02X-%02X%02X-"
"%02X%02X-%02X%02X%02X%02X%0X%02X";
int err;

if (!name)
Expand All @@ -1058,20 +1059,24 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
ETH_ALEN, mac);

if (instance_uuid) {
uuid = (unsigned short *)instance_uuid;
uuid = instance_uuid;
sprintf(uuid_str, uuid_fmt,
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7]);
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
sizeof(uuid_str), uuid_str);
}

if (host_uuid) {
uuid = (unsigned short *)host_uuid;
uuid = host_uuid;
sprintf(uuid_str, uuid_fmt,
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7]);
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_HOST_UUID_STR,
sizeof(uuid_str), uuid_str);
Expand Down Expand Up @@ -1127,6 +1132,14 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
switch (request) {
case PORT_REQUEST_ASSOCIATE:

/* If the interface mac addr hasn't been assigned,
* assign a random mac addr before setting port-
* profile.
*/

if (is_zero_ether_addr(netdev->dev_addr))
random_ether_addr(netdev->dev_addr);

if (port[IFLA_PORT_PROFILE])
name = nla_data(port[IFLA_PORT_PROFILE]);

Expand Down
34 changes: 30 additions & 4 deletions trunk/drivers/net/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ MODULE_PARM_DESC(buffer_size, "DMA buffer allocation size");
* @iobase: pointer to I/O memory region
* @membase: pointer to buffer memory region
* @dma_alloc: dma allocated buffer size
* @io_region_size: I/O memory region size
* @num_tx: number of send buffers
* @cur_tx: last send buffer written
* @dty_tx: last buffer actually sent
Expand All @@ -193,6 +194,7 @@ struct ethoc {
void __iomem *iobase;
void __iomem *membase;
int dma_alloc;
resource_size_t io_region_size;

unsigned int num_tx;
unsigned int cur_tx;
Expand Down Expand Up @@ -943,6 +945,7 @@ static int ethoc_probe(struct platform_device *pdev)
priv = netdev_priv(netdev);
priv->netdev = netdev;
priv->dma_alloc = 0;
priv->io_region_size = mmio->end - mmio->start + 1;

priv->iobase = devm_ioremap_nocache(&pdev->dev, netdev->base_addr,
resource_size(mmio));
Expand Down Expand Up @@ -1047,20 +1050,34 @@ static int ethoc_probe(struct platform_device *pdev)
ret = register_netdev(netdev);
if (ret < 0) {
dev_err(&netdev->dev, "failed to register interface\n");
goto error;
goto error2;
}

goto out;

error2:
netif_napi_del(&priv->napi);
error:
mdiobus_unregister(priv->mdio);
free_mdio:
kfree(priv->mdio->irq);
mdiobus_free(priv->mdio);
free:
if (priv->dma_alloc)
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
netdev->mem_start);
if (priv) {
if (priv->dma_alloc)
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
netdev->mem_start);
else if (priv->membase)
devm_iounmap(&pdev->dev, priv->membase);
if (priv->iobase)
devm_iounmap(&pdev->dev, priv->iobase);
}
if (mem)
devm_release_mem_region(&pdev->dev, mem->start,
mem->end - mem->start + 1);
if (mmio)
devm_release_mem_region(&pdev->dev, mmio->start,
mmio->end - mmio->start + 1);
free_netdev(netdev);
out:
return ret;
Expand All @@ -1078,6 +1095,7 @@ static int ethoc_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);

if (netdev) {
netif_napi_del(&priv->napi);
phy_disconnect(priv->phy);
priv->phy = NULL;

Expand All @@ -1089,6 +1107,14 @@ static int ethoc_remove(struct platform_device *pdev)
if (priv->dma_alloc)
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
netdev->mem_start);
else {
devm_iounmap(&pdev->dev, priv->membase);
devm_release_mem_region(&pdev->dev, netdev->mem_start,
netdev->mem_end - netdev->mem_start + 1);
}
devm_iounmap(&pdev->dev, priv->iobase);
devm_release_mem_region(&pdev->dev, netdev->base_addr,
priv->io_region_size);
unregister_netdev(netdev);
free_netdev(netdev);
}
Expand Down
22 changes: 22 additions & 0 deletions trunk/drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/phy.h>
#include <linux/fec.h>

#include <asm/cacheflush.h>

Expand Down Expand Up @@ -182,6 +183,7 @@ struct fec_enet_private {
struct phy_device *phy_dev;
int mii_timeout;
uint phy_speed;
phy_interface_t phy_interface;
int index;
int link;
int full_duplex;
Expand Down Expand Up @@ -1191,6 +1193,21 @@ fec_restart(struct net_device *dev, int duplex)
/* Set MII speed */
writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);

#ifdef FEC_MIIGSK_ENR
if (fep->phy_interface == PHY_INTERFACE_MODE_RMII) {
/* disable the gasket and wait */
writel(0, fep->hwp + FEC_MIIGSK_ENR);
while (readl(fep->hwp + FEC_MIIGSK_ENR) & 4)
udelay(1);

/* configure the gasket: RMII, 50 MHz, no loopback, no echo */
writel(1, fep->hwp + FEC_MIIGSK_CFGR);

/* re-enable the gasket */
writel(2, fep->hwp + FEC_MIIGSK_ENR);
}
#endif

/* And last, enable the transmit and receive processing */
writel(2, fep->hwp + FEC_ECNTRL);
writel(0, fep->hwp + FEC_R_DES_ACTIVE);
Expand Down Expand Up @@ -1226,6 +1243,7 @@ static int __devinit
fec_probe(struct platform_device *pdev)
{
struct fec_enet_private *fep;
struct fec_platform_data *pdata;
struct net_device *ndev;
int i, irq, ret = 0;
struct resource *r;
Expand Down Expand Up @@ -1259,6 +1277,10 @@ fec_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, ndev);

pdata = pdev->dev.platform_data;
if (pdata)
fep->phy_interface = pdata->phy;

/* This device has up to three irqs on some platforms */
for (i = 0; i < 3; i++) {
irq = platform_get_irq(pdev, i);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/fec.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#define FEC_R_DES_START 0x180 /* Receive descriptor ring */
#define FEC_X_DES_START 0x184 /* Transmit descriptor ring */
#define FEC_R_BUFF_SIZE 0x188 /* Maximum receive buff size */
#define FEC_MIIGSK_CFGR 0x300 /* MIIGSK Configuration reg */
#define FEC_MIIGSK_ENR 0x308 /* MIIGSK Enable reg */

#else

Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/net/irda/bfin_sir.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ static int bfin_sir_set_speed(struct bfin_sir_port *port, int speed)
case 57600:
case 115200:

quot = (port->clk + (8 * speed)) / (16 * speed)\
- ANOMALY_05000230;
/*
* IRDA is not affected by anomaly 05000230, so there is no
* need to tweak the divisor like he UART driver (which will
* slightly speed up the baud rate on us).
*/
quot = (port->clk + (8 * speed)) / (16 * speed);

do {
udelay(utime);
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,18 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,

err = register_netdevice(dev);
if (err < 0)
return err;
goto destroy_port;

list_add_tail(&vlan->list, &port->vlans);
netif_stacked_transfer_operstate(lowerdev, dev);

return 0;

destroy_port:
if (list_empty(&port->vlans))
macvlan_port_destroy(lowerdev);

return err;
}
EXPORT_SYMBOL_GPL(macvlan_common_newlink);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/pppoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ static void pppoe_flush_dev(struct net_device *dev)
struct pppoe_net *pn;
int i;

pn = pppoe_pernet(dev_net(dev));
write_lock_bh(&pn->hash_lock);
for (i = 0; i < PPPOE_HASH_SIZE; i++) {
struct pppox_sock *po = pn->hash_table[i];
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun,
struct sk_buff *skb;
int err;

sock_update_classid(sk);

/* Under a page? Don't bother with paged skb. */
if (prepad + len < PAGE_SIZE || !linear)
linear = len;
Expand Down
21 changes: 21 additions & 0 deletions trunk/include/linux/fec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* include/linux/fec.h
*
* Copyright (c) 2009 Orex Computed Radiography
* Baruch Siach <baruch@tkos.co.il>
*
* Header file for the FEC platform data
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __LINUX_FEC_H__
#define __LINUX_FEC_H__

#include <linux/phy.h>

struct fec_platform_data {
phy_interface_t phy;
};

#endif
2 changes: 1 addition & 1 deletion trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,7 @@ do { \
#define netif_vdbg(priv, type, dev, format, args...) \
({ \
if (0) \
netif_printk(KERN_DEBUG, dev, format, ##args); \
netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
0; \
})
#endif
Expand Down
Loading

0 comments on commit 59dbba1

Please sign in to comment.