On Wed, Mar 31, 2021 at 05:30:50PM +0200, Loic Poulain wrote: > > As it is, the code you have here just implements the misc device layer, > > but with a new major number? why??? > > Right, Instead of creating yet another specific character driver for > WWAN (like usb wdm_class), the goal would be to have at least the WWAN > control ports being exposed the same way via this WWAN class and cdev. > Then extend the framework with additional features (e.g. ports ioctls, > network interface attaching). I agree that for now, it's similar to > what misc already doing. > > From this discussion, I see two options: > - Move fops implementation to WWAN core. > - Simply get rid of this generic WWAN layer and just rely on misc for > exposing the MHI WWAN control ports. You can use misc, but how many of these are you going to want to have? You still need a set of fops and handling of the device node in a common place to ensure that all individual drivers that want to implement a wwan protocol do it all identically. You can not rely on the individual drivers to do this, that's exactly what you are trying to prevent here. So split this up by wwan type and handle that in the "core" you are creating properly, and then have your hardware driver tie into that. Just like all other common class api interfaces, nothing new here... thanks, greg k-h