diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2014-07-31 04:36:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-01 17:43:37 -0400 |
commit | c8875b2f1fc830f07cd08b8b5bce99471bfcffd9 (patch) | |
tree | 512bfb2a7fbab78bf5655d9d87efa9d9c2f3ccb0 | |
parent | 06736c291492f90f779fe6127431036b73b0a7b4 (diff) |
staging: rtl8723au: Do not duplicate kernel provided USB macros
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8723au/os_dep/usb_intf.c | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/drivers/staging/rtl8723au/os_dep/usb_intf.c b/drivers/staging/rtl8723au/os_dep/usb_intf.c index 06c885f7856e..c5ff1b8e85e8 100644 --- a/drivers/staging/rtl8723au/os_dep/usb_intf.c +++ b/drivers/staging/rtl8723au/os_dep/usb_intf.c | |||
@@ -59,44 +59,19 @@ static struct usb_driver rtl8723a_usb_drv = { | |||
59 | 59 | ||
60 | static struct usb_driver *usb_drv = &rtl8723a_usb_drv; | 60 | static struct usb_driver *usb_drv = &rtl8723a_usb_drv; |
61 | 61 | ||
62 | static inline int RT_usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) | ||
63 | { | ||
64 | return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN; | ||
65 | } | ||
66 | |||
67 | static inline int RT_usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd) | ||
68 | { | ||
69 | return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT; | ||
70 | } | ||
71 | |||
72 | static inline int RT_usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd) | ||
73 | { | ||
74 | return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT; | ||
75 | } | ||
76 | |||
77 | static inline int RT_usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd) | ||
78 | { | ||
79 | return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK; | ||
80 | } | ||
81 | |||
82 | static inline int RT_usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd) | 62 | static inline int RT_usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd) |
83 | { | 63 | { |
84 | return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_in(epd); | 64 | return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd); |
85 | } | 65 | } |
86 | 66 | ||
87 | static inline int RT_usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd) | 67 | static inline int RT_usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd) |
88 | { | 68 | { |
89 | return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_out(epd); | 69 | return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd); |
90 | } | 70 | } |
91 | 71 | ||
92 | static inline int RT_usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) | 72 | static inline int RT_usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) |
93 | { | 73 | { |
94 | return RT_usb_endpoint_xfer_int(epd) && RT_usb_endpoint_dir_in(epd); | 74 | return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); |
95 | } | ||
96 | |||
97 | static inline int RT_usb_endpoint_num(const struct usb_endpoint_descriptor *epd) | ||
98 | { | ||
99 | return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | ||
100 | } | 75 | } |
101 | 76 | ||
102 | static int rtw_init_intf_priv(struct dvobj_priv *dvobj) | 77 | static int rtw_init_intf_priv(struct dvobj_priv *dvobj) |
@@ -173,25 +148,25 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf) | |||
173 | 148 | ||
174 | if (RT_usb_endpoint_is_bulk_in(pendp_desc)) { | 149 | if (RT_usb_endpoint_is_bulk_in(pendp_desc)) { |
175 | DBG_8723A("RT_usb_endpoint_is_bulk_in = %x\n", | 150 | DBG_8723A("RT_usb_endpoint_is_bulk_in = %x\n", |
176 | RT_usb_endpoint_num(pendp_desc)); | 151 | usb_endpoint_num(pendp_desc)); |
177 | pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = | 152 | pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = |
178 | RT_usb_endpoint_num(pendp_desc); | 153 | usb_endpoint_num(pendp_desc); |
179 | pdvobjpriv->RtNumInPipes++; | 154 | pdvobjpriv->RtNumInPipes++; |
180 | } else if (RT_usb_endpoint_is_int_in(pendp_desc)) { | 155 | } else if (RT_usb_endpoint_is_int_in(pendp_desc)) { |
181 | DBG_8723A("RT_usb_endpoint_is_int_in = %x, Interval = %x\n", | 156 | DBG_8723A("RT_usb_endpoint_is_int_in = %x, Interval = %x\n", |
182 | RT_usb_endpoint_num(pendp_desc), | 157 | usb_endpoint_num(pendp_desc), |
183 | pendp_desc->bInterval); | 158 | pendp_desc->bInterval); |
184 | pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = | 159 | pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = |
185 | RT_usb_endpoint_num(pendp_desc); | 160 | usb_endpoint_num(pendp_desc); |
186 | pdvobjpriv->RtNumInPipes++; | 161 | pdvobjpriv->RtNumInPipes++; |
187 | } else if (RT_usb_endpoint_is_bulk_out(pendp_desc)) { | 162 | } else if (RT_usb_endpoint_is_bulk_out(pendp_desc)) { |
188 | DBG_8723A("RT_usb_endpoint_is_bulk_out = %x\n", | 163 | DBG_8723A("RT_usb_endpoint_is_bulk_out = %x\n", |
189 | RT_usb_endpoint_num(pendp_desc)); | 164 | usb_endpoint_num(pendp_desc)); |
190 | pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] = | 165 | pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] = |
191 | RT_usb_endpoint_num(pendp_desc); | 166 | usb_endpoint_num(pendp_desc); |
192 | pdvobjpriv->RtNumOutPipes++; | 167 | pdvobjpriv->RtNumOutPipes++; |
193 | } | 168 | } |
194 | pdvobjpriv->ep_num[i] = RT_usb_endpoint_num(pendp_desc); | 169 | pdvobjpriv->ep_num[i] = usb_endpoint_num(pendp_desc); |
195 | } | 170 | } |
196 | } | 171 | } |
197 | DBG_8723A("nr_endpoint =%d, in_num =%d, out_num =%d\n\n", | 172 | DBG_8723A("nr_endpoint =%d, in_num =%d, out_num =%d\n\n", |