Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Jul 2011 12:58:19 +0000 (05:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Jul 2011 12:58:19 +0000 (05:58 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (32 commits)
  tg3: Remove 5719 jumbo frames and TSO blocks
  tg3: Break larger frags into 4k chunks for 5719
  tg3: Add tx BD budgeting code
  tg3: Consolidate code that calls tg3_tx_set_bd()
  tg3: Add partial fragment unmapping code
  tg3: Generalize tg3_skb_error_unmap()
  tg3: Remove short DMA check for 1st fragment
  tg3: Simplify tx bd assignments
  tg3: Reintroduce tg3_tx_ring_info
  ASIX: Use only 11 bits of header for data size
  ASIX: Simplify condition in rx_fixup()
  Fix cdc-phonet build
  bonding: reduce noise during init
  bonding: fix string comparison errors
  net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
  net: add IFF_SKB_TX_SHARED flag to priv_flags
  net: sock_sendmsg_nosec() is static
  forcedeth: fix vlans
  gianfar: fix bug caused by 87c288c6e9aa31720b72e2bc2d665e24e1653c3e
  gro: Only reset frag0 when skb can be pulled
  ...

1  2 
drivers/staging/ath6kl/os/linux/ar6000_drv.c
include/linux/netdevice.h
net/socket.c

@@@ -954,13 -954,9 +954,13 @@@ ar6000_transfer_bin_file(struct ar6_sof
      const char *filename;
      const struct firmware *fw_entry;
      u32 fw_entry_size;
 +    u8 **buf;
 +    size_t *buf_len;
  
      switch (file) {
          case AR6K_OTP_FILE:
 +              buf = &ar->fw_otp;
 +              buf_len = &ar->fw_otp_len;
              if (ar->arVersion.target_ver == AR6003_REV1_VERSION) {
                  filename = AR6003_REV1_OTP_FILE;
              } else if (ar->arVersion.target_ver == AR6003_REV2_VERSION) {
              break;
  
          case AR6K_FIRMWARE_FILE:
 +              buf = &ar->fw;
 +              buf_len = &ar->fw_len;
              if (ar->arVersion.target_ver == AR6003_REV1_VERSION) {
                  filename = AR6003_REV1_FIRMWARE_FILE;
              } else if (ar->arVersion.target_ver == AR6003_REV2_VERSION) {
              break;
  
          case AR6K_PATCH_FILE:
 +              buf = &ar->fw_patch;
 +              buf_len = &ar->fw_patch_len;
              if (ar->arVersion.target_ver == AR6003_REV1_VERSION) {
                  filename = AR6003_REV1_PATCH_FILE;
              } else if (ar->arVersion.target_ver == AR6003_REV2_VERSION) {
              break;
  
          case AR6K_BOARD_DATA_FILE:
 +              buf = &ar->fw_data;
 +              buf_len = &ar->fw_data_len;
              if (ar->arVersion.target_ver == AR6003_REV1_VERSION) {
                  filename = AR6003_REV1_BOARD_DATA_FILE;
              } else if (ar->arVersion.target_ver == AR6003_REV2_VERSION) {
              AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unknown file type: %d\n", file));
              return A_ERROR;
      }
 -    if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0)
 -    {
 -        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename));
 -        return A_ENOENT;
 +
 +    if (*buf == NULL) {
 +          if ((A_REQUEST_FIRMWARE(&fw_entry, filename, ((struct device *)ar->osDevInfo.pOSDevice))) != 0) {
 +                  AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to get %s\n", filename));
 +                  return A_ENOENT;
 +          }
 +
 +          *buf = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
 +          *buf_len = fw_entry->size;
 +          A_RELEASE_FIRMWARE(fw_entry);
      }
  
  #ifdef SOFTMAC_FILE_USED
 -    if (file==AR6K_BOARD_DATA_FILE && fw_entry->data) {
 -        ar6000_softmac_update(ar, (u8 *)fw_entry->data, fw_entry->size);
 +    if (file==AR6K_BOARD_DATA_FILE && *buf_len) {
 +        ar6000_softmac_update(ar, *buf, *buf_len);
      }
  #endif 
  
  
 -    fw_entry_size = fw_entry->size;
 +    fw_entry_size = *buf_len;
  
      /* Load extended board data for AR6003 */
 -    if ((file==AR6K_BOARD_DATA_FILE) && (fw_entry->data)) {
 +    if ((file==AR6K_BOARD_DATA_FILE) && *buf) {
          u32 board_ext_address;
          u32 board_ext_data_size;
          u32 board_data_size;
          AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("Board extended Data download address: 0x%x\n", board_ext_address));
  
          /* check whether the target has allocated memory for extended board data and file contains extended board data */
 -        if ((board_ext_address) && (fw_entry->size == (board_data_size + board_ext_data_size))) {
 +        if ((board_ext_address) && (*buf_len == (board_data_size + board_ext_data_size))) {
              u32 param;
  
 -            status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (u8 *)(fw_entry->data + board_data_size), board_ext_data_size);
 +            status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (u8 *)(*buf + board_data_size), board_ext_data_size);
  
              if (status) {
                  AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
 -                A_RELEASE_FIRMWARE(fw_entry);
                  return A_ERROR;
              }
  
      }
  
      if (compressed) {
 -        status = BMIFastDownload(ar->arHifDevice, address, (u8 *)fw_entry->data, fw_entry_size);
 +        status = BMIFastDownload(ar->arHifDevice, address, *buf, fw_entry_size);
      } else {
 -        status = BMIWriteMemory(ar->arHifDevice, address, (u8 *)fw_entry->data, fw_entry_size);
 +        status = BMIWriteMemory(ar->arHifDevice, address, *buf, fw_entry_size);
      }
  
      if (status) {
          AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
 -        A_RELEASE_FIRMWARE(fw_entry);
          return A_ERROR;
      }
 -    A_RELEASE_FIRMWARE(fw_entry);
 +
      return 0;
  }
  
@@@ -2102,11 -2088,6 +2102,11 @@@ ar6000_destroy(struct net_device *dev, 
      ar6000_remove_ap_interface();
  #endif /*CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */
  
 +    kfree(ar->fw_otp);
 +    kfree(ar->fw);
 +    kfree(ar->fw_patch);
 +    kfree(ar->fw_data);
 +
      AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("-ar6000_destroy \n"));
  }
  
@@@ -4133,13 -4114,6 +4133,13 @@@ ar6000_ready_event(void *devt, u8 *data
      ar->arVersion.wlan_ver = sw_ver;
      ar->arVersion.abi_ver = abi_ver;
  
 +    snprintf(ar->wdev->wiphy->fw_version, sizeof(ar->wdev->wiphy->fw_version),
 +           "%u:%u:%u:%u",
 +           (ar->arVersion.wlan_ver & 0xf0000000) >> 28,
 +           (ar->arVersion.wlan_ver & 0x0f000000) >> 24,
 +           (ar->arVersion.wlan_ver & 0x00ff0000) >> 16,
 +           (ar->arVersion.wlan_ver & 0x0000ffff));
 +
      /* Indicate to the waiting thread that the ready event was received */
      ar->arWmiReady = true;
      wake_up(&arEvent);
@@@ -6205,6 -6179,7 +6205,7 @@@ int ar6000_create_ap_interface(struct a
      
      ether_setup(dev);
      init_netdev(dev, ap_ifname);
+     dev->priv_flags &= ~IFF_TX_SKB_SHARING;
  
      if (register_netdev(dev)) {
          AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_create_ap_interface: register_netdev failed\n"));
@@@ -34,7 -34,7 +34,7 @@@
  #include <linux/pm_qos_params.h>
  #include <linux/timer.h>
  #include <linux/delay.h>
 -#include <asm/atomic.h>
 +#include <linux/atomic.h>
  #include <asm/cache.h>
  #include <asm/byteorder.h>
  
@@@ -1132,7 -1132,7 +1132,7 @@@ struct net_device 
        spinlock_t              addr_list_lock;
        struct netdev_hw_addr_list      uc;     /* Unicast mac addresses */
        struct netdev_hw_addr_list      mc;     /* Multicast mac addresses */
-       int                     uc_promisc;
+       bool                    uc_promisc;
        unsigned int            promiscuity;
        unsigned int            allmulti;
  
@@@ -1521,39 -1521,6 +1521,39 @@@ struct packet_type 
  
  #include <linux/notifier.h>
  
 +/* netdevice notifier chain. Please remember to update the rtnetlink
 + * notification exclusion list in rtnetlink_event() when adding new
 + * types.
 + */
 +#define NETDEV_UP     0x0001  /* For now you can't veto a device up/down */
 +#define NETDEV_DOWN   0x0002
 +#define NETDEV_REBOOT 0x0003  /* Tell a protocol stack a network interface
 +                                 detected a hardware crash and restarted
 +                                 - we can use this eg to kick tcp sessions
 +                                 once done */
 +#define NETDEV_CHANGE 0x0004  /* Notify device state change */
 +#define NETDEV_REGISTER 0x0005
 +#define NETDEV_UNREGISTER     0x0006
 +#define NETDEV_CHANGEMTU      0x0007
 +#define NETDEV_CHANGEADDR     0x0008
 +#define NETDEV_GOING_DOWN     0x0009
 +#define NETDEV_CHANGENAME     0x000A
 +#define NETDEV_FEAT_CHANGE    0x000B
 +#define NETDEV_BONDING_FAILOVER 0x000C
 +#define NETDEV_PRE_UP         0x000D
 +#define NETDEV_PRE_TYPE_CHANGE        0x000E
 +#define NETDEV_POST_TYPE_CHANGE       0x000F
 +#define NETDEV_POST_INIT      0x0010
 +#define NETDEV_UNREGISTER_BATCH 0x0011
 +#define NETDEV_RELEASE                0x0012
 +#define NETDEV_NOTIFY_PEERS   0x0013
 +#define NETDEV_JOIN           0x0014
 +
 +extern int register_netdevice_notifier(struct notifier_block *nb);
 +extern int unregister_netdevice_notifier(struct notifier_block *nb);
 +extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
 +
 +
  extern rwlock_t                               dev_base_lock;          /* Device list lock */
  
  
@@@ -1636,9 -1603,12 +1636,9 @@@ static inline void unregister_netdevice
  extern int            netdev_refcnt_read(const struct net_device *dev);
  extern void           free_netdev(struct net_device *dev);
  extern void           synchronize_net(void);
 -extern int            register_netdevice_notifier(struct notifier_block *nb);
 -extern int            unregister_netdevice_notifier(struct notifier_block *nb);
  extern int            init_dummy_netdev(struct net_device *dev);
  extern void           netdev_resync_ops(struct net_device *dev);
  
 -extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
  extern struct net_device      *dev_get_by_index(struct net *net, int ifindex);
  extern struct net_device      *__dev_get_by_index(struct net *net, int ifindex);
  extern struct net_device      *dev_get_by_index_rcu(struct net *net, int ifindex);
@@@ -1679,9 -1649,12 +1679,12 @@@ static inline int skb_gro_header_hard(s
  static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
                                        unsigned int offset)
  {
+       if (!pskb_may_pull(skb, hlen))
+               return NULL;
        NAPI_GRO_CB(skb)->frag0 = NULL;
        NAPI_GRO_CB(skb)->frag0_len = 0;
-       return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL;
+       return skb->data + offset;
  }
  
  static inline void *skb_gro_mac_header(struct sk_buff *skb)
diff --combined net/socket.c
@@@ -467,7 -467,7 +467,7 @@@ static struct socket *sock_alloc(void
        struct inode *inode;
        struct socket *sock;
  
 -      inode = new_inode(sock_mnt->mnt_sb);
 +      inode = new_inode_pseudo(sock_mnt->mnt_sb);
        if (!inode)
                return NULL;
  
@@@ -580,7 -580,7 +580,7 @@@ int sock_sendmsg(struct socket *sock, s
  }
  EXPORT_SYMBOL(sock_sendmsg);
  
- int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg, size_t size)
static int sock_sendmsg_nosec(struct socket *sock, struct msghdr *msg, size_t size)
  {
        struct kiocb iocb;
        struct sock_iocb siocb;