That, it won't know. But the developers of the driver will know what firmware is recommended to work with it (it was written and tested to work with), and whether it's Free.
As soon as Free firmware is developed for a hardware component (and any driver adjustments are made for it, as in b43), the kernel will likely be the first component to know about it.
(I use quotes because anthropomorphizing programs is a bad idea: they don't like when we do that ;-)