Lines Matching refs:configNr
68 static rndis_resp_t *rndis_add_response (int configNr, u32 length);
156 gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
219 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium);
227 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium);
234 if (rndis_per_dev_params [configNr].dev) {
236 rndis_per_dev_params [configNr].dev->mtu);
245 if (rndis_per_dev_params [configNr].media_state
250 rndis_per_dev_params [configNr].speed);
257 if (rndis_per_dev_params [configNr].dev) {
259 rndis_per_dev_params [configNr].dev->mtu);
267 if (rndis_per_dev_params [configNr].dev) {
269 rndis_per_dev_params [configNr].dev->mtu);
278 rndis_per_dev_params [configNr].vendorID);
285 length = strlen (rndis_per_dev_params [configNr].vendorDescr);
287 rndis_per_dev_params [configNr].vendorDescr, length);
301 *outbuf = cpu_to_le32 (*rndis_per_dev_params[configNr].filter);
316 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
345 if (rndis_per_dev_params [configNr].stats) {
347 rndis_per_dev_params [configNr].stats->tx_packets -
348 rndis_per_dev_params [configNr].stats->tx_errors -
349 rndis_per_dev_params [configNr].stats->tx_dropped);
358 if (rndis_per_dev_params [configNr].stats) {
360 rndis_per_dev_params [configNr].stats->rx_packets -
361 rndis_per_dev_params [configNr].stats->rx_errors -
362 rndis_per_dev_params [configNr].stats->rx_dropped);
371 if (rndis_per_dev_params [configNr].stats) {
372 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
382 if (rndis_per_dev_params [configNr].stats) {
383 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
392 if (rndis_per_dev_params [configNr].stats) {
393 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
407 if (rndis_per_dev_params [configNr].stats) {
409 (rndis_per_dev_params [configNr]
411 rndis_per_dev_params [configNr]
413 rndis_per_dev_params [configNr]
423 if (rndis_per_dev_params [configNr].stats) {
425 (rndis_per_dev_params [configNr]
427 rndis_per_dev_params [configNr]
429 rndis_per_dev_params [configNr]
438 if (rndis_per_dev_params [configNr].stats) {
439 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
447 if (rndis_per_dev_params [configNr].stats) {
448 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
456 if (rndis_per_dev_params [configNr].stats) {
457 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
465 if (rndis_per_dev_params [configNr].stats) {
466 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
486 if (rndis_per_dev_params [configNr].stats) {
487 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
495 if (rndis_per_dev_params [configNr].stats) {
496 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
504 if (rndis_per_dev_params [configNr].stats) {
505 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
513 if (rndis_per_dev_params [configNr].stats) {
514 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
522 if (rndis_per_dev_params [configNr].stats) {
523 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
541 if (rndis_per_dev_params [configNr].dev) {
544 rndis_per_dev_params [configNr].host_mac,
553 if (rndis_per_dev_params [configNr].dev) {
556 rndis_per_dev_params [configNr].host_mac,
587 if (rndis_per_dev_params [configNr].stats) {
588 *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
679 static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
707 params = &rndis_per_dev_params [configNr];
785 static int rndis_init_response (int configNr, rndis_init_msg_type *buf)
790 if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP;
792 r = rndis_add_response (configNr, sizeof (rndis_init_cmplt_type));
808 rndis_per_dev_params [configNr].dev->mtu
816 if (rndis_per_dev_params [configNr].ack)
817 rndis_per_dev_params [configNr].ack (
818 rndis_per_dev_params [configNr].dev);
823 static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
829 if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP;
837 r = rndis_add_response (configNr,
846 if (gen_ndis_query_resp (configNr, le32_to_cpu (buf->OID),
860 if (rndis_per_dev_params [configNr].ack)
861 rndis_per_dev_params [configNr].ack (
862 rndis_per_dev_params [configNr].dev);
866 static int rndis_set_response (int configNr, rndis_set_msg_type *buf)
872 r = rndis_add_response (configNr, sizeof (rndis_set_cmplt_type));
895 if (gen_ndis_set_resp (configNr, le32_to_cpu (buf->OID),
901 if (rndis_per_dev_params [configNr].ack)
902 rndis_per_dev_params [configNr].ack (
903 rndis_per_dev_params [configNr].dev);
908 static int rndis_reset_response (int configNr, rndis_reset_msg_type *buf)
913 r = rndis_add_response (configNr, sizeof (rndis_reset_cmplt_type));
924 if (rndis_per_dev_params [configNr].ack)
925 rndis_per_dev_params [configNr].ack (
926 rndis_per_dev_params [configNr].dev);
931 static int rndis_keepalive_response (int configNr,
939 r = rndis_add_response (configNr, sizeof (rndis_keepalive_cmplt_type));
950 if (rndis_per_dev_params [configNr].ack)
951 rndis_per_dev_params [configNr].ack (
952 rndis_per_dev_params [configNr].dev);
961 static int rndis_indicate_status_msg (int configNr, u32 status)
966 if (rndis_per_dev_params [configNr].state == RNDIS_UNINITIALIZED)
969 r = rndis_add_response (configNr,
982 if (rndis_per_dev_params [configNr].ack)
983 rndis_per_dev_params [configNr].ack (
984 rndis_per_dev_params [configNr].dev);
988 int rndis_signal_connect (int configNr)
990 rndis_per_dev_params [configNr].media_state
992 return rndis_indicate_status_msg (configNr,
996 int rndis_signal_disconnect (int configNr)
998 rndis_per_dev_params [configNr].media_state
1000 return rndis_indicate_status_msg (configNr,
1004 void rndis_uninit (int configNr)
1009 if (configNr >= RNDIS_MAX_CONFIGS)
1011 rndis_per_dev_params [configNr].used = 0;
1012 rndis_per_dev_params [configNr].state = RNDIS_UNINITIALIZED;
1015 while ((buf = rndis_get_next_response(configNr, &length)))
1016 rndis_free_response(configNr, buf);
1019 void rndis_set_host_mac (int configNr, const u8 *addr)
1021 rndis_per_dev_params [configNr].host_mac = addr;
1027 int rndis_msg_parser (u8 configNr, u8 *buf)
1040 if (configNr >= RNDIS_MAX_CONFIGS)
1042 params = &rndis_per_dev_params [configNr];
1055 return rndis_init_response (configNr,
1069 return rndis_query_response (configNr,
1073 return rndis_set_response (configNr,
1079 return rndis_reset_response (configNr,
1087 return rndis_keepalive_response (configNr,
1133 DEBUG("%s: configNr = %d\n", __FUNCTION__, i);
1142 void rndis_deregister (int configNr)
1146 if (configNr >= RNDIS_MAX_CONFIGS) return;
1147 rndis_per_dev_params [configNr].used = 0;
1152 int rndis_set_param_dev (u8 configNr, struct net_device *dev,
1158 if (configNr >= RNDIS_MAX_CONFIGS) return -1;
1160 rndis_per_dev_params [configNr].dev = dev;
1161 rndis_per_dev_params [configNr].stats = stats;
1162 rndis_per_dev_params [configNr].filter = cdc_filter;
1167 int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr)
1171 if (configNr >= RNDIS_MAX_CONFIGS) return -1;
1173 rndis_per_dev_params [configNr].vendorID = vendorID;
1174 rndis_per_dev_params [configNr].vendorDescr = vendorDescr;
1179 int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed)
1182 if (configNr >= RNDIS_MAX_CONFIGS) return -1;
1184 rndis_per_dev_params [configNr].medium = medium;
1185 rndis_per_dev_params [configNr].speed = speed;
1204 void rndis_free_response (int configNr, u8 *buf)
1210 &(rndis_per_dev_params [configNr].resp_queue))
1220 u8 *rndis_get_next_response (int configNr, u32 *length)
1228 &(rndis_per_dev_params [configNr].resp_queue))
1241 static rndis_resp_t *rndis_add_response (int configNr, u32 length)
1254 &(rndis_per_dev_params [configNr].resp_queue));