Ah... yes, you're right. Lens protocol must be changed in the software if you yant to change it, but it is maybe not a good idea, the lens could not understand "new" protocol
But the firmware like we know it can be a part of the total software, like it can be done with microcontrollers and boot loaders, and the function af drive can be a called to somewhere else in the soft that open the lens port and so.
I may be wrong, the firmware may be the complete software, the raw lens protocol is inside... ?