Commit 396cda90 authored by Michal Nazarewicz's avatar Michal Nazarewicz Committed by Greg Kroah-Hartman

USB: Added USB_ETH_RNDIS to use instead of CONFIG_USB_ETH_RNDIS

If g_ether and g_multi are both built CONFIG_USB_ETH_RNDIS symbol
may be redefined in the later and, whats even worse, g_ether's settings
may affect g_multi's.  This adds a USB_ETH_RNDIS symbol defined at the
beginning of ether.c and multi.c according toproper KConfig settings.
Signed-off-by: default avatarMichal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3f0479e0
...@@ -25,6 +25,14 @@ ...@@ -25,6 +25,14 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/utsname.h> #include <linux/utsname.h>
#if defined USB_ETH_RNDIS
# undef USB_ETH_RNDIS
#endif
#ifdef CONFIG_USB_ETH_RNDIS
# define USB_ETH_RNDIS y
#endif
#include "u_ether.h" #include "u_ether.h"
...@@ -66,7 +74,7 @@ ...@@ -66,7 +74,7 @@
#define DRIVER_DESC "Ethernet Gadget" #define DRIVER_DESC "Ethernet Gadget"
#define DRIVER_VERSION "Memorial Day 2008" #define DRIVER_VERSION "Memorial Day 2008"
#ifdef CONFIG_USB_ETH_RNDIS #ifdef USB_ETH_RNDIS
#define PREFIX "RNDIS/" #define PREFIX "RNDIS/"
#else #else
#define PREFIX "" #define PREFIX ""
...@@ -87,7 +95,7 @@ ...@@ -87,7 +95,7 @@
static inline bool has_rndis(void) static inline bool has_rndis(void)
{ {
#ifdef CONFIG_USB_ETH_RNDIS #ifdef USB_ETH_RNDIS
return true; return true;
#else #else
return false; return false;
...@@ -110,7 +118,7 @@ static inline bool has_rndis(void) ...@@ -110,7 +118,7 @@ static inline bool has_rndis(void)
#include "f_ecm.c" #include "f_ecm.c"
#include "f_subset.c" #include "f_subset.c"
#ifdef CONFIG_USB_ETH_RNDIS #ifdef USB_ETH_RNDIS
#include "f_rndis.c" #include "f_rndis.c"
#include "rndis.c" #include "rndis.c"
#endif #endif
...@@ -251,7 +259,7 @@ static struct usb_configuration rndis_config_driver = { ...@@ -251,7 +259,7 @@ static struct usb_configuration rndis_config_driver = {
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#ifdef CONFIG_USB_ETH_EEM #ifdef USB_ETH_EEM
static int use_eem = 1; static int use_eem = 1;
#else #else
static int use_eem; static int use_eem;
......
...@@ -26,8 +26,11 @@ ...@@ -26,8 +26,11 @@
#include <linux/utsname.h> #include <linux/utsname.h>
#if defined CONFIG_USB_G_MULTI_RNDIS #if defined USB_ETH_RNDIS
# define CONFIG_USB_ETH_RNDIS y # undef USB_ETH_RNDIS
#endif
#ifdef CONFIG_USB_ETH_RNDIS
# define USB_ETH_RNDIS y
#endif #endif
...@@ -59,7 +62,7 @@ ...@@ -59,7 +62,7 @@
#include "f_ecm.c" #include "f_ecm.c"
#include "f_subset.c" #include "f_subset.c"
#ifdef CONFIG_USB_ETH_RNDIS #ifdef USB_ETH_RNDIS
# include "f_rndis.c" # include "f_rndis.c"
# include "rndis.c" # include "rndis.c"
#endif #endif
...@@ -150,7 +153,7 @@ FSG_MODULE_PARAMETERS(/* no prefix */, mod_data); ...@@ -150,7 +153,7 @@ FSG_MODULE_PARAMETERS(/* no prefix */, mod_data);
static struct fsg_common *fsg_common; static struct fsg_common *fsg_common;
#ifdef CONFIG_USB_ETH_RNDIS #ifdef USB_ETH_RNDIS
static int __init rndis_do_config(struct usb_configuration *c) static int __init rndis_do_config(struct usb_configuration *c)
{ {
...@@ -292,7 +295,7 @@ static int __init multi_bind(struct usb_composite_dev *cdev) ...@@ -292,7 +295,7 @@ static int __init multi_bind(struct usb_composite_dev *cdev)
strings_dev[STRING_PRODUCT_IDX].id = status; strings_dev[STRING_PRODUCT_IDX].id = status;
device_desc.iProduct = status; device_desc.iProduct = status;
#ifdef CONFIG_USB_ETH_RNDIS #ifdef USB_ETH_RNDIS
/* register our first configuration */ /* register our first configuration */
status = usb_add_config(cdev, &rndis_config_driver); status = usb_add_config(cdev, &rndis_config_driver);
if (status < 0) if (status < 0)
......
...@@ -112,7 +112,7 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); ...@@ -112,7 +112,7 @@ int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
int eem_bind_config(struct usb_configuration *c); int eem_bind_config(struct usb_configuration *c);
#ifdef CONFIG_USB_ETH_RNDIS #ifdef USB_ETH_RNDIS
int rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); int rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]);
......
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