| 1 |
|
| 2 | |
| 3 | * u_ecm.h
|
| 4 | *
|
| 5 | * Utility definitions for the ecm function
|
| 6 | *
|
| 7 | * Copyright (c) 2013 Samsung Electronics Co., Ltd.
|
| 8 | * http://www.samsung.com
|
| 9 | *
|
| 10 | * Author: Andrzej Pietrasiewicz <[email protected]>
|
| 11 |
|
| 12 |
|
| 13 | #ifndef U_ECM_H
|
| 14 | #define U_ECM_H
|
| 15 |
|
| 16 | #include <linux/usb/composite.h>
|
| 17 |
|
| 18 | |
| 19 | * struct f_ecm_opts - ECM function options
|
| 20 | * @func_inst: USB function instance.
|
| 21 | * @net: The net_device associated with the ECM function.
|
| 22 | * @bound: True if the net_device is shared and pre-registered during the
|
| 23 | * legacy composite driver's bind phase (e.g., multi.c). If false,
|
| 24 | * the ECM function will register the net_device during its own
|
| 25 | * bind phase.
|
| 26 | * @bind_count: Tracks the number of configurations the ECM function is
|
| 27 | * bound to, preventing double-registration of the @net device.
|
| 28 | * @lock: Protects the data from concurrent access by configfs read/write
|
| 29 | * and create symlink/remove symlink operations.
|
| 30 | * @refcnt: Reference counter for the function instance.
|
| 31 |
|
| 32 | struct f_ecm_opts {
|
| 33 | struct usb_function_instance func_inst;
|
| 34 | struct net_device *net;
|
| 35 | bool bound;
|
| 36 | int bind_count;
|
| 37 |
|
| 38 | struct mutex lock;
|
| 39 | int refcnt;
|
| 40 | };
|
| 41 |
|
| 42 | #endif
|