Search Linux Wireless

RE: [PATCH v3 1/4] iwlwifi: mei: add the driver to allow cooperation with CSME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_AKM_AUTH_OPEN !=
> >> > +                  (u32)SAP_WIFI_AUTH_TYPE_OPEN);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_AKM_AUTH_RSNA !=
> >> > +                  (u32)SAP_WIFI_AUTH_TYPE_RSNA);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_AKM_AUTH_RSNA_PSK !=
> >> > +                  (u32)SAP_WIFI_AUTH_TYPE_RSNA_PSK);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_AKM_AUTH_SAE !=
> >> > +                  (u32)SAP_WIFI_AUTH_TYPE_SAE);
> >> > +
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_CIPHER_NONE !=
> >> > +                  (u32)SAP_WIFI_CIPHER_ALG_NONE);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_CIPHER_CCMP !=
> >> > +                  (u32)SAP_WIFI_CIPHER_ALG_CCMP);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_CIPHER_GCMP !=
> >> > +                  (u32)SAP_WIFI_CIPHER_ALG_GCMP);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_CIPHER_GCMP_256 !=
> >> > +                  (u32)SAP_WIFI_CIPHER_ALG_GCMP_256);
> >>
> >> These look just weird, and suspicious. You are using two different
> >> enums but they have to be same values, or what?
> >
> > Exactly. I don't want the userspace to have to include all the SAP
> > protocol header file. OTOH, I don't want to have to translate between
> > vendor commands attributes values and the SAP values.
> 
> Why not? I assume you would just need a helper function with switch
> statements to "translate" between enums, not much more lines of code but
> a lot cleaner code.
> 

I disagree that it'll give us a cleaner code.
What we'll have is two different enums with two different values and functions
that translate from one value to another. This is very bug prone. When you want
to debug, you get a value, you always need to think of what type of enum you're
dealing with.
I believe your suggestion is not good, but since I am tired arguing I will do it to
make you happy.




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux