In the current context it yields only obfuscation, with absolutely no benefit, so let's get rid of it. There are layers of crazy name mapping. A structure named VCP_fops is set up and initialized with actual functions like VCP_Init(). But then this is mapped to APP_FOPS and that is used to make calls like the following, that I will change as shown:
APP_FOPS.pIf_Init(pdev); VCP_Init(pdev);Who knows what pIf stands for, perhaps "Polish International Federation", but that is just a guess -- but it is going away.
This one pops up in usbd_core.c. This one is USR_cb which governs calls to usbd_usr.c (note also: usbd_usr.h). This is only a 163 line file and deals entirely with manipulating 3 bits in a private variable "usbd_status". We can move all of this to usbd_core.c, get rid of two files and this callback and its associated functions. In fact almost all of usbd_usr.h can be deleted. Why not?
So, I did it, condensing and moving what was in usbd_usr.* into what I now call "core.c" (I renamed usbd_core.c after getting tired of the extra typing).
As I am examining usbd_core.c, I discover another lurking callback structure:
USBD_DCD_INT_cbWe will look at this later. It seems to govern calls from the driver up into "library" as a result of things that take place during interrupts. All the callbacks seem to be in core.c, so I may prefix their names with CORE_ and dive in.
Tom's Computer Info / tom@mmto.org