File tree Expand file tree Collapse file tree 5 files changed +70
-6
lines changed Expand file tree Collapse file tree 5 files changed +70
-6
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,20 @@ class EMAC {
155
155
*
156
156
* @param address A multicast group hardware address
157
157
*/
158
- virtual void add_multicast_group (uint8_t *address) = 0;
158
+ virtual void add_multicast_group (const uint8_t *address) = 0;
159
+
160
+ /* * Remove device from a multicast group
161
+ *
162
+ * @param address A multicast group hardware address
163
+ */
164
+ virtual void remove_multicast_group (const uint8_t *address) = 0;
165
+
166
+ /* * Request reception of all multicast packets
167
+ *
168
+ * @param all True to receive all multicasts
169
+ * False to receive only multicasts addressed to specified groups
170
+ */
171
+ virtual void set_all_multicast (bool all) = 0;
159
172
160
173
/* * Sets memory manager that is used to handle memory buffers
161
174
*
Original file line number Diff line number Diff line change @@ -569,9 +569,24 @@ void K64F_EMAC::set_link_state_cb(emac_link_state_change_cb_t state_cb)
569
569
emac_link_state_cb = state_cb;
570
570
}
571
571
572
- void K64F_EMAC::add_multicast_group (uint8_t *addr)
572
+ void K64F_EMAC::add_multicast_group (const uint8_t *addr)
573
573
{
574
- ENET_AddMulticastGroup (ENET, addr);
574
+ ENET_AddMulticastGroup (ENET, const_cast <uint8_t *>(addr));
575
+ }
576
+
577
+ void K64F_EMAC::remove_multicast_group (const uint8_t *addr)
578
+ {
579
+ // ENET HAL doesn't reference count - ENET_LeaveMulticastGroup just maps
580
+ // address to filter bit, and clears that bit, even if shared by other
581
+ // addresses. So don't attempt anything for now.
582
+ }
583
+
584
+ void K64F_EMAC::set_all_multicast (bool all)
585
+ {
586
+ if (all) {
587
+ ENET->GAUR = 0xFFFFFFFFu ;
588
+ ENET->GALR = 0xFFFFFFFFu ;
589
+ }
575
590
}
576
591
577
592
void K64F_EMAC::power_down ()
Original file line number Diff line number Diff line change @@ -115,7 +115,20 @@ class K64F_EMAC : public EMAC {
115
115
*
116
116
* @param address A multicast group hardware address
117
117
*/
118
- virtual void add_multicast_group (uint8_t *address);
118
+ virtual void add_multicast_group (const uint8_t *address);
119
+
120
+ /* * Remove device from a multicast group
121
+ *
122
+ * @param address A multicast group hardware address
123
+ */
124
+ virtual void remove_multicast_group (const uint8_t *address);
125
+
126
+ /* * Request reception of all multicast packets
127
+ *
128
+ * @param all True to receive all multicasts
129
+ * False to receive only multicasts addressed to specified groups
130
+ */
131
+ virtual void set_all_multicast (bool all);
119
132
120
133
/* * Sets memory manager that is used to handle memory buffers
121
134
*
Original file line number Diff line number Diff line change @@ -519,7 +519,17 @@ void STM32_EMAC::set_link_state_cb(emac_link_state_change_cb_t state_cb)
519
519
emac_link_state_cb = state_cb;
520
520
}
521
521
522
- void STM32_EMAC::add_multicast_group (uint8_t *addr)
522
+ void STM32_EMAC::add_multicast_group (const uint8_t *addr)
523
+ {
524
+ /* No-op at this stage */
525
+ }
526
+
527
+ void STM32_EMAC::remove_multicast_group (const uint8_t *addr)
528
+ {
529
+ /* No-op at this stage */
530
+ }
531
+
532
+ void STM32_EMAC::set_all_multicast (bool all)
523
533
{
524
534
/* No-op at this stage */
525
535
}
Original file line number Diff line number Diff line change @@ -126,7 +126,20 @@ class STM32_EMAC : public EMAC {
126
126
*
127
127
* @param address A multicast group hardware address
128
128
*/
129
- virtual void add_multicast_group (uint8_t *address);
129
+ virtual void add_multicast_group (const uint8_t *address);
130
+
131
+ /* * Remove device from a multicast group
132
+ *
133
+ * @param address A multicast group hardware address
134
+ */
135
+ virtual void remove_multicast_group (const uint8_t *address);
136
+
137
+ /* * Request reception of all multicast packets
138
+ *
139
+ * @param all True to receive all multicasts
140
+ * False to receive only multicasts addressed to specified groups
141
+ */
142
+ virtual void set_all_multicast (bool all);
130
143
131
144
/* * Sets memory manager that is used to handle memory buffers
132
145
*
You can’t perform that action at this time.
0 commit comments