+ if (optname >> 16 == 0) {
+ switch (optname) {
+ case RFID_OPT_LAYER2_UID:
+ printf("----> sizeof(ph->uid): %d\n",sizeof(ph->uid));
+ if ((ph->uid_len < sizeof(ph->uid)) && (optlen<=sizeof(ph->uid))) {
+ //(ph->uid_len<optlen)
+ ph->uid_len = optlen;
+ memcpy(ph->uid, optval, optlen);
+ } else
+ return -EINVAL;
+ break;
+ default:
+ return -EINVAL;
+ break;
+ }
+ } else {
+ if (!ph->l2->fn.setopt)
+ return -EINVAL;
+
+ return ph->l2->fn.setopt(ph, optname, optval, optlen);
+ }
+ return 0;
+}