summaryrefslogtreecommitdiffstats
path: root/arch/mips/alchemy
AgeCommit message (Expand)Author
2014-07-30MIPS: Alchemy: remove old clock supportManuel Lauss
2014-07-30MIPS: Alchemy: au1100fb: use clk frameworkManuel Lauss
2014-07-30MIPS: Alchemy: db1x00: use clk frameworkManuel Lauss
2014-07-30MIPS: Alchemy: usb: use clk frameworkManuel Lauss
2014-07-30MIPS: Alchemy: platform: use clk framework for uartsManuel Lauss
2014-07-30MIPS: Alchemy: clock framework integration of onchip clocksManuel Lauss
2014-07-30MIPS: Alchemy: remove au_read/write/syncManuel Lauss
2014-07-30MIPS: Alchemy: add helpers to access static memory ctrl registers.Manuel Lauss
2014-07-30MIPS: Alchemy: introduce helpers to access SYS register block.Manuel Lauss
2014-06-04MIPS: Replace obsolete strict_strto call with kstrtoDaniel Walter
2014-05-28MIPS: Alchemy: Default to noncoherent IO on Au1200 ABManuel Lauss
2014-03-31Merge branch '3.14-fixes' into mips-for-linux-nextRalf Baechle
2014-03-31MIPS: Fix gigaton of warning building with microMIPS.Ralf Baechle
2014-03-26MIPS: Alchemy: pata_platform for DB1200Manuel Lauss
2014-03-26MIPS: Alchemy: fold mach-db1xxx/db1x00 headers into board codeManuel Lauss
2014-03-26MIPS: Alchemy: Unify Devboard support.Manuel Lauss
2014-03-26MIPS: Alchemy: Determine cohereny at runtime based on cpu typeManuel Lauss
2014-03-06MIPS: Alchemy: Fix unchecked kstrtoul return valueManuel Lauss
2014-02-04MIPS: Alchemy: Fix DB1100 GPIO registrationManuel Lauss
2014-01-24mips: delete non-required instances of include <linux/init.h>Paul Gortmaker
2013-10-29MIPS: Panic messages should not end in \n.Ralf Baechle
2013-09-30MIPS: Alchemy: MTX-1: fix incorrect placement of __initdata tagBartlomiej Zolnierkiewicz
2013-09-18MIPS: Cleanup CP0 PRId and CP1 FPIR register access masksMaciej W. Rozycki
2013-05-22MIPS: Idle: Consolidate all declarations in <asm/idle.h>.Ralf Baechle
2013-05-08MIPS: Kconfig: remove "config MIPS_DISABLE_OBSOLETE_IDE"Paul Bolle
2013-05-08MIPS: remove obsolete Kconfig macrosPaul Bolle
2013-02-01MIPS: Whitespace cleanup.Ralf Baechle
2012-12-27MIPS: Alchemy: Make 32kHz and r4k timer coexist peacefullyManuel Lauss
2012-10-22USB: move common alchemy USB routines to arch/mips/alchemy/common.cFlorian Fainelli
2012-10-22MIPS: Alchemy: use the OHCI platform driverFlorian Fainelli
2012-10-22MIPS: Alchemy: use the ehci platform driverFlorian Fainelli
2012-10-11MIPS: Alchemy: Merge PB1100/1500 support into DB1000 code.Manuel Lauss
2012-10-11MIPS: Alchemy: merge PB1550 support into DB1550 codeManuel Lauss
2012-10-11MIPS: Alchemy: Single kernel for DB1200/1300/1550Manuel Lauss
2012-08-17MIPS: MTX-1: Add udelay to mtx1_pci_idselBruno Randolf
2012-07-25Merge branches 'next/generic', 'next/alchemy', 'next/bcm63xx', 'next/cavium',...Ralf Baechle
2012-07-23MIPS: Alchemy: Use kmemdup rather than duplicating its implementationThomas Meyer
2012-07-23MIPS: Alchemy: use IS_ENABLED() macroFlorian Fainelli
2012-07-23MIPS: Alchemy: handle db1200 cpld ints as they come inManuel Lauss
2012-07-23MIPS: Alchemy: devboards: kill prom.cManuel Lauss
2012-07-23MIPS: Alchemy: use 64MB RAM as minimum for devboardsManuel Lauss
2012-06-01Merge tag 'for-linus-3.5-20120601' of git://git.infradead.org/linux-mtdLinus Torvalds
2012-05-15MIPS: Fix several implicit uses of export.h/module.hPaul Gortmaker
2012-05-13mips: Use the plat_nand default partition parserH Hartley Sweeten
2012-02-20MIPS: Alchemy: Increase minimum timeout for 32kHz timer.Manuel Lauss
2012-01-11Merge branch 'next/alchemy' into mips-for-linux-nextRalf Baechle
2011-12-08MIPS: Alchemy: db1200: Improve PB1200 detection.Manuel Lauss
2011-12-08MIPS: Alchemy: merge Au1000 and Au1300-style IRQ controller code.Manuel Lauss
2011-12-08MIPS: Alchemy: chain IRQ controllers to MIPS IRQ controllerManuel Lauss
2011-12-08MIPS: Alchemy: irq: register pm at irq init timeManuel Lauss
a> 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085
/*
 * net/sched/act_api.c	Packet action API.
 *
 *		This program is free software; you can redistribute it and/or
 *		modify it under the terms of the GNU General Public License
 *		as published by the Free Software Foundation; either version
 *		2 of the License, or (at your option) any later version.
 *
 * Author:	Jamal Hadi Salim
 *
 *
 */

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/err.h>
#include <linux/module.h>
#include <net/net_namespace.h>
#include <net/sock.h>
#include <net/sch_generic.h>
#include <net/act_api.h>
#include <net/netlink.h>

