Commit 40d133d7 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

usb: gadget: f_ncm: convert to new function interface with backward compatibility

Converting ncm to the new function interface requires converting
the USB ncm's function code and its users.

This patch converts the f_ncm.c to the new function interface.

The file is now compiled into a separate usb_f_ncm.ko module.

The old function interface is provided by means of a preprocessor
conditional directives. After all users are converted, the old interface
can be removed.
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent bcd4a1c4
......@@ -511,6 +511,9 @@ config USB_F_SERIAL
config USB_F_OBEX
tristate
config USB_F_NCM
tristate
choice
tristate "USB Gadget Drivers"
default USB_ETH
......
......@@ -48,6 +48,8 @@ obj-$(CONFIG_USB_F_OBEX) += usb_f_obex.o
obj-$(CONFIG_USB_U_ETHER) += u_ether.o
u_rndis-y := rndis.o
obj-$(CONFIG_USB_U_RNDIS) += u_rndis.o
usb_f_ncm-y := f_ncm.o
obj-$(CONFIG_USB_F_NCM) += usb_f_ncm.o
#
# USB gadget drivers
......
This diff is collapsed.
......@@ -36,6 +36,7 @@
* the runtime footprint, and giving us at least some parts of what
* a "gcc --combine ... part1.c part2.c part3.c ... " build would.
*/
#define USB_FNCM_INCLUDED
#include "f_ncm.c"
/*-------------------------------------------------------------------------*/
......
/*
* u_ncm.h
*
* Utility definitions for the ncm function
*
* Copyright (c) 2013 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
*
* 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 U_NCM_H
#define U_NCM_H
#include <linux/usb/composite.h>
struct f_ncm_opts {
struct usb_function_instance func_inst;
struct net_device *net;
bool bound;
};
#endif /* U_NCM_H */
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