2222 */
2323
2424static int __hw_addr_create_ex (struct netdev_hw_addr_list * list ,
25- unsigned char * addr , int addr_len ,
25+ const unsigned char * addr , int addr_len ,
2626 unsigned char addr_type , bool global )
2727{
2828 struct netdev_hw_addr * ha ;
@@ -46,7 +46,7 @@ static int __hw_addr_create_ex(struct netdev_hw_addr_list *list,
4646}
4747
4848static int __hw_addr_add_ex (struct netdev_hw_addr_list * list ,
49- unsigned char * addr , int addr_len ,
49+ const unsigned char * addr , int addr_len ,
5050 unsigned char addr_type , bool global )
5151{
5252 struct netdev_hw_addr * ha ;
@@ -72,14 +72,15 @@ static int __hw_addr_add_ex(struct netdev_hw_addr_list *list,
7272 return __hw_addr_create_ex (list , addr , addr_len , addr_type , global );
7373}
7474
75- static int __hw_addr_add (struct netdev_hw_addr_list * list , unsigned char * addr ,
76- int addr_len , unsigned char addr_type )
75+ static int __hw_addr_add (struct netdev_hw_addr_list * list ,
76+ const unsigned char * addr , int addr_len ,
77+ unsigned char addr_type )
7778{
7879 return __hw_addr_add_ex (list , addr , addr_len , addr_type , false);
7980}
8081
8182static int __hw_addr_del_ex (struct netdev_hw_addr_list * list ,
82- unsigned char * addr , int addr_len ,
83+ const unsigned char * addr , int addr_len ,
8384 unsigned char addr_type , bool global )
8485{
8586 struct netdev_hw_addr * ha ;
@@ -104,8 +105,9 @@ static int __hw_addr_del_ex(struct netdev_hw_addr_list *list,
104105 return - ENOENT ;
105106}
106107
107- static int __hw_addr_del (struct netdev_hw_addr_list * list , unsigned char * addr ,
108- int addr_len , unsigned char addr_type )
108+ static int __hw_addr_del (struct netdev_hw_addr_list * list ,
109+ const unsigned char * addr , int addr_len ,
110+ unsigned char addr_type )
109111{
110112 return __hw_addr_del_ex (list , addr , addr_len , addr_type , false);
111113}
@@ -278,7 +280,7 @@ EXPORT_SYMBOL(dev_addr_init);
278280 *
279281 * The caller must hold the rtnl_mutex.
280282 */
281- int dev_addr_add (struct net_device * dev , unsigned char * addr ,
283+ int dev_addr_add (struct net_device * dev , const unsigned char * addr ,
282284 unsigned char addr_type )
283285{
284286 int err ;
@@ -303,7 +305,7 @@ EXPORT_SYMBOL(dev_addr_add);
303305 *
304306 * The caller must hold the rtnl_mutex.
305307 */
306- int dev_addr_del (struct net_device * dev , unsigned char * addr ,
308+ int dev_addr_del (struct net_device * dev , const unsigned char * addr ,
307309 unsigned char addr_type )
308310{
309311 int err ;
@@ -390,7 +392,7 @@ EXPORT_SYMBOL(dev_addr_del_multiple);
390392 * @dev: device
391393 * @addr: address to add
392394 */
393- int dev_uc_add_excl (struct net_device * dev , unsigned char * addr )
395+ int dev_uc_add_excl (struct net_device * dev , const unsigned char * addr )
394396{
395397 struct netdev_hw_addr * ha ;
396398 int err ;
@@ -421,7 +423,7 @@ EXPORT_SYMBOL(dev_uc_add_excl);
421423 * Add a secondary unicast address to the device or increase
422424 * the reference count if it already exists.
423425 */
424- int dev_uc_add (struct net_device * dev , unsigned char * addr )
426+ int dev_uc_add (struct net_device * dev , const unsigned char * addr )
425427{
426428 int err ;
427429
@@ -443,7 +445,7 @@ EXPORT_SYMBOL(dev_uc_add);
443445 * Release reference to a secondary unicast address and remove it
444446 * from the device if the reference count drops to zero.
445447 */
446- int dev_uc_del (struct net_device * dev , unsigned char * addr )
448+ int dev_uc_del (struct net_device * dev , const unsigned char * addr )
447449{
448450 int err ;
449451
@@ -543,7 +545,7 @@ EXPORT_SYMBOL(dev_uc_init);
543545 * @dev: device
544546 * @addr: address to add
545547 */
546- int dev_mc_add_excl (struct net_device * dev , unsigned char * addr )
548+ int dev_mc_add_excl (struct net_device * dev , const unsigned char * addr )
547549{
548550 struct netdev_hw_addr * ha ;
549551 int err ;
@@ -566,7 +568,7 @@ int dev_mc_add_excl(struct net_device *dev, unsigned char *addr)
566568}
567569EXPORT_SYMBOL (dev_mc_add_excl );
568570
569- static int __dev_mc_add (struct net_device * dev , unsigned char * addr ,
571+ static int __dev_mc_add (struct net_device * dev , const unsigned char * addr ,
570572 bool global )
571573{
572574 int err ;
@@ -587,7 +589,7 @@ static int __dev_mc_add(struct net_device *dev, unsigned char *addr,
587589 * Add a multicast address to the device or increase
588590 * the reference count if it already exists.
589591 */
590- int dev_mc_add (struct net_device * dev , unsigned char * addr )
592+ int dev_mc_add (struct net_device * dev , const unsigned char * addr )
591593{
592594 return __dev_mc_add (dev , addr , false);
593595}
@@ -600,13 +602,13 @@ EXPORT_SYMBOL(dev_mc_add);
600602 *
601603 * Add a global multicast address to the device.
602604 */
603- int dev_mc_add_global (struct net_device * dev , unsigned char * addr )
605+ int dev_mc_add_global (struct net_device * dev , const unsigned char * addr )
604606{
605607 return __dev_mc_add (dev , addr , true);
606608}
607609EXPORT_SYMBOL (dev_mc_add_global );
608610
609- static int __dev_mc_del (struct net_device * dev , unsigned char * addr ,
611+ static int __dev_mc_del (struct net_device * dev , const unsigned char * addr ,
610612 bool global )
611613{
612614 int err ;
@@ -628,7 +630,7 @@ static int __dev_mc_del(struct net_device *dev, unsigned char *addr,
628630 * Release reference to a multicast address and remove it
629631 * from the device if the reference count drops to zero.
630632 */
631- int dev_mc_del (struct net_device * dev , unsigned char * addr )
633+ int dev_mc_del (struct net_device * dev , const unsigned char * addr )
632634{
633635 return __dev_mc_del (dev , addr , false);
634636}
@@ -642,7 +644,7 @@ EXPORT_SYMBOL(dev_mc_del);
642644 * Release reference to a multicast address and remove it
643645 * from the device if the reference count drops to zero.
644646 */
645- int dev_mc_del_global (struct net_device * dev , unsigned char * addr )
647+ int dev_mc_del_global (struct net_device * dev , const unsigned char * addr )
646648{
647649 return __dev_mc_del (dev , addr , true);
648650}
0 commit comments