static void free_tcf(struct rcu_head *head)
{
	struct tc_action *p = container_of(head, struct tc_action, tcfa_rcu);

	free_percpu(p->cpu_bstats);
	free_percpu(p->cpu_qstats);
	kfree(p);
}

static void tcf_hash_destroy(struct tcf_hashinfo *hinfo, struct tc_action *p)
{
	spin_lock_bh(&hinfo->lock);
	hlist_del(&p->tcfa_head);
	spin_unlock_bh(&hinfo->lock);
	gen_kill_estimator(&p->tcfa_bstats,
			   &p->tcfa_rate_est);
	/*
	 * gen_estimator est_timer() might access p->tcfa_lock
	 * or bstats, wait a RCU grace period before freeing p
	 */
	call_rcu(&p->tcfa_rcu, free_tcf);
}

int __tcf_hash_release(struct tc_action *p, bool bind, bool strict)
{
	int ret = 0;

	if (p) {
		if (bind)
			p->tcfa_bindcnt--;
		else if (strict && p->tcfa_bindcnt > 0)
			return -EPERM;

		p->tcfa_refcnt--;
		if (p->tcfa_bindcnt <= 0 && p->tcfa_refcnt <= 0) {
			if (p->ops->cleanup)
				p->ops->cleanup(p, bind);
			tcf_hash_destroy(p->hinfo, p);
			ret = ACT_P_DELETED;
		}
	}

	return ret;
}
EXPORT_SYMBOL(__tcf_hash_release);

static int tcf_dump_walker(struct tcf_hashinfo *hinfo, struct sk_buff *skb,
			   struct netlink_callback *cb)
{
	int err = 0, index = -1, i = 0, s_i = 0, n_i = 0;
	struct nlattr *nest;

	spin_lock_bh(&hinfo->lock);

	s_i = cb->args[0];

	for (i = 0; i < (hinfo->hmask + 1); i++) {
		struct hlist_head *head;
		struct tc_action *p;

		head = &hinfo->htab[tcf_hash(i, hinfo->hmask)];

		hlist_for_each_entry_rcu(p, head, tcfa_head) {
			index++;
			if (index < s_i)
				continue;

			nest = nla_nest_start(skb, n_i);
			if (nest == NULL)
				goto nla_put_failure;
			err = tcf_action_dump_1(skb, p, 0, 0);
			if (err < 0) {
				index--;
				nlmsg_trim(skb, nest);
				goto done;
			}
			nla_nest_end(skb, nest);
			n_i++;
			if (n_i >= TCA_ACT_MAX_PRIO)
				goto done;
		}
	}
done:
	spin_unlock_bh(&hinfo->lock);
	if (n_i)
		cb->args[0] += n_i;
	return n_i;

nla_put_failure:
	nla_nest_cancel(skb, nest);
	goto done;
}

static int tcf_del_walker(struct tcf_hashinfo *hinfo, struct sk_buff *skb,
			  const struct tc_action_ops *ops)
{
	struct nlattr *nest