As this function is exposed in the API, I think the assertions should be replaced by returns of BLADERF_ERR_INVAL.

I've encountered a few cases where someone using the API had forgotten to initialize enumeration values, either triggering asserts or unexpected default switch cases.  While it's a case of "garbage in, garbage out", I think it's helpful to API users to receive error values in such cases, rather than have the thing bail out on an assertion.

Also, in this case (or the bogus value case), we'd need to ensure the value isn't > our max tag value.