lkml.org 
[lkml]   [2023]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RESEND net-next v7] wwan: core: Support slicing in port TX flow of WWAN subsystem
On Wed, 8 Mar 2023 16:19:35 +0800 haozhe.chang@mediatek.com wrote:
> /**
> * wwan_create_port - Add a new WWAN port
> * @parent: Device to use as parent and shared by all WWAN ports
> * @type: WWAN port type
> * @ops: WWAN port operations
> + * @frag_len: WWAN port TX fragments length, if WWAN_NO_FRAGMENT is set,
> + * the WWAN core don't fragment control packages.
> + * @headroom_len: WWAN port TX fragments reserved headroom length, if WWAN_NO_HEADROOM
> + * is set, the WWAN core don't reserve headroom in control packages.
> * @drvdata: Pointer to caller driver data
> *
> * Allocate and register a new WWAN port. The port will be automatically exposed
> @@ -86,6 +100,8 @@ struct wwan_port_ops {
> struct wwan_port *wwan_create_port(struct device *parent,
> enum wwan_port_type type,
> const struct wwan_port_ops *ops,
> + size_t frag_len,
> + unsigned int headroom_len,
> void *drvdata);
>

Too many arguments, and poor extensibility.
Please wrap the new params into a capability struct:

struct wwan_port_caps {
unsigned int frag_len;
unsigned int headroom_len;
};

pass a pointer to this kind of structure in.

Next time someone needs to add a quirk they can just add a field and
won't need to change all the drivers.

\
 
 \ /
  Last update: 2023-03-27 00:57    [W:0.031 / U:1.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site