aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/commsup.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2006-04-29 01:11:23 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2006-04-29 01:11:23 -0400
commit7b7e394185014e0f3bd8989cac937003f20ef9ce (patch)
tree3beda5f979bba0aa9822534e239cf1b45f3be69c /drivers/scsi/aacraid/commsup.c
parentddc5d3414593e4d7ad7fbd33e7f7517fcc234544 (diff)
parent693f7d362055261882659475d2ef022e32edbff1 (diff)
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/scsi/aacraid/commsup.c')
-rw-r--r--drivers/scsi/aacraid/commsup.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index c7f80ec7abde..9f9f4aae23c0 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -767,9 +767,9 @@ void aac_printf(struct aac_dev *dev, u32 val)
767 if (cp[length] != 0) 767 if (cp[length] != 0)
768 cp[length] = 0; 768 cp[length] = 0;
769 if (level == LOG_AAC_HIGH_ERROR) 769 if (level == LOG_AAC_HIGH_ERROR)
770 printk(KERN_WARNING "aacraid:%s", cp); 770 printk(KERN_WARNING "%s:%s", dev->name, cp);
771 else 771 else
772 printk(KERN_INFO "aacraid:%s", cp); 772 printk(KERN_INFO "%s:%s", dev->name, cp);
773 } 773 }
774 memset(cp, 0, 256); 774 memset(cp, 0, 256);
775} 775}
@@ -784,6 +784,7 @@ void aac_printf(struct aac_dev *dev, u32 val)
784 * dispatches it to the appropriate routine for handling. 784 * dispatches it to the appropriate routine for handling.
785 */ 785 */
786 786
787#define AIF_SNIFF_TIMEOUT (30*HZ)
787static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) 788static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
788{ 789{
789 struct hw_fib * hw_fib = fibptr->hw_fib; 790 struct hw_fib * hw_fib = fibptr->hw_fib;
@@ -837,6 +838,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
837 if (device) { 838 if (device) {
838 dev->fsa_dev[container].config_needed = CHANGE; 839 dev->fsa_dev[container].config_needed = CHANGE;
839 dev->fsa_dev[container].config_waiting_on = AifEnConfigChange; 840 dev->fsa_dev[container].config_waiting_on = AifEnConfigChange;
841 dev->fsa_dev[container].config_waiting_stamp = jiffies;
840 scsi_device_put(device); 842 scsi_device_put(device);
841 } 843 }
842 } 844 }
@@ -849,13 +851,15 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
849 if (container != (u32)-1) { 851 if (container != (u32)-1) {
850 if (container >= dev->maximum_num_containers) 852 if (container >= dev->maximum_num_containers)
851 break; 853 break;
852 if (dev->fsa_dev[container].config_waiting_on == 854 if ((dev->fsa_dev[container].config_waiting_on ==
853 le32_to_cpu(*(u32 *)aifcmd->data)) 855 le32_to_cpu(*(u32 *)aifcmd->data)) &&
856 time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT))
854 dev->fsa_dev[container].config_waiting_on = 0; 857 dev->fsa_dev[container].config_waiting_on = 0;
855 } else for (container = 0; 858 } else for (container = 0;
856 container < dev->maximum_num_containers; ++container) { 859 container < dev->maximum_num_containers; ++container) {
857 if (dev->fsa_dev[container].config_waiting_on == 860 if ((dev->fsa_dev[container].config_waiting_on ==
858 le32_to_cpu(*(u32 *)aifcmd->data)) 861 le32_to_cpu(*(u32 *)aifcmd->data)) &&
862 time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT))
859 dev->fsa_dev[container].config_waiting_on = 0; 863 dev->fsa_dev[container].config_waiting_on = 0;
860 } 864 }
861 break; 865 break;
@@ -872,6 +876,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
872 dev->fsa_dev[container].config_needed = ADD; 876 dev->fsa_dev[container].config_needed = ADD;
873 dev->fsa_dev[container].config_waiting_on = 877 dev->fsa_dev[container].config_waiting_on =
874 AifEnConfigChange; 878 AifEnConfigChange;
879 dev->fsa_dev[container].config_waiting_stamp = jiffies;
875 break; 880 break;
876 881
877 /* 882 /*
@@ -884,6 +889,7 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
884 dev->fsa_dev[container].config_needed = DELETE; 889 dev->fsa_dev[container].config_needed = DELETE;
885 dev->fsa_dev[container].config_waiting_on = 890 dev->fsa_dev[container].config_waiting_on =
886 AifEnConfigChange; 891 AifEnConfigChange;
892 dev->fsa_dev[container].config_waiting_stamp = jiffies;
887 break; 893 break;
888 894
889 /* 895 /*
@@ -894,11 +900,13 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
894 container = le32_to_cpu(((u32 *)aifcmd->data)[1]); 900 container = le32_to_cpu(((u32 *)aifcmd->data)[1]);
895 if (container >= dev->maximum_num_containers) 901 if (container >= dev->maximum_num_containers)
896 break; 902 break;
897 if (dev->fsa_dev[container].config_waiting_on) 903 if (dev->fsa_dev[container].config_waiting_on &&
904 time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT))
898 break; 905 break;
899 dev->fsa_dev[container].config_needed = CHANGE; 906 dev->fsa_dev[container].config_needed = CHANGE;
900 dev->fsa_dev[container].config_waiting_on = 907 dev->fsa_dev[container].config_waiting_on =
901 AifEnConfigChange; 908 AifEnConfigChange;
909 dev->fsa_dev[container].config_waiting_stamp = jiffies;
902 break; 910 break;
903 911
904 case AifEnConfigChange: 912 case AifEnConfigChange:
@@ -913,13 +921,15 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
913 if (container != (u32)-1) { 921 if (container != (u32)-1) {
914 if (container >= dev->maximum_num_containers) 922 if (container >= dev->maximum_num_containers)
915 break; 923 break;
916 if (dev->fsa_dev[container].config_waiting_on == 924 if ((dev->fsa_dev[container].config_waiting_on ==
917 le32_to_cpu(*(u32 *)aifcmd->data)) 925 le32_to_cpu(*(u32 *)aifcmd->data)) &&
926 time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT))
918 dev->fsa_dev[container].config_waiting_on = 0; 927 dev->fsa_dev[container].config_waiting_on = 0;
919 } else for (container = 0; 928 } else for (container = 0;
920 container < dev->maximum_num_containers; ++container) { 929 container < dev->maximum_num_containers; ++container) {
921 if (dev->fsa_dev[container].config_waiting_on == 930 if ((dev->fsa_dev[container].config_waiting_on ==
922 le32_to_cpu(*(u32 *)aifcmd->data)) 931 le32_to_cpu(*(u32 *)aifcmd->data)) &&
932 time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT))
923 dev->fsa_dev[container].config_waiting_on = 0; 933 dev->fsa_dev[container].config_waiting_on = 0;
924 } 934 }
925 break; 935 break;
@@ -946,6 +956,8 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
946 dev->fsa_dev[container].config_waiting_on = 956 dev->fsa_dev[container].config_waiting_on =
947 AifEnContainerChange; 957 AifEnContainerChange;
948 dev->fsa_dev[container].config_needed = ADD; 958 dev->fsa_dev[container].config_needed = ADD;
959 dev->fsa_dev[container].config_waiting_stamp =
960 jiffies;
949 } 961 }
950 } 962 }
951 if ((((u32 *)aifcmd->data)[1] == cpu_to_le32(AifJobCtrZero)) 963 if ((((u32 *)aifcmd->data)[1] == cpu_to_le32(AifJobCtrZero))
@@ -961,6 +973,8 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
961 dev->fsa_dev[container].config_waiting_on = 973 dev->fsa_dev[container].config_waiting_on =
962 AifEnContainerChange; 974 AifEnContainerChange;
963 dev->fsa_dev[container].config_needed = DELETE; 975 dev->fsa_dev[container].config_needed = DELETE;
976 dev->fsa_dev[container].config_waiting_stamp =
977 jiffies;
964 } 978 }
965 } 979 }
966 break; 980 break;
@@ -969,8 +983,9 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
969 device_config_needed = NOTHING; 983 device_config_needed = NOTHING;
970 for (container = 0; container < dev->maximum_num_containers; 984 for (container = 0; container < dev->maximum_num_containers;
971 ++container) { 985 ++container) {
972 if ((dev->fsa_dev[container].config_waiting_on == 0) 986 if ((dev->fsa_dev[container].config_waiting_on == 0) &&
973 && (dev->fsa_dev[container].config_needed != NOTHING)) { 987 (dev->fsa_dev[container].config_needed != NOTHING) &&
988 time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) {
974 device_config_needed = 989 device_config_needed =
975 dev->fsa_dev[container].config_needed; 990 dev->fsa_dev[container].config_needed;
976 dev->fsa_dev[container].config_needed = NOTHING; 991 dev->fsa_dev[container].config_needed = NOTHING;