As answered by @TedLyngmo in the comments, the problem was I had not included bluetooth.h in the file. The problem was
The key point is that bdaddr_t is defined in bluetooth.h and that bluetooth.h includes asm/types.h which, via other includes, defines __u8 etc.