• Home
  • Raw
  • Download

Lines Matching refs:snpdev

119 static void efi_snp_set_mode ( struct efi_snp_device *snpdev ) {  in efi_snp_set_mode()  argument
120 struct net_device *netdev = snpdev->netdev; in efi_snp_set_mode()
121 EFI_SIMPLE_NETWORK_MODE *mode = &snpdev->mode; in efi_snp_set_mode()
146 static void efi_snp_poll ( struct efi_snp_device *snpdev ) { in efi_snp_poll() argument
155 list_for_each_entry ( iobuf, &snpdev->netdev->rx_queue, list ) in efi_snp_poll()
157 netdev_poll ( snpdev->netdev ); in efi_snp_poll()
158 list_for_each_entry ( iobuf, &snpdev->netdev->rx_queue, list ) in efi_snp_poll()
162 snpdev->rx_count_interrupts += arrived; in efi_snp_poll()
163 snpdev->rx_count_events += arrived; in efi_snp_poll()
174 struct efi_snp_device *snpdev = in efi_snp_start() local
177 DBGC2 ( snpdev, "SNPDEV %p START\n", snpdev ); in efi_snp_start()
179 snpdev->mode.State = EfiSimpleNetworkStarted; in efi_snp_start()
191 struct efi_snp_device *snpdev = in efi_snp_stop() local
194 DBGC2 ( snpdev, "SNPDEV %p STOP\n", snpdev ); in efi_snp_stop()
196 snpdev->mode.State = EfiSimpleNetworkStopped; in efi_snp_stop()
211 struct efi_snp_device *snpdev = in efi_snp_initialize() local
215 DBGC2 ( snpdev, "SNPDEV %p INITIALIZE (%ld extra RX, %ld extra TX)\n", in efi_snp_initialize()
216 snpdev, ( ( unsigned long ) extra_rx_bufsize ), in efi_snp_initialize()
219 if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) { in efi_snp_initialize()
220 DBGC ( snpdev, "SNPDEV %p could not open %s: %s\n", in efi_snp_initialize()
221 snpdev, snpdev->netdev->name, strerror ( rc ) ); in efi_snp_initialize()
225 snpdev->mode.State = EfiSimpleNetworkInitialized; in efi_snp_initialize()
238 struct efi_snp_device *snpdev = in efi_snp_reset() local
242 DBGC2 ( snpdev, "SNPDEV %p RESET (%s extended verification)\n", in efi_snp_reset()
243 snpdev, ( ext_verify ? "with" : "without" ) ); in efi_snp_reset()
245 netdev_close ( snpdev->netdev ); in efi_snp_reset()
246 snpdev->mode.State = EfiSimpleNetworkStarted; in efi_snp_reset()
248 if ( ( rc = netdev_open ( snpdev->netdev ) ) != 0 ) { in efi_snp_reset()
249 DBGC ( snpdev, "SNPDEV %p could not reopen %s: %s\n", in efi_snp_reset()
250 snpdev, snpdev->netdev->name, strerror ( rc ) ); in efi_snp_reset()
254 snpdev->mode.State = EfiSimpleNetworkInitialized; in efi_snp_reset()
266 struct efi_snp_device *snpdev = in efi_snp_shutdown() local
269 DBGC2 ( snpdev, "SNPDEV %p SHUTDOWN\n", snpdev ); in efi_snp_shutdown()
271 netdev_close ( snpdev->netdev ); in efi_snp_shutdown()
272 snpdev->mode.State = EfiSimpleNetworkStarted; in efi_snp_shutdown()
291 struct efi_snp_device *snpdev = in efi_snp_receive_filters() local
295 DBGC2 ( snpdev, "SNPDEV %p RECEIVE_FILTERS %08x&~%08x%s %ld mcast\n", in efi_snp_receive_filters()
296 snpdev, enable, disable, ( mcast_reset ? " reset" : "" ), in efi_snp_receive_filters()
299 DBGC2_HDA ( snpdev, i, &mcast[i], in efi_snp_receive_filters()
300 snpdev->netdev->ll_protocol->ll_addr_len ); in efi_snp_receive_filters()
318 struct efi_snp_device *snpdev = in efi_snp_station_address() local
320 struct ll_protocol *ll_protocol = snpdev->netdev->ll_protocol; in efi_snp_station_address()
322 DBGC2 ( snpdev, "SNPDEV %p STATION_ADDRESS %s\n", snpdev, in efi_snp_station_address()
327 new = &snpdev->mode.PermanentAddress; in efi_snp_station_address()
328 memcpy ( snpdev->netdev->ll_addr, new, ll_protocol->ll_addr_len ); in efi_snp_station_address()
331 if ( snpdev->netdev->state & NETDEV_OPEN ) { in efi_snp_station_address()
332 DBGC ( snpdev, "SNPDEV %p MAC address changed while net " in efi_snp_station_address()
333 "devive open\n", snpdev ); in efi_snp_station_address()
351 struct efi_snp_device *snpdev = in efi_snp_statistics() local
355 DBGC2 ( snpdev, "SNPDEV %p STATISTICS%s", snpdev, in efi_snp_statistics()
360 stats_buf.TxGoodFrames = snpdev->netdev->tx_stats.good; in efi_snp_statistics()
361 stats_buf.TxDroppedFrames = snpdev->netdev->tx_stats.bad; in efi_snp_statistics()
362 stats_buf.TxTotalFrames = ( snpdev->netdev->tx_stats.good + in efi_snp_statistics()
363 snpdev->netdev->tx_stats.bad ); in efi_snp_statistics()
364 stats_buf.RxGoodFrames = snpdev->netdev->rx_stats.good; in efi_snp_statistics()
365 stats_buf.RxDroppedFrames = snpdev->netdev->rx_stats.bad; in efi_snp_statistics()
366 stats_buf.RxTotalFrames = ( snpdev->netdev->rx_stats.good + in efi_snp_statistics()
367 snpdev->netdev->rx_stats.bad ); in efi_snp_statistics()
375 memset ( &snpdev->netdev->tx_stats, 0, in efi_snp_statistics()
376 sizeof ( snpdev->netdev->tx_stats ) ); in efi_snp_statistics()
377 memset ( &snpdev->netdev->rx_stats, 0, in efi_snp_statistics()
378 sizeof ( snpdev->netdev->rx_stats ) ); in efi_snp_statistics()
396 struct efi_snp_device *snpdev = in efi_snp_mcast_ip_to_mac() local
398 struct ll_protocol *ll_protocol = snpdev->netdev->ll_protocol; in efi_snp_mcast_ip_to_mac()
404 DBGC2 ( snpdev, "SNPDEV %p MCAST_IP_TO_MAC %s\n", snpdev, ip_str ); in efi_snp_mcast_ip_to_mac()
409 DBGC ( snpdev, "SNPDEV %p could not hash %s: %s\n", in efi_snp_mcast_ip_to_mac()
410 snpdev, ip_str, strerror ( rc ) ); in efi_snp_mcast_ip_to_mac()
430 struct efi_snp_device *snpdev = in efi_snp_nvdata() local
433 DBGC2 ( snpdev, "SNPDEV %p NVDATA %s %lx+%lx\n", snpdev, in efi_snp_nvdata()
437 DBGC2_HDA ( snpdev, offset, data, len ); in efi_snp_nvdata()
453 struct efi_snp_device *snpdev = in efi_snp_get_status() local
456 DBGC2 ( snpdev, "SNPDEV %p GET_STATUS", snpdev ); in efi_snp_get_status()
459 efi_snp_poll ( snpdev ); in efi_snp_get_status()
469 if ( snpdev->tx_count_interrupts && in efi_snp_get_status()
470 list_empty ( &snpdev->netdev->tx_queue ) ) { in efi_snp_get_status()
472 snpdev->tx_count_interrupts--; in efi_snp_get_status()
475 if ( snpdev->rx_count_interrupts ) { in efi_snp_get_status()
477 snpdev->rx_count_interrupts--; in efi_snp_get_status()
479 DBGC2 ( snpdev, " INTS:%02x", *interrupts ); in efi_snp_get_status()
498 if ( snpdev->tx_count_txbufs && in efi_snp_get_status()
499 list_empty ( &snpdev->netdev->tx_queue ) ) { in efi_snp_get_status()
501 snpdev->tx_count_txbufs--; in efi_snp_get_status()
505 DBGC2 ( snpdev, " TX:%s", ( *txbufs ? "some" : "none" ) ); in efi_snp_get_status()
508 DBGC2 ( snpdev, "\n" ); in efi_snp_get_status()
529 struct efi_snp_device *snpdev = in efi_snp_transmit() local
531 struct ll_protocol *ll_protocol = snpdev->netdev->ll_protocol; in efi_snp_transmit()
536 DBGC2 ( snpdev, "SNPDEV %p TRANSMIT %p+%lx", snpdev, data, in efi_snp_transmit()
540 DBGC2 ( snpdev, " src %s", in efi_snp_transmit()
544 DBGC2 ( snpdev, " dest %s", in efi_snp_transmit()
548 DBGC2 ( snpdev, " proto %04x", *net_proto ); in efi_snp_transmit()
551 DBGC2 ( snpdev, "\n" ); in efi_snp_transmit()
556 DBGC ( snpdev, "SNPDEV %p TX invalid header length " in efi_snp_transmit()
557 "%ld\n", snpdev, in efi_snp_transmit()
563 DBGC ( snpdev, "SNPDEV %p invalid packet length %ld\n", in efi_snp_transmit()
564 snpdev, ( ( unsigned long ) len ) ); in efi_snp_transmit()
569 DBGC ( snpdev, "SNPDEV %p TX missing destination " in efi_snp_transmit()
570 "address\n", snpdev ); in efi_snp_transmit()
575 DBGC ( snpdev, "SNPDEV %p TX missing network " in efi_snp_transmit()
576 "protocol\n", snpdev ); in efi_snp_transmit()
581 ll_src = &snpdev->mode.CurrentAddress; in efi_snp_transmit()
587 DBGC ( snpdev, "SNPDEV %p TX could not allocate %ld-byte " in efi_snp_transmit()
588 "buffer\n", snpdev, ( ( unsigned long ) len ) ); in efi_snp_transmit()
597 if ( ( rc = ll_protocol->push ( snpdev->netdev, in efi_snp_transmit()
600 DBGC ( snpdev, "SNPDEV %p TX could not construct " in efi_snp_transmit()
601 "header: %s\n", snpdev, strerror ( rc ) ); in efi_snp_transmit()
608 if ( ( rc = netdev_tx ( snpdev->netdev, iob_disown ( iobuf ) ) ) != 0){ in efi_snp_transmit()
609 DBGC ( snpdev, "SNPDEV %p TX could not transmit: %s\n", in efi_snp_transmit()
610 snpdev, strerror ( rc ) ); in efi_snp_transmit()
616 snpdev->tx_count_interrupts++; in efi_snp_transmit()
617 snpdev->tx_count_txbufs++; in efi_snp_transmit()
646 struct efi_snp_device *snpdev = in efi_snp_receive() local
648 struct ll_protocol *ll_protocol = snpdev->netdev->ll_protocol; in efi_snp_receive()
656 DBGC2 ( snpdev, "SNPDEV %p RECEIVE %p(+%lx)", snpdev, data, in efi_snp_receive()
660 efi_snp_poll ( snpdev ); in efi_snp_receive()
663 iobuf = netdev_rx_dequeue ( snpdev->netdev ); in efi_snp_receive()
665 DBGC2 ( snpdev, "\n" ); in efi_snp_receive()
669 DBGC2 ( snpdev, "+%zx\n", iob_len ( iobuf ) ); in efi_snp_receive()
676 if ( ( rc = ll_protocol->pull ( snpdev->netdev, iobuf, &iob_ll_dest, in efi_snp_receive()
678 DBGC ( snpdev, "SNPDEV %p could not parse header: %s\n", in efi_snp_receive()
679 snpdev, strerror ( rc ) ); in efi_snp_receive()
711 struct efi_snp_device *snpdev = context; in efi_snp_wait_for_packet() local
713 DBGCP ( snpdev, "SNPDEV %p WAIT_FOR_PACKET\n", snpdev ); in efi_snp_wait_for_packet()
716 if ( ! ( snpdev->netdev->state & NETDEV_OPEN ) ) in efi_snp_wait_for_packet()
720 efi_snp_poll ( snpdev ); in efi_snp_wait_for_packet()
723 if ( snpdev->rx_count_events != 0 ) { in efi_snp_wait_for_packet()
724 DBGC2 ( snpdev, "SNPDEV %p firing WaitForPacket event\n", in efi_snp_wait_for_packet()
725 snpdev ); in efi_snp_wait_for_packet()
727 snpdev->rx_count_events--; in efi_snp_wait_for_packet()
826 struct efi_snp_device *snpdev = NULL; in efi_snp_snpdev() local
840 snpdev = container_of ( u.snp, struct efi_snp_device, snp ); in efi_snp_snpdev()
842 driver, device, snpdev ); in efi_snp_snpdev()
847 return snpdev; in efi_snp_snpdev()
887 struct efi_snp_device *snpdev; in efi_snp_driver_start() local
917 snpdev = zalloc ( sizeof ( *snpdev ) + path_prefix_len + in efi_snp_driver_start()
919 if ( ! snpdev ) { in efi_snp_driver_start()
927 DBGC ( snpdev, "SNPDEV %p cannot find netdev for device %p\n", in efi_snp_driver_start()
928 snpdev, device ); in efi_snp_driver_start()
932 snpdev->netdev = netdev_get ( netdev ); in efi_snp_driver_start()
936 DBGC ( snpdev, "SNPDEV %p cannot support link-layer address " in efi_snp_driver_start()
937 "length %d for %s\n", snpdev, in efi_snp_driver_start()
944 memcpy ( &snpdev->snp, &efi_snp_device_snp, sizeof ( snpdev->snp ) ); in efi_snp_driver_start()
945 snpdev->snp.Mode = &snpdev->mode; in efi_snp_driver_start()
947 efi_snp_wait_for_packet, snpdev, in efi_snp_driver_start()
948 &snpdev->snp.WaitForPacket ) ) != 0 ){ in efi_snp_driver_start()
949 DBGC ( snpdev, "SNPDEV %p could not create event: %s\n", in efi_snp_driver_start()
950 snpdev, efi_strerror ( efirc ) ); in efi_snp_driver_start()
955 snpdev->mode.State = EfiSimpleNetworkStopped; in efi_snp_driver_start()
956 efi_snp_set_mode ( snpdev ); in efi_snp_driver_start()
959 snpdev->nii.Revision = in efi_snp_driver_start()
961 strncpy ( snpdev->nii.StringId, "gPXE", in efi_snp_driver_start()
962 sizeof ( snpdev->nii.StringId ) ); in efi_snp_driver_start()
967 assert ( i < ( sizeof ( snpdev->name ) / in efi_snp_driver_start()
968 sizeof ( snpdev->name[0] ) ) ); in efi_snp_driver_start()
969 snpdev->name[i] = netdev->name[i]; in efi_snp_driver_start()
973 memcpy ( &snpdev->path, path, path_prefix_len ); in efi_snp_driver_start()
974 macpath = ( ( ( void * ) &snpdev->path ) + path_prefix_len ); in efi_snp_driver_start()
990 &snpdev->handle, in efi_snp_driver_start()
991 &efi_simple_network_protocol_guid, &snpdev->snp, in efi_snp_driver_start()
992 &efi_device_path_protocol_guid, &snpdev->path, in efi_snp_driver_start()
993 &efi_nii_protocol_guid, &snpdev->nii, in efi_snp_driver_start()
994 &efi_nii31_protocol_guid, &snpdev->nii, in efi_snp_driver_start()
996 DBGC ( snpdev, "SNPDEV %p could not install protocols: " in efi_snp_driver_start()
997 "%s\n", snpdev, efi_strerror ( efirc ) ); in efi_snp_driver_start()
1001 DBGC ( snpdev, "SNPDEV %p installed for %s as device %p\n", in efi_snp_driver_start()
1002 snpdev, netdev->name, snpdev->handle ); in efi_snp_driver_start()
1006 snpdev->handle, in efi_snp_driver_start()
1007 &efi_simple_network_protocol_guid, &snpdev->snp, in efi_snp_driver_start()
1008 &efi_device_path_protocol_guid, &snpdev->path, in efi_snp_driver_start()
1009 &efi_nii_protocol_guid, &snpdev->nii, in efi_snp_driver_start()
1010 &efi_nii31_protocol_guid, &snpdev->nii, in efi_snp_driver_start()
1013 bs->CloseEvent ( snpdev->snp.WaitForPacket ); in efi_snp_driver_start()
1018 free ( snpdev ); in efi_snp_driver_start()
1041 struct efi_snp_device *snpdev; in efi_snp_driver_stop() local
1047 snpdev = efi_snp_snpdev ( driver, device ); in efi_snp_driver_stop()
1048 if ( ! snpdev ) { in efi_snp_driver_stop()
1056 snpdev->handle, in efi_snp_driver_stop()
1057 &efi_simple_network_protocol_guid, &snpdev->snp, in efi_snp_driver_stop()
1058 &efi_device_path_protocol_guid, &snpdev->path, in efi_snp_driver_stop()
1059 &efi_nii_protocol_guid, &snpdev->nii, in efi_snp_driver_stop()
1060 &efi_nii31_protocol_guid, &snpdev->nii, in efi_snp_driver_stop()
1062 bs->CloseEvent ( snpdev->snp.WaitForPacket ); in efi_snp_driver_stop()
1063 netdev_put ( snpdev->netdev ); in efi_snp_driver_stop()
1064 free ( snpdev ); in efi_snp_driver_stop()