2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-11 23:03:55 +08:00

staging driver fixes for 3.17-rc3

Here are some staging driver fixes for your tree.  Nothing huge, just
 some fixes for issues that have been reported and a few new device ids
 added.
 
 All have been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlQAukYACgkQMUfUDdst+yk3XwCfS00LSkUQnstyZdEFuCFsGBQm
 tVAAnRLPJRJ6i4fewqoP8NwW8ctuw/a3
 =Oq2w
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are some staging driver fixes for your tree.  Nothing huge, just
  some fixes for issues that have been reported and a few new device ids
  added.

  All have been in linux-next for a while"

* tag 'staging-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: r8188eu: Add new USB ID
  staging/rtl8188eu: add 0df6:0076 Sitecom Europe B.V.
  staging: android: fix a possible memory leak
  staging: lustre: lustre: libcfs: workitem.c: Cleaning up missing null-terminate after strncpy call
  staging: et131x: Fix errors caused by phydev->addr accesses before initialisation
  staging: lustre: Remove circular dependency on header
This commit is contained in:
Linus Torvalds 2014-08-29 12:04:10 -07:00
commit bbf6c0a705
5 changed files with 35 additions and 43 deletions

View File

@ -790,7 +790,7 @@ static int __init create_log(char *log_name, int size)
if (unlikely(ret)) {
pr_err("failed to register misc device for log '%s'!\n",
log->misc.name);
goto out_free_log;
goto out_free_misc_name;
}
pr_info("created %luK log '%s'\n",
@ -798,6 +798,9 @@ static int __init create_log(char *log_name, int size)
return 0;
out_free_misc_name:
kfree(log->misc.name);
out_free_log:
kfree(log);

View File

@ -1421,22 +1421,16 @@ static int et131x_mii_read(struct et131x_adapter *adapter, u8 reg, u16 *value)
* @reg: the register to read
* @value: 16-bit value to write
*/
static int et131x_mii_write(struct et131x_adapter *adapter, u8 reg, u16 value)
static int et131x_mii_write(struct et131x_adapter *adapter, u8 addr, u8 reg,
u16 value)
{
struct mac_regs __iomem *mac = &adapter->regs->mac;
struct phy_device *phydev = adapter->phydev;
int status = 0;
u8 addr;
u32 delay = 0;
u32 mii_addr;
u32 mii_cmd;
u32 mii_indicator;
if (!phydev)
return -EIO;
addr = phydev->addr;
/* Save a local copy of the registers we are dealing with so we can
* set them back
*/
@ -1631,17 +1625,7 @@ static int et131x_mdio_write(struct mii_bus *bus, int phy_addr,
struct net_device *netdev = bus->priv;
struct et131x_adapter *adapter = netdev_priv(netdev);
return et131x_mii_write(adapter, reg, value);
}
static int et131x_mdio_reset(struct mii_bus *bus)
{
struct net_device *netdev = bus->priv;
struct et131x_adapter *adapter = netdev_priv(netdev);
et131x_mii_write(adapter, MII_BMCR, BMCR_RESET);
return 0;
return et131x_mii_write(adapter, phy_addr, reg, value);
}
/* et1310_phy_power_switch - PHY power control
@ -1656,18 +1640,20 @@ static int et131x_mdio_reset(struct mii_bus *bus)
static void et1310_phy_power_switch(struct et131x_adapter *adapter, bool down)
{
u16 data;
struct phy_device *phydev = adapter->phydev;
et131x_mii_read(adapter, MII_BMCR, &data);
data &= ~BMCR_PDOWN;
if (down)
data |= BMCR_PDOWN;
et131x_mii_write(adapter, MII_BMCR, data);
et131x_mii_write(adapter, phydev->addr, MII_BMCR, data);
}
/* et131x_xcvr_init - Init the phy if we are setting it into force mode */
static void et131x_xcvr_init(struct et131x_adapter *adapter)
{
u16 lcr2;
struct phy_device *phydev = adapter->phydev;
/* Set the LED behavior such that LED 1 indicates speed (off =
* 10Mbits, blink = 100Mbits, on = 1000Mbits) and LED 2 indicates
@ -1688,7 +1674,7 @@ static void et131x_xcvr_init(struct et131x_adapter *adapter)
else
lcr2 |= (LED_VAL_LINKON << LED_TXRX_SHIFT);
et131x_mii_write(adapter, PHY_LED_2, lcr2);
et131x_mii_write(adapter, phydev->addr, PHY_LED_2, lcr2);
}
}
@ -3643,14 +3629,14 @@ static void et131x_adjust_link(struct net_device *netdev)
et131x_mii_read(adapter, PHY_MPHY_CONTROL_REG,
&register18);
et131x_mii_write(adapter, PHY_MPHY_CONTROL_REG,
register18 | 0x4);
et131x_mii_write(adapter, PHY_INDEX_REG,
et131x_mii_write(adapter, phydev->addr,
PHY_MPHY_CONTROL_REG, register18 | 0x4);
et131x_mii_write(adapter, phydev->addr, PHY_INDEX_REG,
register18 | 0x8402);
et131x_mii_write(adapter, PHY_DATA_REG,
et131x_mii_write(adapter, phydev->addr, PHY_DATA_REG,
register18 | 511);
et131x_mii_write(adapter, PHY_MPHY_CONTROL_REG,
register18);
et131x_mii_write(adapter, phydev->addr,
PHY_MPHY_CONTROL_REG, register18);
}
et1310_config_flow_control(adapter);
@ -3662,7 +3648,8 @@ static void et131x_adjust_link(struct net_device *netdev)
et131x_mii_read(adapter, PHY_CONFIG, &reg);
reg &= ~ET_PHY_CONFIG_TX_FIFO_DEPTH;
reg |= ET_PHY_CONFIG_FIFO_DEPTH_32;
et131x_mii_write(adapter, PHY_CONFIG, reg);
et131x_mii_write(adapter, phydev->addr, PHY_CONFIG,
reg);
}
et131x_set_rx_dma_timer(adapter);
@ -3675,14 +3662,14 @@ static void et131x_adjust_link(struct net_device *netdev)
et131x_mii_read(adapter, PHY_MPHY_CONTROL_REG,
&register18);
et131x_mii_write(adapter, PHY_MPHY_CONTROL_REG,
register18 | 0x4);
et131x_mii_write(adapter, PHY_INDEX_REG,
register18 | 0x8402);
et131x_mii_write(adapter, PHY_DATA_REG,
register18 | 511);
et131x_mii_write(adapter, PHY_MPHY_CONTROL_REG,
register18);
et131x_mii_write(adapter, phydev->addr,
PHY_MPHY_CONTROL_REG, register18 | 0x4);
et131x_mii_write(adapter, phydev->addr,
PHY_INDEX_REG, register18 | 0x8402);
et131x_mii_write(adapter, phydev->addr,
PHY_DATA_REG, register18 | 511);
et131x_mii_write(adapter, phydev->addr,
PHY_MPHY_CONTROL_REG, register18);
}
/* Free the packets being actively sent & stopped */
@ -4644,10 +4631,6 @@ static int et131x_pci_setup(struct pci_dev *pdev,
/* Copy address into the net_device struct */
memcpy(netdev->dev_addr, adapter->addr, ETH_ALEN);
/* Init variable for counting how long we do not have link status */
adapter->boot_coma = 0;
et1310_disable_phy_coma(adapter);
rc = -ENOMEM;
/* Setup the mii_bus struct */
@ -4663,7 +4646,6 @@ static int et131x_pci_setup(struct pci_dev *pdev,
adapter->mii_bus->priv = netdev;
adapter->mii_bus->read = et131x_mdio_read;
adapter->mii_bus->write = et131x_mdio_write;
adapter->mii_bus->reset = et131x_mdio_reset;
adapter->mii_bus->irq = kmalloc_array(PHY_MAX_ADDR, sizeof(int),
GFP_KERNEL);
if (!adapter->mii_bus->irq)
@ -4687,6 +4669,10 @@ static int et131x_pci_setup(struct pci_dev *pdev,
/* Setup et1310 as per the documentation */
et131x_adapter_setup(adapter);
/* Init variable for counting how long we do not have link status */
adapter->boot_coma = 0;
et1310_disable_phy_coma(adapter);
/* We can enable interrupts now
*
* NOTE - Because registration of interrupt handler is done in the

View File

@ -365,6 +365,7 @@ cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab,
return -ENOMEM;
strncpy(sched->ws_name, name, CFS_WS_NAME_LEN);
sched->ws_name[CFS_WS_NAME_LEN - 1] = '\0';
sched->ws_cptab = cptab;
sched->ws_cpt = cpt;

View File

@ -35,7 +35,7 @@
*/
#define DEBUG_SUBSYSTEM S_CLASS
# include <asm/atomic.h>
# include <linux/atomic.h>
#include "../include/obd_support.h"
#include "../include/obd_class.h"

View File

@ -43,9 +43,11 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0179)}, /* 8188ETV */
/*=== Customer ID ===*/
/****** 8188EUS ********/
{USB_DEVICE(0x056e, 0x4008)}, /* Elecom WDC-150SU2M */
{USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */
{USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
{USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
{} /* Terminating entry */
};