浏览代码

[ethernet] Expose eth_broadcast as a global constant

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 11 年前
父节点
当前提交
1cbb1581f1
共有 3 个文件被更改,包括 4 次插入6 次删除
  1. 1
    0
      src/include/ipxe/ethernet.h
  2. 2
    5
      src/net/80211/net80211.c
  3. 1
    1
      src/net/ethernet.c

+ 1
- 0
src/include/ipxe/ethernet.h 查看文件

79
 		 ( ! is_zero_ether_addr ( addr ) ) );
79
 		 ( ! is_zero_ether_addr ( addr ) ) );
80
 }
80
 }
81
 
81
 
82
+extern uint8_t eth_broadcast[];
82
 extern int eth_push ( struct net_device *netdev, struct io_buffer *iobuf,
83
 extern int eth_push ( struct net_device *netdev, struct io_buffer *iobuf,
83
 		      const void *ll_dest, const void *ll_source,
84
 		      const void *ll_dest, const void *ll_source,
84
 		      uint16_t net_proto );
85
 		      uint16_t net_proto );

+ 2
- 5
src/net/80211/net80211.c 查看文件

387
 
387
 
388
 /* ---------- 802.11 link-layer protocol ---------- */
388
 /* ---------- 802.11 link-layer protocol ---------- */
389
 
389
 
390
-/** 802.11 broadcast MAC address */
391
-static u8 net80211_ll_broadcast[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
392
-
393
 /**
390
 /**
394
  * Determine whether a transmission rate uses ERP/OFDM
391
  * Determine whether a transmission rate uses ERP/OFDM
395
  *
392
  *
763
 		return NULL;
760
 		return NULL;
764
 
761
 
765
 	netdev->ll_protocol = &net80211_ll_protocol;
762
 	netdev->ll_protocol = &net80211_ll_protocol;
766
-	netdev->ll_broadcast = net80211_ll_broadcast;
763
+	netdev->ll_broadcast = eth_broadcast;
767
 	netdev->max_pkt_len = IEEE80211_MAX_DATA_LEN;
764
 	netdev->max_pkt_len = IEEE80211_MAX_DATA_LEN;
768
 	netdev_init ( netdev, &net80211_netdev_ops );
765
 	netdev_init ( netdev, &net80211_netdev_ops );
769
 
766
 
1399
 
1396
 
1400
 			ctx->probe = iob;
1397
 			ctx->probe = iob;
1401
 			rc = net80211_tx_mgmt ( dev, IEEE80211_STYPE_PROBE_REQ,
1398
 			rc = net80211_tx_mgmt ( dev, IEEE80211_STYPE_PROBE_REQ,
1402
-						net80211_ll_broadcast,
1399
+						eth_broadcast,
1403
 						iob_disown ( siob ) );
1400
 						iob_disown ( siob ) );
1404
 			if ( rc ) {
1401
 			if ( rc ) {
1405
 				DBGC ( dev, "802.11 %p send probe failed: "
1402
 				DBGC ( dev, "802.11 %p send probe failed: "

+ 1
- 1
src/net/ethernet.c 查看文件

39
  */
39
  */
40
 
40
 
41
 /** Ethernet broadcast MAC address */
41
 /** Ethernet broadcast MAC address */
42
-static uint8_t eth_broadcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
42
+uint8_t eth_broadcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
43
 
43
 
44
 /**
44
 /**
45
  * Add Ethernet link-layer header
45
  * Add Ethernet link-layer header

正在加载...
取消
保存