u16_t zfLnxCencAsocNotify(zdev_t *dev, u16_t *macAddr, u8_t *body, u16_t bodySize, u16_t port) { struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv; struct zydas_cenc_sta_info cenc_info; /* struct sock *netlink_sk; */ u8_t ie_len; int ii; /* Create NETLINK socket */ /*netlink_sk = netlink_kernel_create(NETLINK_USERSOCK, NULL); */ if (macp->netlink_sk == NULL) { printk(KERN_ERR "NETLINK Socket is NULL\n"); return -1; } memset(&cenc_info, 0, sizeof(cenc_info)); /* memcpy(cenc_info.gsn, vap->iv_cencmsk_keys.wk_txiv, * ZM_CENC_IV_LEN); */ zfiWlanQueryGSN(dev, cenc_info.gsn, port); cenc_info.datalen += ZM_CENC_IV_LEN; ie_len = body[1] + 2; memcpy(cenc_info.wie, body, ie_len); cenc_info.datalen += ie_len; memcpy(cenc_info.sta_mac, macAddr, 6); cenc_info.msg_type = ZM_CENC_WAI_REQUEST; cenc_info.datalen += 6 + 2; printk(KERN_ERR "===== zfwCencSendMsg, bodySize: %d =====\n", bodySize); for (ii = 0; ii < bodySize; ii++) { printk(KERN_ERR "%02x ", body[ii]); if ((ii & 0xf) == 0xf) printk(KERN_ERR "\n"); } zfLnxCencSendMsg(macp->netlink_sk, (u8_t *)&cenc_info, cenc_info.datalen+4); /* Close NETLINK socket */ /* sock_release(netlink_sk); */ return 0; }
u16_t zfLnxCencAsocNotify(zdev_t* dev, u16_t* macAddr, u8_t* body, u16_t bodySize, u16_t port) { struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv; struct zydas_cenc_sta_info cenc_info; u8_t ie_len; int ii; if (macp->netlink_sk == NULL) { printk(KERN_ERR "NETLINK Socket is NULL\n"); return -1; } memset(&cenc_info, 0, sizeof(cenc_info)); zfiWlanQueryGSN(dev, cenc_info.gsn, port); cenc_info.datalen += ZM_CENC_IV_LEN; ie_len = body[1] + 2; memcpy(cenc_info.wie, body, ie_len); cenc_info.datalen += ie_len; memcpy(cenc_info.sta_mac, macAddr, 6); cenc_info.msg_type = ZM_CENC_WAI_REQUEST; cenc_info.datalen += 6 + 2; printk(KERN_ERR "===== zfwCencSendMsg, bodySize: %d =====\n", bodySize); for(ii = 0; ii < bodySize; ii++) { printk(KERN_ERR "%02x ", body[ii]); if ((ii & 0xf) == 0xf) { printk(KERN_ERR "\n"); } } zfLnxCencSendMsg(macp->netlink_sk, (u8_t *)&cenc_info, cenc_info.datalen+4); return 0; }